Entropy and Random Number Generation in Cryptographic Systems
Cryptographic systems depend on unpredictability as a foundational property — without it, keys can be reconstructed, sessions hijacked, and ciphertext reversed. Entropy, the measurable quantity of randomness available to a system, directly determines whether generated keys, nonces, and initialization vectors are computationally infeasible to predict. This page covers the definitions, mechanisms, failure modes, and professional decision points relevant to entropy and random number generation (RNG) across US cryptographic contexts.
Definition and scope
Entropy, in the information-theoretic sense formalized by Claude Shannon in 1948, measures uncertainty in a data source. In cryptographic practice, entropy is quantified in bits: a source yielding 256 bits of entropy produces values that cannot be predicted without exhausting 2²⁵⁶ possibilities. NIST SP 800-90B, Recommendation for the Entropy Sources Used for Random Bit Generation, defines entropy sources and establishes testing requirements for cryptographic modules.
Random number generators in cryptographic systems fall into three recognized classifications:
- True Random Number Generators (TRNGs) — draw from physical phenomena (thermal noise, radioactive decay, photon timing). Output is non-deterministic.
- Pseudorandom Number Generators (PRNGs) — algorithmic processes that produce statistically random-appearing sequences from a deterministic seed. Predictable if the seed is known.
- Cryptographically Secure Pseudorandom Number Generators (CSPRNGs) — a constrained subclass of PRNGs meeting forward secrecy and backtracking resistance requirements. NIST SP 800-90A defines approved CSPRNG constructions including Hash_DRBG, HMAC_DRBG, and CTR_DRBG.
The scope of entropy requirements extends across key management practices, certificate issuance by certificate authorities, and session negotiation in TLS/SSL protocols. Systems subject to FIPS 140 validation must use entropy sources and DRBGs that conform to NIST SP 800-90A and SP 800-90B.
How it works
Entropy generation follows a structured pipeline from raw physical collection through conditioning, health testing, and output seeding.
Phase 1 — Entropy Collection
Hardware sources (ring oscillators, jitter-based circuits, hardware security module internal sensors) sample physical phenomena. Operating systems such as Linux expose this through /dev/random and /dev/urandom interfaces, which pool hardware events including interrupt timing and disk I/O latency. Windows uses the CNG (Cryptography Next Generation) API, which draws from similar hardware event pools.
Phase 2 — Conditioning
Raw entropy samples contain bias and correlation. Conditioning functions — typically hash-based extractors — compress raw bits into a smaller, statistically uniform output. NIST SP 800-90B specifies approved conditioning components and their entropy estimation requirements.
Phase 3 — Health Testing
NIST SP 800-90B mandates two categories of continuous health tests: the Repetition Count Test (RCT) and Adaptive Proportion Test (APT). These detect entropy source failures in real time. Startup tests run before the entropy source is first used.
Phase 4 — DRBG Seeding and Output
The conditioned entropy seeds a Deterministic Random Bit Generator. The DRBG maintains internal state and produces output bitstrings on demand. Reseeding intervals are bounded: NIST SP 800-90A limits CTR_DRBG with AES-256 to 2⁴⁸ generate requests before mandatory reseeding.
Hardware Security Modules (HSMs) typically embed certified TRNGs compliant with FIPS 140-2 or FIPS 140-3, bypassing reliance on OS-level entropy pools for high-assurance applications.
Common scenarios
Key Generation
Asymmetric key pairs for RSA and elliptic curve cryptography require high-quality entropy at generation time. A 2012 research study published by Lenstra, Heninger, and collaborators identified that approximately 0.2% of RSA public keys in a corpus of 7.1 million certificates shared prime factors — a direct consequence of weak entropy during key generation on embedded and network devices.
Session Nonces and Initialization Vectors
TLS handshakes require nonces and random session identifiers. Reuse of nonces in AEAD cipher modes (such as AES-GCM) catastrophically compromises confidentiality. The IETF documents nonce requirements in RFC 5246 and RFC 8446.
Virtual and Cloud Environments
Virtualized guests present a structural entropy starvation problem: virtualized hardware lacks the physical interrupt diversity of bare-metal systems. Cloud providers including those operating under FedRAMP requirements address this through paravirtualized entropy devices (virtio-rng) or by exposing host hardware RNG output to guests. Intel's RDRAND and RDSEED CPU instructions provide hardware entropy accessible inside virtual machines.
Embedded and IoT Devices
Low-power microcontrollers used in IoT deployments frequently lack hardware RNG peripherals, forcing reliance on software entropy pools seeded from predictable boot-time values. NIST IR 8259A identifies entropy quality as a core IoT device cybersecurity baseline capability.
Post-Quantum Cryptography
NIST's post-quantum algorithm selections (CRYSTALS-Kyber, CRYSTALS-Dilithium, SPHINCS+) retain dependence on high-entropy random number generation for key encapsulation and signing. Entropy requirements do not diminish under lattice-based schemes.
Decision boundaries
Practitioners and system architects face defined decision points when specifying RNG components for cryptographic systems:
- FIPS compliance required vs. not required: Federal systems and contractors must use NIST SP 800-90A-approved DRBGs. Commercial systems without federal contracts may use non-FIPS CSPRNGs, though NIST recommendations represent the recognized industry baseline.
- TRNG vs. CSPRNG: Applications demanding the highest assurance (certificate authority root key generation, HSM master key derivation) specify TRNGs. General-purpose application-layer key generation typically relies on OS-level CSPRNGs seeded from hardware entropy.
- Entropy estimation vs. assumption: SP 800-90B requires entropy to be estimated through statistical testing and documented — not assumed. Systems submitting to FIPS 140-3 validation under CMVP (Cryptographic Module Validation Program) must provide entropy source documentation meeting SP 800-90B.
- Reseed frequency: Long-lived server processes must implement reseeding. Failure to reseed after state compromise eliminates forward secrecy guarantees that DRBGs are designed to provide.
The NIST cryptographic guidelines and the CMVP, administered jointly by NIST and the Canadian Centre for Cyber Security, define the authoritative conformance framework for entropy and RNG in US-regulated cryptographic contexts.
References
- NIST SP 800-90A Rev 1 — Recommendation for Random Number Generation Using Deterministic Random Bit Generators
- NIST SP 800-90B — Recommendation for the Entropy Sources Used for Random Bit Generation
- NIST IR 8259A — IoT Device Cybersecurity Capability Core Baseline
- NIST Cryptographic Module Validation Program (CMVP)
- IETF RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3
- IETF RFC 4086 — Randomness Requirements for Security