The one-block PRF cipher is not CCA-secure #
Boneh and Shoup open Section 9.2.1 ([BS23], printed pp. 360–361) with an attack on
randomized counter mode: from an encryption c of u ‖ m an attacker builds ĉ, "the same as
c except that ĉ[1] := c[1] ⊕ u ⊕ v", which decrypts to v ‖ m, so that "by querying for the
decryption of ĉ, Mel was able to deduce the decryption of c". They conclude: "We proved that
both encryption modes are CPA secure, and yet we just showed how to break them."
This file proves that conclusion in the chosen-ciphertext game for the one-block cipher
prfCipher, which PseudorandomFunction.indcpa_prfCipher proves CPA-secure for a pseudorandom
family. prfCipher encrypts
as the stream envelope ivStreamEncrypt with one block, so ivStreamXorBody turns an encryption
of msg into one of msg ⊕ delta (ivStreamXorBody_mem_support_ivStreamEncrypt). The adversary
prfCipherCCAAdversary asks for the challenge encryption of 0ⁿ or 1ⁿ, flips every bit after
the initial value and asks the decryption oracle for the result, which is a different ciphertext
when 1 ≤ n; it decrypts to the other message, and the adversary wins with probability 1
(eval_ccaOneTimeGame_prfCipher).
Differences from the book: the attack is carried out in a game only against the one-block cipher
prfCipher, since the library has no chosen-ciphertext game for multi-block modes; for counter
mode and output feedback mode ivStreamDecrypt_ivStreamXorBody says what the modified ciphertext
decrypts to. The randomized CBC half of Section 9.2.1 is not covered. The attack needs 1 ≤ n:
at n = 0 the modified ciphertext is the challenge itself, which the oracle refuses to decrypt.
Main definitions #
Cslib.Crypto.prfCipherCCAAdversary: the two-query chosen-ciphertext adversary.
Main results #
Cslib.Crypto.isOraclePPT_prfCipherCCAAdversary: the adversary is efficient.Cslib.Crypto.eval_ccaOneTimeGame_prfCipher: it guesses the challenge bit with probability1for every1 ≤ n.Cslib.Crypto.not_oneTimeINDCCA_prfCipher,Cslib.Crypto.not_indcca_prfCipher:prfCipheris neither one-time nor many-time CCA-secure, for every family.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 9.2.1 (printed pp. 360–361).
Two-query chosen-ciphertext adversary against prfCipher ([BS23], Section 9.2.1):
ask for the challenge encryption of (0ⁿ, 1ⁿ), XOR 1ⁿ into the ciphertext after its n-bit
initial value, ask the decryption oracle for the result, and output true iff it decrypts
to 0ⁿ.
prfCipherCCAAdversary is an efficient oracle adversary.
prfCipherCCAAdversary guesses the challenge bit of the one-time chosen-ciphertext game
against prfCipher with probability 1, for every family and every 1 ≤ n
([BS23], Section 9.2.1).
The one-block PRF cipher prfCipher is not one-time CCA-secure, for any family
([BS23], Section 9.2.1), although it is CPA-secure for a pseudorandom family
(PseudorandomFunction.indcpa_prfCipher).
The one-block PRF cipher prfCipher is not CCA-secure, for any family ([BS23],
Section 9.2.1).