Math.random() for cryptography -- instead you
should use algorithms that were designed and tested specifically for
that purpose. JDK 1.1 contains a secure random number generator
designed for cryptography. Probably the best method of key generation
available today is the /dev/random device built into Linux, Solaris and
some other operating systems.
| Name | Period | Time (no JIT / JIT) |
Special properties |
| Ranlux | 10171 | 14.7 s | RANLUX allows the user to adjust the "luxury level" from 0 to 4 to trade speed for quality. At levels 3 and 4 RANLUX is a large advance in quality over previous generators |
| Ranmar | 1043 | 4.2 s | Each RANMAR seed within it's range produces a unique sequence; by splitting up the seed space, collaborating researchers can ensure that they produce sequences that do not overlap. |
| Ranecu | 1018 | 5.8 s | RANECU is an advanced multiplicative linear congruential generator. |
| RanMT | 219937-1 | 7.1 s | The Mersenne twister has an exceptionally long period and is known to be well-distributed in 632-dimensional lag space. |
| RandomJava | ? | 8.0 s | RandomJava wraps up the Math.random() method that comes
with Java. Not reccomended for general use.
|
Download RngPack 1.1 asource code as a gzip-tar file or as a ZIP file. RngPack is free under a BSD Licence.
If you use RngPack in a project, please
send me an E-mail so I can send you news of updates. I'd
be interested in working with anyone who is interested in improving the
code and incorporating the improvements into future versions.