# Reseeding a PRNG with the generated PRN

Would reseeding a PRNG with the PRN from the previous generation have any effects whatsoever on the quality of the generated numbers; if so, does this depend on the PRNG used, or are the effects generally applicable to any algorithm?

Perhaps I'll enhance the question with some pseudo-code:

firstSeed := get_seed_from_entropy_pool()
seed(firstSeed)
firstPrn := rand()
seed(firstPrn)
nextPrn := rand()

Is nextPrn already of inferior quality? Would quality decrease if repeated?

• I suppose this depends on both the seed and the rand part of the algorithm. Mar 9 '14 at 13:51
• It is only secure if the RNG is secure, the initial seed has enough entropy, and the number of bytes sampled for the seed is large enough. If rand() returns a 32-bit or 64-bit number, then this definitely isn't secure. The seed should be 256 bits. Nov 4 '19 at 19:39

If you take Mersenne Twister with its big period guaranteed and apply the construction you expose, as it returns 32-bit integers, eventually you will get a repeated value that was used to seed previously, so it turns into a loop. You'll get an about $$2^{16}$$ repeating sequence of pseudo randoms, according to the birthday probability, and not the guaranteed generator's period length. This same issue applies to all other generators if it's seeding is deterministic and guarantees that a given seed always generates the same sequence of pseudo randoms.