Say I talk to a developer who is using some output of a Pseudo-random number generator in order to do some security task. I know based upon common knowledge that only Cryptographically Secure Pseudo Random Numbers should be used.

However, I want to take this a step further - how would I create a proof-of-concept that the current method is not secure? I would guess that I need a large collection of outputs from this particular PRNG algorithm... But aside from that, I have no idea what else I would need to do. Is there a way for me to use a cryptanalysis tool to derive the seed or salt (assuming there is one)? How can I prove or disprove that such a PRNG is predictable using security auditing tools and/or scripts? Assume the same seed is used.

  • 2
    ".... do some security task. I know based upon common knowledge that only Cryptographically Secure Pseudo Random Numbers should be used." - this is a wrong generalization. There are lots of security tasks where cryptographically secure randomness is irrelevant, for example when picking a salt for a password hash or a nonce in several protocols. It is often (but not always) important in a cryptographic context and that's why it is called cryptographically secure. Feb 11, 2020 at 21:16
  • 1
    Just because its a PRNG doesn't mean that it's going to be predictable in a given application. Imagine a PRNG that reproduces deterministic results based on a seed being used to generate the sequences. Now imagine it's properly re-seeded every 30 seconds. If you've only grabbed a few outputs in that time, there's no good way to deduce the seed, and deducing the seed won't help you for more than 30 seconds in the future anyway.
    – dandavis
    Feb 11, 2020 at 21:48
  • if you want to prove the PRNG itself is biased, look into ENT.EXE, or more specifically, the documented tests it performs.
    – dandavis
    Feb 11, 2020 at 21:50
  • @dandavis I discourage the encouragement of using tools like ENT. If they catch bad data, then the data is REALLY bad. But if ENT or whatever passes some RNG, then your confidence level in the RNG should not increase at all. The misconception that no empirical evidence of an RNG being insecure is some form of compelling evidence that an RNG is secure shouldn't be as widespread as it is. In an ideal world people would understand that things like ENT have zero utility most of the time.But they don't get it in the real world, so tools like it have negative utility. Pure dangerous false confidence Feb 16, 2020 at 19:46

1 Answer 1


A problem you're having here is you're thinking about it in a much too black-box fashion (e.g., collecting a large collection of outputs), which is not what an actual attacker will do. An actual attacker will get as much concrete information about internals as they can, including the PRNG algorithm and the code for the applications that you use it in, and exploit specific details to break it.

So apart from pointing you at programs that demonstrate how trivial it really is to break a bunch of very popular standard library PRNGs, there aren't obvious generalizations to be made here, apart from maybe a bit of cryptanalysis (which is a black art not explainable in a Stack Exchange answer) they're just looking at PRNG code and figuring out what attacks that specific code:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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