Quantum random numbers
Good sources of random numbers are sometimes hard to come by. Random numbers need to be, well, random, which is something that random number tests can measure, but they also need to be readily available—in enormous quantities if at all possible. The recently announced Quantum Random Number Generator from the Australian National University (ANU) fits that bill nicely. It is, according to ScienceDaily, the fastest random number generator in the world.
The researchers have derived "true" random numbers by measuring the fluctuations in a quantum vacuum and providing them on a web site for anyone to use. True random numbers are those that come from a completely unpredictable physical process, as opposed to the more frequently encountered pseudo-random numbers generated by computer algorithms. The site describes the measurements used as follows:
The apparatus used is capable of generating 5.7 gigabits of random numbers
per second, but the site doesn't stream random bits at that rate due to
network bandwidth constraints. As the FAQ points out, there is no actual
guarantee that the numbers are truly random, but the statistics (many of
which are available on the site) show that the output is "consistent
with true randomness
". While any measured physical process could
have some unexpected bias, the only way to detect such a thing is via
statistical measurements of the output. That's true whether you are
flipping a coin 5.7 billion times a second or measuring a quantum vacuum.
So what can one do with such a source of (seemingly) true randomness? The ANU researchers have developed a few amusing examples, including a Matrix-like display driven by the random number stream, but there are practical uses as well. While Linux random numbers are generated using an algorithm (thus, pseudo-random), the entropy pool that feeds the algorithm is filled from (hopefully) unpredictable hardware events (e.g. keyboard, mouse, disk, and network). In some cases, especially for servers or embedded devices, many of the sources of entropy are not available. One could conceivably add entropy from a source of true randomness, either locally via a hardware random number generator or by retrieving some bits from afar.
In his "Wielding the ANU Quantum Random Number Generator" blog post, Luke Macken presents some code to use the stream. There are three parts to his quantumrandom project, a command-line tool to retrieve random data, a Python API for use in programs, and a character devices in user space (CUSE) based /dev/qrandom device. The latter will start three threads (by default) to fetch random numbers from the server, which can then be read from the device.
This isn't the first online source of true random numbers, nor will it be the last, presumably. Also, hardware random number generators are becoming more common, though they may not be producing data at anywhere near the rate of the ANU generator. Doing so would likely be serious overkill for a device targeted at a single system anyway.
As Macken points out, though, there is a potential problem lurking in ANU random numbers. Currently, there is no way to get them via an encrypted connection, which means that a man-in-the-middle adversary could gain access to the random bits. Depending on the application, that may not really be a problem. One could certainly take a suitably small random sample from a giant chunk of the random numbers supplied. Of course, choosing the random number for where to take the sample had better not be predictable either. Maybe a simulated lottery draw could help with that.
There is another question that should at least be considered: how
trustworthy can random numbers downloaded from a server really be? One
hopes that the researchers are on the level, but the security of the server
itself
may be in question. Since it is difficult to gather a large enough sample
to preclude the possibility that some attacker has tampered with the
data—by replaying chunks from a big static file of random numbers for
example—that possibility exists. The fact that the data "looks"
random from the outside is not any kind of guarantee. Caveat "emptor".
| Index entries for this article | |
|---|---|
| Security | Random number generation |