Equal Ciphertext Laws and Semantic Security of One-Time Pads #
This module derives one-time semantic security (Cipher.oneTimeExperiment advantage 0) for
ciphers whose key-averaged ciphertext distribution is invariant across admissible message pairs
([BS23], Example 2.9, p. 17; Exercise 2.7, p. 39), without restricting to deterministic
ciphers.
Connecting an information-theoretic EncScheme to a computational Cipher and key sampler via
distribution equality yields zero semantic-security advantage for every cipher matching an
EncScheme.PerfectlySecret scheme (and clients holding EncScheme.CiphertextIndist directly apply
advantage_oneTimeExperiment_eq_zero_of_ciphertextDist_eq with ciphertextDist_eq_encScheme).
Instantiations cover both the fixed-length one-time pad over BitVec l and the variable-length
one-time pad variableLengthOTPCipher L on equal-length messages.
For the bit-guessing identity SSadv[A, E] = 2 * SSadv*[A, E] ([BS23], Theorem 2.10,
p. 26) applied to E.oneTimeExperiment sampleKey valid A, apply
Experiment.advantage_eq_two_mul_guessingAdvantage_guessBit from
CslibFrontier.Crypto.Game.HiddenBit directly.
Main definitions #
Cslib.Crypto.Cipher.ciphertextDist: key-averaged ciphertext law of aCipherunder a key samplersampleKeyCslib.Crypto.Cipher.ofPure: deterministicCipherfrom pure encryption and decryption mapsCslib.Crypto.Cipher.otpCipher: fixed-length one-time pad overBitVec las aCipherCslib.Crypto.Cipher.variableLengthOTPCipher: variable-length one-time pad on boolean lists of length at mostLas aCipher
Main results #
Cslib.Crypto.Cipher.eval_oneTimeExperiment_eq_of_ciphertextDist_eq: equal ciphertext laws on admissible message pairs induce identical experiment distributions for both challenge bits against every adversaryCslib.Crypto.Cipher.advantage_oneTimeExperiment_eq_zero_of_ciphertextDist_eq: equal ciphertext laws on admissible pairs give semantic-security advantage0against every adversaryCslib.Crypto.Cipher.advantage_oneTimeExperiment_eq_zero_of_perfectlySecret: any cipher matching aPerfectlySecretscheme has semantic-security advantage0against every adversaryCslib.Crypto.Cipher.advantage_oneTimeExperiment_otpCipher: semantic-security advantage0forotpCipher lwith a uniform keyCslib.Crypto.Cipher.advantage_oneTimeExperiment_variableLengthOTPCipher: semantic-security advantage0forvariableLengthOTPCipher Lon equal-length messages
References #
Build a symmetric cipher from deterministic pure encryption and decryption functions.
A deterministic cipher ofPure enc dec is correct when dec k is a left inverse of
enc k for every key k.
Key-averaged ciphertext distribution of a deterministic cipher ofPure enc dec.
Equal ciphertext laws hide the challenge bit: if the key-averaged ciphertext law of m₀
equals that of m₁ for every admissible pair (m₀, m₁), then oneTimeExperiment has the same
output distribution for both challenge bits against every adversary.
Equal ciphertext laws give zero semantic-security advantage ([BS23], Example 2.9, p. 17; Exercise 2.7, p. 39).
A cipher whose key sampler and encryption laws match an information-theoretic EncScheme
has the same ciphertext distribution as that scheme.
Ciphers matching a perfectly secret EncScheme have zero semantic-security advantage:
any Cipher matching an EncScheme.PerfectlySecret scheme through hgen and henc has
advantage 0 in oneTimeExperiment against every adversary ([BS23], Example 2.9,
p. 17).
The one-time pad has zero semantic-security advantage under a uniform key against every adversary ([BS23], Example 2.9, p. 17).
Correctness of the variable-length one-time pad cipher variableLengthOTPCipher L.
The variable-length one-time pad has zero semantic-security advantage on equal-length messages under a uniform key against every adversary ([BS23], Example 2.9, p. 17; Exercise 2.7, p. 39).