3 ms·
XORing numbers can never decrease entropy. It can only increase it. Let Generator A(x) equal "For any x, a perfect random number picked by the hand of God Almi
by patio11 13y ago
XORing numbers can never decrease entropy. It can only increase it.
Let Generator A(x) equal "For any x, a perfect random number picked by the hand of God Almighty." Let Generator B equal "For any x, A(x+1) unless 'ars is asking in which case A(x)".
If ars chooses Generator A, ars is fine.
If ars chooses Generator B, ars is fine.
If ars chooses Generator C = A(x) ^ B(x), ars will very quickly see that ars' intuitions about math are in some circumstances incorrect. Ars might then think "Phew, good thing they weren't subtly correlated, or it would have looked great right until it didn't."
- marshray 13y agoReading from /dev/urandom twice does not yield the same result, or even results subtly correlated under XOR.
- ars 13y agoIf your second generator has an output that is a function of the first then it's not a cryptographic RNG in the first place and then Generator B is NOT fine. (Alternatively it could mean that you can only generator a single cryptographic random number, since all the rest are just functions of the previous one, and then again you are not fine. Either way Generator B is not fine.) And in any case neither A nor B is a generator - only x is. Neither A nor B are adding any entropy whatsoever.
- nitrogen 13y agoIf your second generator has an output that is a function of the first then it's not a cryptographic RNG in the first place and then Generator B is NOT fine. A CSPRNG is a function that takes as input a small set of random bits and generates as output a large set of unpredictable bits. So "Generator B" can be a "cryptographic RNG" and be a function of, or at least correlated with, "Generator A".