Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Oct 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.

share|improve this answer
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.

share|improve this answer

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

I am pretty sure CryptGenRandom under windows is now an entropy pool. Although for the first 20 years or so it was a joke.

share|improve this answer
i use windows as my dev platform even though i use linux for absolutely everything else like typing this. – Inemesit Affia Oct 26 '12 at 5:01
I know its a bad idea intuitively but i want to be able to explain why its a bad idea. I'm not worried about performance though – Inemesit Affia Oct 26 '12 at 5:03
@Inemesit Affia that is a question for – Rook Oct 26 '12 at 5:05
@ Rook. I had no idea there was a crypto SE. I actually wanted to post in cs. Ive signed up for crypto could you help me migrate it? – Inemesit Affia Oct 26 '12 at 5:17
@InemesitAffia, just click "flag" at the bottom of your question and leave a note to the moderators. They can migrate it for you. – D.W. Oct 26 '12 at 6:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.