Exploiting Electronic Noise to Create Random Bits

This post explores how electronic noise can be put to good use as a source of randomness in integrated circuits and introduces our work presented recently at CHES 2024.

A previous post discussed the importance of high-quality random numbers in modern cryptography and explored several methods of post-processing to improve the statistical quality of generated bits. This post now focuses on the challenge of generating the (often imperfect) random numbers that serve as inputs for these post-processing methods.

Sources of Randomness

The figure below shows several processes that produce unpredictable outcomes, making them potential entropy source candidates. However, some options—such as capturing atmospheric noise, using coins or dice, radioactive decay, or quantum effects—are not easily implemented in an integrated circuit, as they need external components such as an antenna, a die or a coin, or some radioactive source. While Quantum events have been successfully exploited in integrated circuits, they require dedicated circuit components such as LEDs or image sensors, increasing the manufacturing cost.

Different methods for collecting randomness.

All options in the bottom row generate randomness based on electronic noise, which naturally occurs in any integrated circuit under normal operating conditions. This means they don’t need any external components and can therefore be implemented efficiently. We will focus on timing jitter, as this technique can be implemented by using only digital circuit elements, making it highly suitable for both ASIC and FPGA platforms.

Ring Oscillator

A ring oscillator is a fundamental building block in many integrated systems. Beyond its use in random number generation, it is also employed in test structures, as voltage-controlled oscillators in phase-locked loops (PLLs), and as on-chip odometers.

A ring oscillator can be made very compact, requiring only a few logic gates. As shown in the image below, an odd number of inverting gates are connected in a feedback loop that begins oscillating as soon as power is applied. Often, an extra NAND gate is added to provide additional inversion and to enable or disable the circuit.

Ring oscillator architecture.

The output of the ring oscillator is a periodic, rail-to-rail oscillating voltage signal. Its frequency is determined by the combined propagation delays of the gates that make up the feedback loop. An example waveform is shown below.

Noiseless ring oscillator output waveform.

Noisy Ring Oscillator

In practice, ring oscillator waveforms won’t look as clean as in the image above. Electronic noise, caused by random movements of charge carriers in the transistor’s conductive channel, leads to slight variations in each run of the ring oscillator. The figure below illustrates this effect, with the variations exaggerated to make them more clear.

Noisy ring oscillator output waveform.

Looking closely at the variations in the figure above, we can see that these variations tend to increase over time—a phenomenon known as jitter accumulation. This happens because there is no restoring force to correct the phase of the ring oscillator. So, when noise disturbs the phase, the effect persists indefinitely, as there is no mechanism to consistently undo the disturbance.

By measuring the sizes of individual variations (d0, d1, … in the image above) and plotting them on a graph against their respective times (t0, t1, …), we can reveal a key property of the noise sources responsible for these variations, as shown in the image below.

Ring oscillator jitter accumulation.

These variations grow linearly over time, though not all noise types behave this way. Different types of noise are caused by different physical mechanisms, each with a unique frequency spectrum. Electrical engineers often describe these as “noise colors”, similar to the frequency spectrum of visible light. For instance, “white noise” has all frequencies at equal intensity, similar to white light, while “pink noise” (also known as flicker noise) favors lower frequencies. Each noise color produces a distinct curve, as shown in the figure below.

Different noise types.

Sampling the Noise

What does all this theory have to do with generating random numbers? At first glance, any type of noise might seem suitable for generating random numbers, since they are all unpredictable. However, it turns out that some types of noise are actually more unpredictable than others.

First, let’s examine how we can extract random bits from a noisy ring oscillator. We use a sampling flip-flop connected to the oscillator’s output, as shown in the figure below. When clocked near the oscillator’s edge, the variations make the sampled oscillator voltage unpredictable, which in turn makes the flip-flop output unpredictable as well.

Sampling the ring oscillator to produce random bits.

Ideally, observing a sequence of generated bits shouldn’t help you predict any future bit. In other words, the probability of correctly guessing the next bit should remain close to 50%, just like a random guess, regardless of any previous bits observed.

Some types of noise, such as flicker FM noise and random walk FM noise, create dependencies between consecutive oscillator periods. This means that if one period of the ring oscillator is longer than usual, the next one is also likely to be longer. Other types, such as white FM noise, don’t show this behavior.

When noise types such as flicker FM noise are present, dependencies in oscillator periods carry over to the generated bitstream. This allows for a more accurate guess of the next bit. Depending on the magnitude of these low-frequency noise types, the chance of you correctly predicting the next bit can increase significantly.

Entropy as a Measure of Randomness

This brings us to an important question: by exactly how much does the chance of correctly predicting the next output bit increase?

First let’s introduce the idea of entropy, which we use to quantify randomness, just as we use length to quantify distance. Entropy tells us how much information we gain when observing the outcome of a random process and is measured in bits of information. You can think of it as the minimal memory size needed to store that outcome. Evidently, a single output bit can carry at most one bit of entropy.

Just as we can measure distance in different ways—the shortest versus the quickest route—entropy also comes in various forms. Min-entropy represents the minimum information we learn from an outcome, while Shannon entropy provides the expected (average) information content.

Our Work at CHES

So, reformulating our main question: how much does entropy decrease when we already observed previous output bits, especially when noise types such as flicker FM noise create dependencies? This is exactly the research question we tackled in our work presented recently at CHES 2024. You are welcome to check out our paper, TRNG Entropy Model in the Presence of Flicker FM Noise. In it, we introduce a method to estimate the available entropy and explore the potential consequences of including flicker FM noise into stochastic models for entropy sources.