# Does chaining random number generators lead to loss of randomness?

Assume you chain random number generators, i.e use the result of one PRNG as the seed for the next. What kind of errors can that introduce in the randomness of the numbers generated?

-

## migrated from security.stackexchange.comOct 26 '12 at 13:36

This question came from our site for Information security professionals.

The practice you describe is acceptable and secure. As long as each of the cryptographic PRNGs has no weaknesses and you use a seed of sufficient size, this is safe.

Whether it is desirable is a separate question. Do you really have a valid reason why you need to do this? If not, it's just adding unnecessary complexity and extra "moving parts" that can go wrong somehow.

-
I would say that "As long as each of the cryptographic PRNGs has no weaknesses and you use a seed of sufficient size, this is safe". A chain of deterministic cryptographic PRNGs is only as safe as its weakest link, including seed. –  fgrieu Oct 26 '12 at 15:49
Perfect! Thanks for helping me refine the wording to convey my meaning more clearly, @fgrieu. That's exactly what I meant, but you put it better. –  D.W. Oct 26 '12 at 16:17

The construction is going to be at most as secure as the most secure of the PRNGs. So there will be no increase in security, only a worsening in terms of efficiency.

Note that if you use only secure PRNGs (indistinguishability from uniform given a uniformly chosen seed for some security level) the constructed PRNG cannot be less secure than this security level as it would otherwise serve as a distinguisher for the first of the PRNGs in the chain.

-
This is just a bad idea, use an entropy store like /dev/urandom and call it a day.