Ciphertext-mauling attacks on symmetric ciphers #
A symmetric cipher fails ciphertext integrity as soon as an adversary can transform (maul) an honest ciphertext into a different word that still decrypts ([BS23], Section 9.1). It fails chosen-ciphertext security when, in addition, what the mauled word decrypts to reveals which message was encrypted ([BS23], Section 9.2.1). A mauled word that decrypts to the same plaintext in both worlds breaks ciphertext integrity but not CCA security. This module packages the two attacks that the cipher counterexamples of the library share. Each result here is an attack theorem: it concludes that a cipher is not secure.
maulCIAdversary maul bit ctBound asks for an encryption of bit^n, reads the first ctBound n
bits of the reply and outputs maul n of them. If, on every honest key and ciphertext, the mauled
word differs from the ciphertext and decrypts, it wins the ciphertext-integrity games with
probability 1.
maulCCAAdversary maul target ctBound asks for the challenge encryption of (0^n, 1^n), asks the
decryption oracle on maul n of the (truncated) ciphertext, and outputs whether the first n + 1
bits of the oracle's reply equal encOption encBits (some target^n), which is n + 1 bits long.
The CCA hypothesis is world-dependent: in world bit the mauled word must differ from the
challenge and decrypt to (cond target bit !bit)^n, the challenge message itself when
target = true and its complement when target = false. The adversary then outputs bit for
n ≥ 1. A variant allows any other outcome on a bad event of negligible probability in each
world.
Main definitions #
Cslib.Crypto.SymmetricCipher.maulCIAdversary: the one-query mauling forger.Cslib.Crypto.SymmetricCipher.maulCCAAdversary: the two-query mauling distinguisher.
Main results #
Cslib.Crypto.SymmetricCipher.isOraclePPT_maulCIAdversary,Cslib.Crypto.SymmetricCipher.isOraclePPT_maulCCAAdversary: both adversaries are oracle PPT when the maul and the reply bound are polynomial-time.Cslib.Crypto.SymmetricCipher.eval_ciOneTimeGame_maulCIAdversary,Cslib.Crypto.SymmetricCipher.eval_ciGame_maulCIAdversary: the forger wins with probability1.Cslib.Crypto.SymmetricCipher.not_oneTimeCiphertextIntegrity_of_maul: a polynomial-time maul that works from some parameter on breaks one-time ciphertext integrity.Cslib.Crypto.SymmetricCipher.eval_ccaOneTimeGame_maulCCAAdversary,Cslib.Crypto.SymmetricCipher.eval_ccaOneTimeGame_maulCCAAdversary_eq_pure: when the mauled word decrypts to a fixed message, the distinguisher outputs the result of the Boolean test of that message againsttarget^n, which may fail; when it decrypts to(cond target bit !bit)^n, it outputsbit.Cslib.Crypto.SymmetricCipher.not_oneTimeINDCCA_of_maul,Cslib.Crypto.SymmetricCipher.not_oneTimeINDCCA_of_maul_or_bad: a polynomial-time maul with the world-dependent decryption above from some parameter on, exactly or outside a negligible bad event, breaks one-time CCA security.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Sections 9.1 and 9.2.1.
The mauling forger #
The mauling forger is oracle PPT when the maul and the reply bound are polynomial-time.
The mauling forger wins ciOneTimeGame with probability 1 at a parameter n where
ctBound n bounds the ciphertext lengths and, on every honest key and ciphertext of bit^n, the
mauled word differs from the ciphertext and decrypts.
The mauling forger wins ciGame with probability 1 under the conditions of
eval_ciOneTimeGame_maulCIAdversary.
A polynomial-time ciphertext maul breaks one-time ciphertext integrity. If, for every
n ≥ n₀, on every honest key and ciphertext of bit^n, maul n changes the ciphertext into a
word that decrypts, then E is not OneTimeCiphertextIntegrity.
The mauling distinguisher #
Two-query ciphertext-mauling distinguisher: it asks for the challenge encryption of
(0^n, 1^n), reads the first ctBound n bits of the reply, asks the decryption oracle on
maul n of them, and outputs whether the first n + 1 bits of the reply encode target^n.
The mauling distinguisher is oracle PPT when the maul and the reply bound are polynomial-time.
The mauling distinguisher's output in world bit at a parameter n where ctBound n bounds
the ciphertext lengths and, on every honest key and ciphertext of bit^n, the mauled word differs
from the ciphertext and decrypts to msg: it is the test of the first n + 1 bits of the
encoding of msg against target^n.
The mauling distinguisher outputs the challenge bit with probability 1 in world bit, for
bit = true or n ≥ 1, when on every honest key and ciphertext of bit^n the mauled word differs
from the ciphertext and decrypts to (cond target bit !bit)^n.
A polynomial-time ciphertext maul breaks one-time CCA security, up to a bad event. If, for
every n ≥ n₀ and world bit, on every honest key k and ciphertext ct of bit^n, maul n
changes ct into a word that decrypts to (cond target bit !bit)^n unless bad n bit k ct
holds, and the bad event has negligible probability in each world, then E is not
OneTimeINDCCA.
A polynomial-time ciphertext maul breaks one-time CCA security. If, for every n ≥ n₀ and
world bit, on every honest key and ciphertext of bit^n, maul n changes the ciphertext into a
word that decrypts to (cond target bit !bit)^n, then E is not OneTimeINDCCA.