10
$\begingroup$

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?

$\endgroup$

3 Answers 3

6
$\begingroup$

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.

$\endgroup$
2
  • 2
    $\begingroup$ 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. $\endgroup$
    – fgrieu
    Oct 26, 2012 at 15:49
  • $\begingroup$ 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. $\endgroup$
    – D.W.
    Oct 26, 2012 at 16:17
4
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
5
  • $\begingroup$ i use windows as my dev platform even though i use linux for absolutely everything else like typing this. $\endgroup$ Oct 26, 2012 at 5:01
  • 1
    $\begingroup$ 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 $\endgroup$ Oct 26, 2012 at 5:03
  • $\begingroup$ @Inemesit Affia that is a question for crypto.se $\endgroup$
    – Rook
    Oct 26, 2012 at 5:05
  • $\begingroup$ @ 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? $\endgroup$ Oct 26, 2012 at 5:17
  • 1
    $\begingroup$ @InemesitAffia, just click "flag" at the bottom of your question and leave a note to the moderators. They can migrate it for you. $\endgroup$
    – D.W.
    Oct 26, 2012 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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