I need to test a random number generator which produces numbers randomly. How to make sure the numbers generated are random.
Hypothesis: To test the run test of randomness, first set up the null and alternative hypothesis. In run test of randomness, null hypothesis assumes that the distributions of the two continuous populations are the same. The alternative hypothesis will be the opposite of the null hypothesis.
You can't. It is impossible to verify that the output of a purported random generator is random enough for cryptography. (It is possible to verify that it's random enough for some applications such as Monte Carlo numerical methods, but not, say, to generate a cryptographic key.)
It is necessary to test random numbers because the random numbers we generate are pseudo random numbers and not real and pseudo random number generator must generate a sequence of such random numbers which are uniformly distributed and they should not be correlated, they should not repeat itself.
You can only test statistical randomness anyway, and that does not prove whether the number sequence is cryptographically strong. Statistically testing a PRNG requires quite a lot (10 or even 100Gbytes) of the generated bits.
Dieharder is a very good testing suite.
http://www.phy.duke.edu/~rgb/General/dieharder.php
And TestU01 is also well-known.
http://www.iro.umontreal.ca/~simardr/testu01/tu01.html
Use chi-square testing. What language are you using? I can offer a C++ example. Basically
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With