Documentation

CslibFrontier.Crypto.Computational.Encryption.RepeatingCiphertexts

Repeating Ciphertexts under Chosen-Plaintext Attack #

This module formalizes Exercise 5.12 of Boneh and Shoup, A Graduate Course in Applied Cryptography, Version 0.6 (Chapter 5, printed p. 211; Example 5.1's deterministic-cipher refutation not_indcpa_of_deterministic lives in CslibFrontier/Crypto/Computational/Encryption/Authenticated.lean):

Model and scope notes relative to Boneh–Shoup #

Main definitions #

Main results #

References #

The repeated-ciphertext attack experiment ([BS23], Exercise 5.12, printed p. 211): sample k ← E.keyGen n, run A n [] against E.ciEncryptionOracle n k starting from [] (which encrypts each n-bit query under k, logs the returned ciphertexts, and answers malformed queries with [] without logging), and output true iff two logged ciphertexts are equal (!decide out.2.Nodup).

Elementary CPA wrapper around a repeated-ciphertext adversary A ([BS23], Exercise 5.12, printed p. 211): run A n [] against repeatWrapperStep n (ctBound n) starting from [], and output true iff two recorded (ciphertext, randomMsg) pairs share the same truncated ciphertext while having distinct right-hand random messages.

repeatToCPAAdversary ctBound A is uniformly strict oracle-PPT whenever ctBound is computable in unary polynomial time and A is uniformly strict oracle-PPT.

Quantitative repeated-ciphertext reduction ([BS23], Exercise 5.12, printed p. 211): for every 1 ≤ n (|M| = 2^n ≥ 2) where ctBound n bounds ciphertext lengths on n-bit messages, RepeatAdv[A, E](n) ≤ 2 · CPAadv[repeatToCPAAdversary ctBound A, E](n).

CPA-secure symmetric ciphers have negligible ciphertext-collision probability ([BS23], Exercise 5.12, printed p. 211): if E satisfies INDCPA, then every uniform strict IsOraclePPT adversary wins repeatCiphertextGame with negligible probability.