Semantic security
In cryptography, a semantically secure cryptosystem is one where only negligible information about the plaintext can be feasibly extracted from the ciphertext. Specifically, any probabilistic, polynomial-time algorithm (PPTA) that is given the ciphertext of a certain message (taken from any distribution of messages), and the message's length, cannot determine any partial information on the message with probability non-negligibly higher than all other PPTA's that only have access to the message length (and not the ciphertext).[1] This concept is the computational complexity analogue to Shannon's concept of perfect secrecy. Perfect secrecy means that the ciphertext reveals no information at all about the plaintext, whereas semantic security implies that any information revealed cannot be feasibly extracted.[2][3]: 378–381
History
[edit]The notion of semantic security was first put forward by Goldwasser and Micali in 1982.[1][4] However, the definition they initially proposed offered no straightforward means to prove the security of practical cryptosystems. Goldwasser/Micali subsequently demonstrated that semantic security is equivalent to another definition of security called ciphertext indistinguishability under chosen-plaintext attack.[5] This latter definition is more common than the original definition of semantic security because it better facilitates proving the security of practical cryptosystems.
Symmetric-key cryptography
[edit]In the case of symmetric-key algorithm cryptosystems, an adversary must not be able to compute any information about a plaintext from its ciphertext. This may be posited as an adversary, given two plaintexts of equal length and their two respective ciphertexts, cannot determine which ciphertext belongs to which plaintext.
Public-key cryptography
[edit]This section needs additional citations for verification. (September 2012) |
For an asymmetric key encryption algorithm cryptosystem to be semantically secure, it must be infeasible for a computationally bounded adversary to derive significant information about a message (plaintext) when given only its ciphertext and the corresponding public encryption key. Semantic security considers only the case of a "passive" attacker, i.e., one who generates and observes ciphertexts using the public key and plaintexts of their choice. Unlike other security definitions, semantic security does not consider the case of chosen ciphertext attack (CCA), where an attacker is able to request the decryption of chosen ciphertexts, and many semantically secure encryption schemes are demonstrably insecure against chosen ciphertext attack. Consequently, semantic security is now considered an insufficient condition for securing a general-purpose encryption scheme.
Indistinguishability under Chosen Plaintext Attack (IND-CPA) is commonly defined by the following experiment:[6]
- A random pair is generated by running .
- A probabilistic polynomial time-bounded adversary is given the public key , which it may use to generate any number of ciphertexts (within polynomial bounds).
- The adversary generates two equal-length messages and , and transmits them to a challenge oracle along with the public key.
- The challenge oracle selects one of the messages by flipping a fair coin (selecting a random bit ), encrypts the message under the public key, and returns the resulting challenging ciphertext to the adversary.
The underlying cryptosystem is IND-CPA (and thus semantically secure under chosen plaintext attack) if the adversary cannot determine which of the two messages was chosen by the oracle, with probability significantly greater than (the success rate of random guessing). Variants of this definition define indistinguishability under chosen ciphertext attack and adaptive chosen ciphertext attack (IND-CCA, IND-CCA2).
Because the adversary possesses the public encryption key in the above game, a semantically secure encryption scheme must by definition be probabilistic, possessing a component of randomness; if this were not the case, the adversary could simply compute the deterministic encryption of and and compare these encryptions with the returned ciphertext to successfully guess the oracle's choice.
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.[7]
If encryption relies on predictable or weak randomness, it becomes easier to break.[8] 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.[9]
Why Randomness Is Important
[edit]Strong randomness is critical in:
- Key generation – Ensures cryptographic keys are unpredictable.[10]
- Nonce Selection – Reusing a nonce in AES-GCM or ElGamal can break security.[11]
- Probabilistic encryption – Some schemes, like Goldwasser–Micali, rely on randomness to ensure ciphertexts are indistinguishable.[11]
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.[12]
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.[13]
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.[14]
How to Ensure Strong Randomness
[edit]To prevent such failures, cryptographic systems must generate unpredictable and high-quality random values.[15]
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)[15]
Entropy Collection
[edit]Secure randomness requires high entropy sources, such as:
- Hardware-based generators (e.g., Intel RDRAND)[16]
- Physical sources, like keystroke timing[16]
- Dedicated security hardware, including HSMs and TPMs[16]
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.[17]
- Unique nonces in AES-GCM and ElGamal ensure encrypting the same message multiple times produces different ciphertexts.[17]
Testing and Auditing Randomness
[edit]To verify randomness quality, cryptographic implementations should undergo:
- NIST SP 800-90B randomness tests[16]
- Diehard tests[18]
- FIPS 140-2 compliance checks[19]
Semantically secure encryption algorithms include Goldwasser-Micali, ElGamal and Paillier. These schemes are considered provably secure, as their semantic security can be reduced to solving some hard mathematical problem (e.g., Decisional Diffie-Hellman or the Quadratic Residuosity Problem). Other, semantically insecure algorithms such as RSA, can be made semantically secure (under stronger assumptions) through the use of random encryption padding schemes such as Optimal Asymmetric Encryption Padding (OAEP).
References
[edit]- ^ a b S. Goldwasser and S. Micali, Probabilistic encryption & how to play mental poker keeping secret all partial information, Annual ACM Symposium on Theory of Computing, 1982.
- ^ Shannon, Claude (1949). "Communication Theory of Secrecy Systems". Bell System Technical Journal. 28 (4): 656–715. doi:10.1002/j.1538-7305.1949.tb00928.x. hdl:10338.dmlcz/119717.
- ^ Goldreich, Oded. Foundations of Cryptography: Volume 2, Basic Applications. Vol. 2. Cambridge university press, 2004.
- ^ Goldwasser, Shafi; Micali, Silvio (1984-04-01). "Probabilistic encryption". Journal of Computer and System Sciences. 28 (2): 270–299. doi:10.1016/0022-0000(84)90070-9. ISSN 0022-0000.
- ^ S. Goldwasser and S. Micali, Probabilistic encryption. Journal of Computer and System Sciences, 28:270-299, 1984.
- ^ Katz, Jonathan; Lindell, Yehuda (2007). Introduction to Modern Cryptography: Principles and Protocols. Chapman and Hall/CRC. ISBN 978-1584885511.
- ^ Menezes, Alfred; Van Oorschot, Paul C.; Vanstone, Scott (1996). Handbook of Applied Cryptography. CRC Press.
- ^ Menezes, Alfred; Van Oorschot, Paul C.; Vanstone, Scott (1996). Handbook of Applied Cryptography. CRC Press.
- ^ Katz, Jonathan; Lindell, Yehuda (2007). Introduction to Modern Cryptography: Principles and Protocols. Chapman and Hall/CRC. ISBN 978-1584885511.
- ^ Katz, Jonathan; Lindell, Yehuda (2007). Introduction to Modern Cryptography: Principles and Protocols. Chapman and Hall/CRC. ISBN 978-1584885511.
- ^ a b 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.