For an OTP I need the 'best' random data I can acquire.

Please check if my thinking for stacking PRNGs together in a pipeline can only make the output statistically better, never worse?!

So take a hardware USB PRNG that uses some 'technique' to produce random data, the data may look pretty random - but we may never know if there way a flaw / backdoor / determinicity etc.

What I propose is to take N PRNGs from different manufacturers and XOR data produced in a predefined order, say by jumbling them up in a bag and picking them like lottery numbers. N below is 3, but I'd likely use N=10

PRNG1 ⊕ PRNG2 ⊕ PRNG3 = Output

If any PRNG is 'flawed' - say it produces all 0 bits, it's not a problem since the output of the XOR is no less random than it already was - therefore we can ONLY make the data MORE random / uniform?


PRNG1 ⊕ 0 ⊕ PRNG3 = Still Random Output

and if the flawed PRNG exhibits any randomness even in part, again it contributes to the randomness.

e.g. all 0's except 1 bit which seems random;

PRNG1 ⊕ 00010000 ⊕ PRNG3 = Still Random Output

If that is true then it should be possible to interleave my own private data into the PRNG pipeline, say holiday pictures passed through AES! It really doesn't matter as long as it's data that nobody has access to them, it can only hide any non randomness or non uniformity, it reduces any risk of different PRNG manufacturers colluding, or sharing a technique or taking a flawed or deterministic approach;

PRNG1 ⊕ PIC1 ⊕ PRNG2 ⊕ PIC2 ⊕ PRNG3 = Output
  • $\begingroup$ This is really the same as combining stream ciphers, see e.g. my answer here and indicate if that answers your question. $\endgroup$
    – Maarten Bodewes
    Dec 20, 2019 at 14:36

1 Answer 1


If the different PRNGs are unrelated then I think yes, XOR any bit stream with random bits produce random bits, so the output is random (for your purpose) if one of your input PRNG is random.

Thinking from another angle, let's say one of your PRNG is AES-CTR with a random key, and you managed to make a non random output by XOR with a hardware PRNG, you effectively found a way to break AES. Isn't it an achievement on its own?

Here's the catch. The logic follows only if different PRNGs are really unrelated, with different entropy source, algorithm etc. Getting hardware key from different manufacturers doesn't guarantee that. If the different PRNGs you used are somehow related, it is entirely possible that they "cancelled out" one another and leave you a less random output.

  • $\begingroup$ With the catch you mention "cancelling out" should not be possible if I interleave my own data with XOR. $\endgroup$ Dec 22, 2019 at 7:51

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.