liveBook · Manning

Randomness

As explained in Hacking Cryptography

Randomness is the absence of a predictable pattern in an outcome or sequence according to a specified model of probability.

Randomness describes outcomes or sequences without a predictable pattern under a specified probability model. In cryptography, the practical test is whether an attacker can predict generated values. Random number generators produce sequences for this purpose, but insecure generators such as linear-congruential generators must not protect secrets. section 2.0

From calculator buttons to cryptographic secrets

A calculator’s RAND button appears to decide independently, much as a magician asking for a number from 1 to 10 expects an answer they cannot guess. Cryptographic systems require the stronger engineering property that keys, initialization vectors, nonces, padding values, and salts remain unpredictable. Even a secure algorithm can fail when its random input is guessable; ECDSA, for example, can be broken when an attacker guesses only a few bytes of its signing nonce. section 2.0 section 10.2

Treat randomness as an explicit security dependency:

  • Use high-quality randomness wherever cryptography generates keys, initialization vectors, HMAC inputs, signatures, padding values, or password salts. section 10.2
  • Convert physical entropy into digital bits, continuously run statistical health tests against the expected noise model, and use a tested TRNG to periodically reseed a CSPRNG. section 10.2
  • Inspect randomness as an engineering responsibility rather than assuming the surrounding algorithm will compensate for weak or predictable input. section 10.2
Figure 10.2 The recommended setup for using randomness for cryptographic applications: health tests should ensure the correct operation of the TRNG, which should periodically reseed a CSPRNG.
figure

Trace the recommended path from physical entropy through health-tested random generation to periodic CSPRNG reseeding. section 10.2

How Hacking Cryptography covers it

How deep it goes
Explains unpredictability, contrasts RNG types, traces entropy sourcing, and identifies weak randomness as an algorithm-breaking failure.
Examples
Uses calculator RAND, magician-selected numbers, cryptographic keys and salts, and predictable ECDSA nonces as concrete examples.
What it assumes
Assumes basic cryptographic context while building intuition about determinism, unpredictability, RNGs, entropy, and secret inputs.
What you can do after
Evaluate cryptographic implementations for randomness dependencies and diagnose how poor-quality random input can nullify algorithmic security.
How it connects
Connects randomness to random number generators, entropy, cryptography, initialization vectors, salts, nonces, TRNGs, and CSPRNGs.

Also explained in

Compare how 5 books explain randomness →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.