A hardware random number generator is an electronic device that plugs into a computer and produces genuine random numbers.

I would like to know:

  1. How to test hardware random number generators?

  2. What techniques, tools or tricks to solve the problem?

  3. Any practical difficulties, implementation complexities etc.?

  4. Are there any bounds on this problem?

  • 6
    John D. Cook wrote a chapter "Testing a Random Number Generator". Have you read it?
    – dzieciou
    Commented Mar 30, 2014 at 9:52
  • 2
    hardware of random number generators? not software
    – user24700
    Commented Mar 30, 2014 at 16:09
  • I am crafting a Meta post regarding this.
    – corsiKa
    Commented Apr 2, 2014 at 15:29

2 Answers 2


For actually testing an RNG look up the Diehard and Dieharder test libraries, the latter being more recent.


The test would have to be based on the requirement, since all random number generators are "pseudo-random". Here are some questions I would ask:

  • How random does it have to be? A children's game and a jury pool selection application would have different randomness requirements.

  • Once that is established, you would have to run a large enough statistical population to verify the randomness level. Does the pattern repeat every time it is started? Does it favor some starting patterns over others?

  • Knowledge of the application architecture is important. Some designs may have a fixed population of "random" patterns that it simply sequence through and just retains it's last stopping point. That may be intentional and perfectly suitable for some application. (It also simplifies the testing a lot!)

  • 1
    the link in dzieciou's comment has all this and more
    – Rsf
    Commented Apr 1, 2014 at 9:05

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.