-
What is the random numbers and where are they used? Who needs something haphazard? Well, the random numbers are used
in numerous applications. The best known ones are encryption systems and lotteries.
In traditional mathematics there are many different kinds of random numbers, of which mainly uniformly distributed
integers or floats directly used in computers.
Random numbers differ by the source, it may be some algorithm, or programming language library function. In this
case numbers depend on some seed value, and are not truly random, and usually called pseudo-random. The sequence
can be easily repeated, if we use the same seed. This can be useful in computer simulations, for example, but
totally unacceptable in cryptography. Also, pseudo random numbers is a sequence that in a long run will repeat
itself.
Another source of random numbers is a hardware devices. There are several companies on the market which produce
hardware random number generators. They differ by cost, quality and speed of number generation. The source of
randomness in such devices usually some thermal noise, which is compared against 0 by the fast comparator. Raw bits,
produced in this way require constant monitoring for hardware failure, and usually have some imperfections:
skew and auto-correlation. To cancel this flaws, post-processing is used.
In general, quality of hardware-generated random numbers is very high. The sequence of such numbers will not repeat.
This numbers are good for cryptography, and as a seed values for pseudo-random generators. How good are they? Well,
the Comscire company boasts of having flaw of 1e-20.
On a contrast, software-based pseudo-random numbers have all kinds of defects, and more and more tests appear.
The best known are battery of tests by prof. George Marsaglia. He is also an author of many generators.
And what do people do who do not have special hardware, but needs security? Well, in this case entropy-gathering
algorithms are used. By measuring exact times of hardware interrupts, we get some unpredictable bits of data,
which later carefully mixed using hashing algorithms. In such way works /dev/random device on Linux/BSD. This
process is painfully slow. Rotating hard drive, for example, produces only few bytes of entropy per second.
The source of entropy in this case is some air turbulence inside of the device.