I'm planning on combining RNGs from several sources (Windows, Linux, OpenBSD, etc.) for generating one time pads but I have some questions that I don't know how to answer regarding xoring the outputs of those random number generators together. Trying to search for answers to these is not doing well either.
Suppose we have 2 random number generators, g
and h
. If g
is secure and h
is not (an attacker can find some kind of pattern to predict future outputs or an attacker can influence or gather output data from said generator), is g ^ h
secure? I believe this one is yes since if we have bits g1
and h1
and an attacker knows h1
, g1 ^ h1
will be effectively random to said attacker since he does not know what g1
is.
Suppose we have an unbiased random number generator g
and a biased (biased such that p(1) != p(0)
and p(1) = C
for some constant C
) random number generator h
. Is g ^ h
unbiased? I sort of think this is yes but at the same time I'm not sure since then we should be able to just xor any biased (constant) random number generator output with 0xAA
and get an unbiased one.
To go along with the previous question suppose we have a biased (constant like h
in the previous question) random number generator and we xor every other output bit with 1
. Is the output unbiased?