Consider the random generator function in https://www.libsdl.org/tmp/SDL/src/test/SDL_test_random.c
A simplified version is provided below (this is C++, mind that “seed” is a reference):
uint32_t Rand(uint64_t& seed)
{
seed = 1683268614LL * (seed & 0xffffffff) + (seed >> 32);
return seed & 0xffffffff;
}
This is almost a linear congruential generator (LCG), the only difference is that the increment is not a constant, but a part of the seed itself.
My question is on the security of this algorithm, since LCGs are very easy to break.
Does using a non constant increment improve or decrease security? How could this be cracked other than by bruteforceing it?
Continue reading Linear congruential generator with non constant increment [migrated]→