0
$\begingroup$

If I XOR the output from 2 CSPRNG will the result be better (more random) than the output from either one? Assume one of the PRNG is biased.

$\endgroup$
1
  • $\begingroup$ How are they keyed? With two independent keys? Also, if one is a CSPRNG, then it cannot be biased (to be cryptographically secure means that it can't be biased). $\endgroup$
    – D.W.
    Dec 6, 2013 at 1:47

1 Answer 1

1
$\begingroup$

If you XOR two independent streams of two random number generators together then the result is as strong as the strongest of the two.

$\endgroup$
6
  • 2
    $\begingroup$ More generally, if you XOR the streams of two independent random number generators together then the result is as strong as the strongest of the two. $\;$ $\endgroup$
    – user991
    Dec 5, 2013 at 8:20
  • $\begingroup$ How to determine if two PRNG are independent? I am thinking about using the default apple PRNG secCopyRandomBytes and the AutoSeeded RNG from the Botan library? How do I know that both of them don't do similar things inside? $\endgroup$ Dec 5, 2013 at 9:07
  • $\begingroup$ "Unrelated" is NOT the criterion. The criterion is that the keys be independently chosen, not that the algorithms be "unrelated" or "independent" (whatever that would mean). You can even use the same CSPRNG algorithm, as long as you have two independent keys. $\endgroup$
    – D.W.
    Dec 6, 2013 at 1:49
  • $\begingroup$ @D.W. What I meant was that the streams are unrelated, not the algorithms. Updated my answer. $\endgroup$
    – orlp
    Dec 6, 2013 at 3:06
  • 1
    $\begingroup$ If one is totally unbiased and the other is biased, doesn’t the bias “cut through” into the output stream of XOR, though? $\endgroup$
    – mirabilos
    Dec 6, 2013 at 12:07

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