Hardware random number generator


In computing, a hardware random number generator, true random number generator, non-deterministic random bit generator, or physical random number generator is a device that generates random numbers from a physical process capable of producing entropy, unlike a pseudorandom number generator that utilizes a deterministic algorithm and non-physical nondeterministic random bit generators that do not include hardware dedicated to generation of entropy.
Many natural phenomena generate low-level, statistically random "noise" signals, including thermal and shot noise, jitter and metastability of electronic circuits, Brownian motion, and atmospheric noise. Researchers also used the photoelectric effect, involving a beam splitter, other quantum phenomena, and even nuclear decay. While "classical" phenomena are not truly random, an unpredictable physical system is usually acceptable as a source of randomness, so the qualifiers "true" and "physical" are used interchangeably.
A hardware random number generator is expected to output near-perfect random numbers. A physical process usually does not have this property, and a practical TRNG typically includes a few blocks:
  • a noise source that implements the physical process producing the entropy. Usually this process is analog, so a digitizer is used to convert the output of the analog source into a binary representation;
  • a conditioner that improves the quality of the random bits;
  • health tests. TRNGs are mostly used in cryptographical algorithms that get completely broken if the random numbers have low entropy, so the testing functionality is usually included.
Hardware random number generators generally produce only a limited number of random bits per second. In order to increase the available output data rate, they are often used to generate the "seed" for a faster PRNG. PRNG also helps with the noise source "anonymization" and entropy extraction. With a proper PRNG algorithm selected, the combination can satisfy the requirements of Federal Information Processing Standards and Common Criteria standards.

Uses

Hardware random number generators can be used in any application that needs randomness. However, in many scientific applications additional cost and complexity of a TRNG provide no meaningful benefits. TRNGs have additional drawbacks for data science and statistical applications: impossibility to re-run a series of numbers unless they are stored, reliance on an analog physical entity can obscure the failure of the source. The TRNGs therefore are primarily used in the applications where their unpredictability and the impossibility to re-run the sequence of numbers are crucial to the success of the implementation: in cryptography and gambling machines.

Cryptography

The major use for hardware random number generators is in the field of data encryption, for example to create random cryptographic keys and nonces needed to encrypt and sign data. In addition to randomness, there are at least two additional requirements imposed by the cryptographic applications:
  1. forward secrecy guarantees that the knowledge of the past output and internal state of the device should not enable the attacker to predict future data;
  2. backward secrecy protects the "opposite direction": knowledge of the output and internal state in the future should not divulge the preceding data.
A typical way to fulfill these requirements is to use a TRNG to seed a cryptographically secure pseudorandom number generator.

History

Physical devices were used to generate random numbers for thousands of years, primarily for gambling. Dice in particular have been known for more than 5000 years, and flipping
a coin dates at least to the times of ancient Rome.
The first documented use of a physical random number generator for scientific purposes was by Francis Galton. He devised a way to sample a probability distribution using a common gambling die. In addition to the top digit, Galton also looked at the face of a die closest to him, thus creating 6*4 = 24 outcomes.
Kendall and Babington-Smith used a fast-rotating 10-sector disk that was illuminated by periodic bursts of light. The sampling was done by a human who wrote the number under the light beam onto a pad. The device was utilized to produce a 100,000-digit random number table.
On 29 April 1947, the RAND Corporation began generating random digits with an "electronic roulette wheel", consisting of a random frequency pulse source of about 100,000 pulses per second gated once per second with a constant frequency pulse and fed into a five-bit binary counter. Douglas Aircraft built the equipment, implementing Cecil Hasting's suggestion for a noise source. Twenty of the 32 possible counter values were mapped onto the 10 decimal digits and the other 12 counter values were discarded. The results of a long run from the RAND machine, filtered and tested, were converted into a table, which originally existed only as a deck of punched cards, but was later published in 1955 as a book, 50 rows of 50 digits on each page. The RAND table was a significant breakthrough in delivering random numbers because such a large and carefully prepared table had never before been available. It has been a useful source for simulations, modeling, and for deriving the arbitrary constants in cryptographic algorithms to demonstrate that the constants had not been selected maliciously.
Since the early 1950s, research into TRNGs has been highly active, with thousands of research works published and about 2000 patents granted by 2017.

Physical phenomena with random properties

Multiple different TRNG designs were proposed over time with a large variety of noise sources and digitization techniques. However, practical considerations dictate the following desirable traits:
  • use of a commonly available inexpensive silicon process;
  • exclusive use of digital design techniques. This allows an easier system-on-chip integration and enables the use of FPGAs;
  • compact and low-power design. This discourages use of analog components ;
  • mathematical justification of the entropy collection mechanisms.
Stipčević & Koç in 2014 classified the physical phenomena used to implement TRNG into four groups:
  • electrical noise;
  • free-running oscillators;
  • chaos;
  • quantum effects.

    Electrical noise-based RNG

Noise-based RNGs generally follow the same outline: the source of a noise generator is fed into a comparator. If the voltage is above threshold, the comparator output is 1, otherwise 0. The random bit value is latched using a flip-flop. Sources of noise vary and include:
The drawbacks of using noise sources for an RNG design are:
  • noise levels are hard to control, they vary with environmental changes and device-to-device;
  • calibration processes needed to ensure a guaranteed amount of entropy are time-consuming;
  • noise levels are typically low, thus the design requires power-hungry amplifiers. The sensitivity of amplifier inputs enables manipulation by an attacker;
  • circuitry located nearby generates a lot of non-random noise thus lowering the entropy;
  • a proof of randomness is near-impossible as multiple interacting physical processes are involved.

    Chaos-based RNG

The idea of chaos-based noise stems from the use of a complex system that is hard to characterize by observing its behavior over time. For example, lasers can be put into chaos mode with chaotically fluctuating power, with power detected using a photodiode and sampled by a comparator. The design can be quite small, as all photonics elements can be integrated on-chip. Stipčević & Koç characterize this technique as "most objectionable", mostly due to the fact that chaotic behavior is usually controlled by a differential equation and no new randomness is introduced, thus there is a possibility of the chaos-based TRNG producing a limited subset of possible output strings.

Free-running oscillators-based RNG

The TRNGs based on a free-running oscillator typically utilize one or more ring oscillators, outputs of which are sampled using yet another clock. Since inverters forming the RO can be thought of as amplifiers with a very large gain, an FRO output exhibits very fast oscillations in phase and frequency domains. The FRO-based TRNGs are very popular due to their use of the standard digital logic despite issues with randomness proofs and chip-to-chip variability.

Quantum-based RNG

Quantum random number generation technology is well established with 8 commercial quantum random number generator products offered before 2017.
Herrero-Collantes & Garcia-Escartin list the following stochastic processes as "quantum":
  • nuclear decay historically was the earliest quantum method used since the 1960s owing its popularity to the availability of Geiger counters and calibrated radiation sources. The entropy harvesting was done using an event counter that was periodically sampled or a time counter that was sampled at the time of the event. Similar designs were utilized in the 1950s to generate random noise in analog computers. The major drawbacks were radiation safety concerns, low bit rates, and non-uniform distribution;
  • shot noise, a quantum mechanical noise source found in electronic circuits, while technically a quantum effect, is hard to isolate from the thermal noise, so, with few exceptions, noise sources utilizing it are only partially quantum and are usually classified as "classical";
  • quantum optics:
  • * branching path generator using a beamsplitter so that a photon from a single-photon source randomly takes one of the two paths and sensed by one of the two single-photon detectors thus generating a random bit;
  • * time of arrival generators and photon counting generators use a weak photon source, with the entropy harvested similarly to the case of radioactive decay;
  • * attenuated pulse generators are a generalization of the above methods that allows more than one photon in the system at a time;
  • * vacuum fluctuations generators use a laser homodyne detection to probe the changes in the vacuum state;
  • * laser phase noise generators use the phase noise on the output of a single spatial mode laser that is converted to amplitude using an unbalanced Mach-Zehnder interferometer. The noise is sampled by a photodetector;
  • * amplified spontaneous emission generators use spontaneous light emission present in the optical amplifiers as a source of noise;
  • * Raman scattering generators extract entropy from the interaction of photons with the solid-state materials;
  • * optical parametric oscillator generators use the spontaneous parametric down-conversion leading to binary phase state selection in a degenerate optical parametric oscillator;
To reduce costs and increase robustness of quantum random number generators, online services have been implemented.
A plurality of quantum random number generators designs are inherently untestable and thus can be manipulated by adversaries. Mannalath et al. call these designs "trusted" in a sense that they can only operate in a fully controlled, trusted environment.