← Back to section · Security Risk & Assessment

Randomness: Cryptography's Quietest Single Point of Failure — Debian, Dual_EC and ROCA

Cryptography's most devastating incidents rarely come from the algorithms themselves but from randomness: the entropy collapse in Debian's OpenSSL, the suspicious constants of Dual_EC, the structured primes of ROCA. This article reconstructs the mechanics of all three and draws out their concrete lessons for post-quantum implementations.

Published 22 November 2026 · 7 min read · PQ Frontier

Randomness: Cryptography's Quietest Single Point of Failure — Debian, Dual_EC and ROCA
AI-generated site artwork
Video explainer · Implementation Flaws: defects a Merkle-tree check exposes

Three incidents, three ways to die

Debian OpenSSL (2008): entropy collapse. In 2006, a Debian maintainer, working to silence warnings from the Valgrind memory checker, commented out two lines in OpenSSL’s random number generator that mixed data into the entropy pool — one of them the critical path that collected entropy from the operating system. The result: for almost two years, keys generated on Debian and derivatives such as Ubuntu drew their randomness from essentially one source, the process ID (PID) — about 15 bits, 32,767 possibilities. SSH keys, TLS certificates and OpenVPN keys were all enumerable. The incident was disclosed in May 2008 as security advisory DSA-1571-1, and the cleanup required mass key revocation and rotation across the internet. The algorithm was fine; a single “harmless” edit had drained the entropy.

Dual_EC_DRBG (suspicions 2007, removed 2014): suspicious constants. This elliptic-curve-based random number generator was written into NIST SP 800-90 and shipped as the default in some products, including RSA’s BSAFE library. In 2007, Shumow and Ferguson publicly showed that if the relationship between two elliptic-curve points in the generator had been arranged in advance by its designer, whoever knew that relationship could work back from the output to the internal state and predict all future output. Reporting in 2013 pointed further to the possibility that the constants had indeed been deliberately arranged. NIST promptly advised against its use and removed it in the SP 800-90A revision (formally published 2015). This incident was not about a bug: a constant whose provenance cannot be explained is itself a risk.

ROCA (2017): structured primes. A research team at Masaryk University (Nemec et al.), presenting at ACM CCS 2017, disclosed that RSA primes generated by Infineon’s RSALib carried a special mathematical structure — the primes satisfied congruences of a particular form — which made private keys practically factorable with a Coppersmith-type attack, at costs ranging from hours to months depending on key size. The affected parts were security chips everywhere: large numbers of TPMs, smartcards and electronic ID cards; Estonia suspended the certificates of roughly 750,000 eID cards. This was not entropy shortage but a key-generation algorithm whose speed optimisation introduced structure that cryptanalysis could exploit.

A fourth body of evidence: measurement at internet scale

The three incidents above were single points of failure, but the 2012 study Mining Your Ps and Qs by Heninger and colleagues showed the problem can be ecological. After scanning the internet’s TLS and SSH public keys, the team found that a substantial fraction of RSA keys shared a prime factor with another key — computing the greatest common divisor of two public keys factored both at once — and that many more keys were predictable through insufficient entropy. The root cause was remarkably uniform: headless embedded devices (routers, firewalls and the like) generated their long-term keys at first boot, before the entropy pool had accumulated, in boot environments so homogeneous that “randomness” converged to the same set of values across thousands of devices. The study’s significance is that it reframed the randomness problem from “one vendor’s mistake” to “a systemic risk of a deployment pattern”: whenever keys are generated in a low-entropy moment and the generation environment is reproducible, the accident happens in bulk with no individual negligence required. This is why current practice insists on deferring key generation until entropy is ready, and on explicitly verifying entropy state in device manufacturing flows.

The shared pattern: silent, concentrated, long-lived

The three incidents differ in mechanism but share three traits. First, silence: a bad key’s format, length and self-test results are identical to a good key’s; there are no runtime symptoms, and discovery comes only through later cryptanalysis. Second, concentration: randomness is the single point at which all security is decided, in the instant of key generation; afterwards, the strongest algorithms and protocols merely protect a secret that was already doomed. Third, longevity: affected keys tend to be embedded in smartcards, TPMs and device firmware, with rotation cycles measured in years, so the exposure window dwarfs that of an ordinary software vulnerability.

Concrete lessons for post-quantum implementations

Migrating to PQC does not route around this fault line — ML-KEM key generation and encapsulation, and ML-DSA signing, all depend on randomness, and lattice-based sampling is more sensitive to the quality and distribution of that randomness. The defences have partly been written into standards and practice:

  • Hedged constructions: FIPS 204’s ML-DSA signing uses hedged mode by default, in which the masking randomness is derived from the private key and the message digest, mixed with external randomness, so that a single failure of the random number generator does not directly leak the private key — a design choice made after the lessons of Dual_EC and deterministic-signature failures;
  • Entropy sources need separate validation: algorithm correctness testing (ACVP) proves an implementation “computes correctly”; it cannot test whether it “randomises well”. Entropy-source health testing and validation run on a separate track: SP 800-90B entropy-source assessment and the entropy requirements inside FIPS 140-3 module validation. Put “which entropy source, and has it passed a 90B assessment?” on the procurement questionnaire;
  • Auditable provenance for constants: maintain institutional suspicion toward any parameter in a standard or implementation whose origin cannot be explained, and prefer designs whose generation process is public and reproducible (such as expansion from a public seed);
  • Key generation belongs in the inventory: a CBOM should record not only “which algorithm” but where keys are generated and with which library version — the reason ROCA’s cleanup was so hard is that most organisations could not answer that question.

Randomness appears in no algorithm comparison table, but it decides whether anything in those tables counts.

A self-audit: five questions you can answer today

The lessons of the three incidents compress into a checklist any organisation can work through against its own estate. First: where are long-lived keys for critical systems generated, and with which library, which version? Any system you cannot answer for should be assumed to carry ROCA-grade cleanup difficulty. Second: did embedded and network devices ever generate keys inside the low-entropy window of first boot, and did older devices ship before entropy-readiness mechanisms existed? Third: are there constants or parameters anywhere whose provenance cannot be explained — including curves and seeds copied from a paper into a home-grown protocol? Fourth: has the entropy source been independently evaluated, and does the virtualised estate risk RNG state replay through snapshot cloning? Fifth: has the key-rotation procedure ever actually been rehearsed — in real incident cleanup, the first blocker is usually not technical but that nobody knows who a given batch of keys was issued to.

None of these questions needs new tooling, and the answers are themselves a risk register: every “we don’t know” corresponds to a failure mode that has already materialised in a public incident.

References

  1. Debian Security Advisory DSA-1571-1, openssl — predictable random number generator, 2008. https://www.debian.org/security/2008/dsa-1571
  2. Nemec, M. et al., The Return of Coppersmith’s Attack: Practical Factorization of Widely Used RSA Moduli, ACM CCS 2017. https://dl.acm.org/doi/10.1145/3133956.3133969
  3. NIST, SP 800-90A Rev. 1: Recommendation for Random Number Generation Using Deterministic Random Bit Generators (Dual_EC removed), 2015. https://csrc.nist.gov/pubs/sp/800/90/a/r1/final
  4. NIST, FIPS 204: Module-Lattice-Based Digital Signature Standard (hedged signing in ML-DSA), 2024. https://csrc.nist.gov/pubs/fips/204/final
  5. Heninger, N. et al., Mining Your Ps and Qs: Detection of Widespread Weak Keys in Network Devices, USENIX Security Symposium 2012. https://www.usenix.org/conference/usenixsecurity12/technical-sessions/presentation/heninger

Tags: randomnessDebian OpenSSLDual_ECROCAkey generation