Partial-Tag Encrypt-then-MAC Counterexample #
This module formalizes the ciphertext-integrity failure of partial-tag Encrypt-then-MAC
([BS23], Section 9.4.1.1, printed pp. 368–369): given a symmetric cipher producing
2 * n-bit ciphertexts r ++ c (an n-bit IV r and n-bit body c), the scheme signs and
verifies only the second half c while leaving r unauthenticated.
We construct partialTagMAC M hmsgLen (wrapping any MACScheme M with ∀ n, M.msgLen n = n
into a 2 * n-bit MACScheme that authenticates only the second half msg.drop (msg.length / 2))
and define prfCipherPartialTag directly via encryptThenMAC (prfCipher ...) (partialTagMAC ...).
The explicit 1-query IsOraclePPT adversary partialTagCIAdversary ctBound queries 0^n,
truncates the reply to ctBound n, and flips the first IV bit via Cslib.Crypto.flipHeadBit,
winning ciOneTimeGame with probability 1 for every n ≥ 1 and unconditionally refuting
OneTimeCiphertextIntegrity, CiphertextIntegrity, and AuthenticatedEncryption, while
indcpa_encryptThenMAC immediately preserves INDCPA under any PseudorandomFunction.
Scope and deviations #
Boneh–Shoup Section 9.4.1.1 (printed pp. 368–369) illustrates partial-tag Encrypt-then-MAC over
randomized CBC mode, where changing (r, c, t) to (r ⊕ Δ, c, t) both breaks ciphertext integrity
and deterministically shifts the first decrypted plaintext block (m'[0] = m[0] ⊕ Δ). Here
prfCipherPartialTag replaces randomized CBC with prfCipher (r ++ (F(k, r) ⊕ m)): flipping r
evaluates the PRF on a fresh nonce rather than XORing into m, so only the ciphertext-integrity
failure and preserved INDCPA are formalized here; the CBC plaintext-shift effect needs a CBC
SymmetricCipher, and chosen-ciphertext security (INDCCA) of prfCipherPartialTag is neither
proved nor refuted here.
Main definitions #
Cslib.Crypto.partialTagMAC: lifts anyn-bitMACSchemeto2 * n-bit messages by signing and verifying onlymsg.drop (msg.length / 2).Cslib.Crypto.prfCipherPartialTag:encryptThenMACoverprfCipherandpartialTagMAC.Cslib.Crypto.partialTagCIAdversary: explicit 1-query IV-bit-flip ciphertext-integrity adversary.
Main results #
Cslib.Crypto.isOraclePPT_partialTagCIAdversary,Cslib.Crypto.isQueryBounded_partialTagCIAdversary: strict oracle-PPT admissibility and 1-query bound forpartialTagCIAdversary.Cslib.Crypto.eval_ciOneTimeGame_prfCipherPartialTag_partialTagCIAdversary:partialTagCIAdversarywinsciOneTimeGamewith probability1for everyn ≥ 1whenctBoundbounds ciphertext lengths.Cslib.Crypto.not_oneTimeCiphertextIntegrity_prfCipherPartialTag,Cslib.Crypto.not_ciphertextIntegrity_prfCipherPartialTag,Cslib.Crypto.not_authenticatedEncryption_prfCipherPartialTag: unconditional ciphertext-integrity and authenticated-encryption failures for everyMACSchemeonn-bit messages.Cslib.Crypto.PseudorandomFunction.indcpa_prfCipherPartialTag,Cslib.Crypto.PseudorandomFunction.prfCipherPartialTag_counterexample: preservedINDCPAviaindcpa_encryptThenMACalongside failedOneTimeCiphertextIntegrity.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 9.4.1.1 (printed pp. 368–369).
Lifts any MACScheme M on n-bit messages (∀ n, M.msgLen n = n) to a MACScheme on
2 * n-bit messages that signs and verifies only the second half msg.drop (msg.length / 2),
leaving the n-bit prefix unauthenticated.
Partial-tag Encrypt-then-MAC over prfCipher ([BS23], Section 9.4.1.1, printed
pp. 368–369): instantiates encryptThenMAC with prfCipher family hpoly hlen (2 * n-bit
ciphertexts r ++ c) and partialTagMAC M hmsgLen, signing only the n-bit body c and leaving
the n-bit IV r unauthenticated.
Note: this covers the partial-tag construction over prfCipher rather than randomized CBC mode,
so the CBC plaintext-shift effect m'[0] = m[0] ⊕ Δ is not covered, and INDCCA security of
this scheme is neither proved nor refuted here.
1-Query IV-Bit-Flip Attack and Ciphertext-Integrity Break #
Explicit 1-query ciphertext-integrity adversary against prfCipherPartialTag
([BS23], Section 9.4.1.1, printed pp. 368–369): queries 0^n, cuts the reply to
ctBound n bits, splits (cFull, tag), and outputs
encPair encBits encBits (flipHeadBit cFull, tag), flipping the first IV bit while leaving the
body and MAC tag unchanged.
partialTagCIAdversary is uniformly strict oracle-PPT (IsOraclePPT) when ctBound is
computable in plain polynomial time.
partialTagCIAdversary makes at most 1 encryption query.
partialTagCIAdversary wins ciOneTimeGame against prfCipherPartialTag with probability
1 at every security parameter n ≥ 1 where ctBound n bounds ciphertext lengths.
prfCipherPartialTag unconditionally fails OneTimeCiphertextIntegrity for every MACScheme
on n-bit messages.
prfCipherPartialTag unconditionally fails CiphertextIntegrity for every MACScheme on
n-bit messages.
prfCipherPartialTag unconditionally fails AuthenticatedEncryption for every MACScheme
on n-bit messages.
IND-CPA Preservation and Combined Counterexample #
For any secure PseudorandomFunction family, prfCipherPartialTag satisfies INDCPA by
indcpa_encryptThenMAC and hprf.indcpa_prfCipher.
End-to-end partial-tag Encrypt-then-MAC counterexample ([BS23], Section 9.4.1.1,
printed pp. 368–369): for any secure PseudorandomFunction family and any MACScheme M on
n-bit messages, prfCipherPartialTag remains INDCPA yet unconditionally fails
OneTimeCiphertextIntegrity.