84 - Random Number Generation

Random numbers are used vastly today. Cryptographic systems base their security on this unpredictability, some secret data that is known to authorized persons but unknown and unpredictable to others.

RNG - Random Number Generators

Hardware or software for generating random numbers, so that

  • Statistically independent, no "bias"
  • Uniformly distributed, no "favorites"
  • Unpredictable, no "guessing"

Breaking randomness breaks security and cryptography!

TRN - True Random Numbers

TRNGs produce a stream of truly random numbers. Knowing the circuit and history is useless. These are called non-deterministic random number generators.

Based on some analog property like physical sources outside of control, an entropy source. This value is whitened and scaled to create the random number set

Most common TRNG source

Amplify noise generated by a resistor or diode, feed it to a comparator, sample the output as a series of bits and use that to generate random numbers

QRNG - Quantum RNG

Random numbers from inherently indeterministic quantum processes

PRNG - Pseudo-Random Number Generator (Deterministic)

Software or Hardware RNG that starts from an initial value called the seed
Such sequence of values generated by a PRNG repeats periodically, is veeeery long, so long that today's PRNG algorithms have such a large period that it can just be ignored

As a consequence though, this seed must be kept secret, and to be truly random must be generated from a TRNG

CSPRNG - Cryptographically Secure PRNG

PRNG that is secure for use in cryptography, must be unpredictable and have a long period, in addition, it must:

  • Satisfy the next-bit test: if someone knows all of the bits from the start they shouldn't be able to predict the next bit
  • Withstand the state compromise extensions: if an attacker guesses the internal state of the PRNG they should be unable to reconstruct all previous random numbers prior to the revelation

Diagnostic Tests

Tests applied to short sequences of bits to detect whether noise is compromised