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.
Asked
Active
Viewed 134 times
0
-
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). – D.W. Dec 06 '13 at 01:47
1 Answers
1
If you XOR two independent streams of two random number generators together then the result is as strong as the strongest of the two.

orlp
- 4,230
- 20
- 29
-
2More 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. $;$ – Dec 05 '13 at 08:20
-
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? – user1028028 Dec 05 '13 at 09:07
-
"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. – D.W. Dec 06 '13 at 01:49
-
@D.W. What I meant was that the streams are unrelated, not the algorithms. Updated my answer. – orlp Dec 06 '13 at 03:06
-
@user1028028, it doesn't matter if the PRNGs are independent. What matters is that their seeds (their keys) are independently chosen. That's how you can tell: check how you've generated them. – D.W. Dec 06 '13 at 03:46
-
1If one is totally unbiased and the other is biased, doesn’t the bias “cut through” into the output stream of XOR, though? – mirabilos Dec 06 '13 at 12:07