User:Smokethecookie/sandbox
The Role of Randomness in Semantic Security
[edit]Randomness plays a key role in cryptography by preventing attackers from detecting patterns in ciphertexts. In a semantically secure cryptosystem, encrypting the same plaintext multiple times should produce different ciphertexts.[1]
If encryption relies on predictable or weak randomness, it becomes easier to break.[1] Poor randomness can lead to patterns that attackers can analyze, potentially allowing them to recover secret keys or decrypt messages. Because of this, cryptographic systems must use strong and unpredictable random values to maintain security.[2]
Why Randomness is Important
[edit]Strong randomness is critical in:
- Key generation – Ensures cryptographic keys are unpredictable.[2]
- Nonce Selection – Reusing a nonce in AES-GCM or ElGamal can break security.[2]
- Probabilistic encryption – Some schemes, like Goldwasser–Micali, rely on randomness to ensure ciphertexts are indistinguishable.[2]
Failures of Randomness in the Past
[edit]Several cryptographic failures have resulted from weak randomness, allowing attackers to break encryption.
Debian OpenSSL Vulnerability (2008)
[edit]An error in Debian’s OpenSSL removed entropy collection, producing a small set of predictable keys. Attackers could guess SSH and TLS keys, allowing unauthorized access.[3]
Sony PlayStation 3 ECDSA Failure (2011)
[edit]Sony’s PlayStation 3 misused the Elliptic Curve Digital Signature Algorithm (ECDSA) by reusing the same nonce - a random number used once in cryptographic signing - in multiple signatures. Since ECDSA relies on unique nonces for security, attackers recovered Sony’s private signing key, allowing them to sign unauthorized software.[4]
ROCA Vulnerability (2017)
[edit]A flaw in Infineon's RSA key generation created weak keys that attackers could efficiently factor. This vulnerability affected smart cards and Trusted Platform Modules (TPMs), requiring widespread key replacements.[5]
How to Ensure Strong Randomness
[edit]To prevent such failures, cryptographic systems must generate unpredictable and high-quality random values.[6]
Use of Cryptographically Secure Pseudorandom Number Generators (CSPRNGs)
[edit]CSPRNGs provide secure random numbers resistant to attacks. Common examples include:
- /dev/random and /dev/urandom (Unix)
- Windows CryptGenRandom
- NIST-approved DRBGs (Deterministic Random Bit Generators)[6]
Entropy Collection
[edit]Secure randomness requires high entropy sources, such as:
- Hardware-based generators (e.g., Intel RDRAND)[7]
- Physical sources, like keystroke timing[7]
- Dedicated security hardware, including HSMs and TPMs[7]
Avoiding Deterministic Encryption Without Randomness
[edit]Some encryption schemes require added randomness to maintain security:
- RSA with OAEP padding introduces randomness to prevent deterministic encryption.[8]
- Unique nonces in AES-GCM and ElGamal ensure encrypting the same message multiple times produces different ciphertexts.[8]
Testing and Auditing Randomness
[edit]To verify randomness quality, cryptographic implementations should undergo:
- NIST SP 800-90B randomness tests[7]
- Diehard tests[9]
- FIPS 140-2 compliance checks[10]
References
[edit]- ^ a b Menezes, Alfred; Van Oorschot, Paul C.; Vanstone, Scott (1996). Handbook of Applied Cryptography. CRC Press.
- ^ a b c d Katz, Jonathan; Lindell, Yehuda (2007). Introduction to Modern Cryptography: Principles and Protocols. Chapman and Hall/CRC. ISBN 978-1584885511.
- ^ Bello, Luciano (2008-05-13). "Debian OpenSSL Predictable Random Number Generator". Debian Security Advisory.
- ^ Schneier, Bruce (2011-01-06). "Sony PS3 Security Broken". Schneier on Security.
- ^ "ROCA: Infineon TPM and Secure Element RSA Vulnerability Guidance". National Cyber Security Centre. 2017-10-17.
- ^ a b "Recommendation for Random Number Generation Using Deterministic Random Bit Generators". National Institute of Standards and Technology (NIST). 2012-06-11.
- ^ a b c d "Recommendation for the Entropy Sources Used for Random Bit Generation". National Institute of Standards and Technology (NIST). 2018-01-10.
- ^ a b "Recommendation for Pair-Wise Key Establishment Using Integer Factorization Cryptography". National Institute of Standards and Technology (NIST). 2019-05-23.
- ^ "A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications". National Institute of Standards and Technology (NIST). 2010-04-01.
- ^ "Security Requirements for Cryptographic Modules". National Institute of Standards and Technology (NIST). 2002-05-25.