Generic Composition Counterexamples for Authenticated Encryption #
This module formalizes the generic composition separations and counterexamples of
Katz and Lindell, Introduction to Modern Cryptography, 3rd ed., Chapter 5.
They are stated in terms of fresh-message encryption unforgeability (SymmetricCipher.EncForge),
which is defined, with its positive results, in
CslibFrontier/Crypto/Computational/Encryption/EncForge.lean.
- Separation of
INDCPA ∧ EncForgefromINDCCAandCiphertextIntegrity(SymmetricCipher.tailFallback,INDCPA.tailFallback,EncForge.tailFallback,not_ciphertextIntegrity_tailFallback,not_indcca_tailFallback) ([KL20], Exercise 5.10, printed p. 165): for anyE : SymmetricCipher,E.tailFallbackkeepskeyGenandencryptunchanged and modifiesdecrypt n k ctto fall back toE.decrypt n k ct.tailwheneverE.decrypt n k ct = noneand!ct.isEmpty. This preservesINDCPA,OneTimeINDCPA, andEncForge, while unconditionally breakingOneTimeCiphertextIntegrityandCiphertextIntegrity(by prependingfalseto a queried ciphertext) and breakingOneTimeINDCCAandINDCCAwheneverE.EncForgeholds. - Encrypt-then-MAC under a non-strong MAC (
MACScheme.redundantTag,EUFCMA.redundantTag,not_sufCma_redundantTag,not_indcca_encryptThenMAC_redundantTag,encryptThenMAC_redundantTag_counterexample) ([KL20], Exercise 5.4, printed p. 164): for anyM : MACScheme,M.redundantTagkeepskeyGen,msgLen, andsignunchanged while accepting eitherM.verify sk msg tagor!tag.isEmpty && M.verify sk msg tag.tail. This preservesEUFCMAandOneTimeEUFCMAwhile breakingOneTimeSUFCMAandSUFCMA; when combined with any cipherEviaencryptThenMAC E M.redundantTag hctLen, the resulting cipher satisfiesINDCPAandEncForge(underE.INDCPAandM.EUFCMA) yet failsOneTimeCiphertextIntegrityandCiphertextIntegritywith adversary advantage1, andOneTimeINDCCAandINDCCAwith advantage1for everyn ≥ 1.
Main definitions #
Cslib.Crypto.SymmetricCipher.tailFallback,tailCIAdversary,prependFalseBitCIAdversary,tailFallbackCCAAdversary: Exercise 5.10 ciphertext-tail fallback transformation and reductions / attackers ([KL20], Exercise 5.10).Cslib.Crypto.MACScheme.redundantTag,tailTagForger,redundantTagForger,etmRedundantCIAdversary,etmRedundantCCAAdversary: Exercise 5.4 redundant-tag MAC transformation and reductions / attackers ([KL20], Exercise 5.4).
Main results #
Cslib.Crypto.SymmetricCipher.INDCPA.tailFallback,Cslib.Crypto.SymmetricCipher.EncForge.tailFallback,Cslib.Crypto.SymmetricCipher.not_ciphertextIntegrity_tailFallback,Cslib.Crypto.SymmetricCipher.not_indcca_tailFallback,Cslib.Crypto.SymmetricCipher.tailFallback_counterexample: Exercise 5.10 separation ofINDCPA ∧ EncForgefromINDCCAandCiphertextIntegrity.Cslib.Crypto.MACScheme.EUFCMA.redundantTag,Cslib.Crypto.MACScheme.not_sufCma_redundantTag,Cslib.Crypto.not_ciphertextIntegrity_encryptThenMAC_redundantTag,Cslib.Crypto.not_indcca_encryptThenMAC_redundantTag,Cslib.Crypto.encryptThenMAC_redundantTag_counterexample: Exercise 5.4 counterexample to Encrypt-then-MAC CCA security under a non-strong MAC.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed., Exercises 5.4 and 5.10 (pp. 164–165).
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Sections 9.1 and 9.4.1 (pp. 358–368).
Katz–Lindell Exercise 5.10: INDCPA ∧ EncForge Does Not Imply INDCCA #
Given any symmetric cipher E, E.tailFallback has the same keyGen and encrypt as E, and
decrypts ct by returning E.decrypt n k ct when it is some msg, or falling back to
E.decrypt n k ct.tail when ct is non-empty and E.decrypt n k ct = none. This preserves
INDCPA, OneTimeINDCPA, and EncForge, while unconditionally breaking
OneTimeCiphertextIntegrity and CiphertextIntegrity (and breaking OneTimeINDCCA and INDCCA
whenever E.EncForge holds, by querying decryption on false :: ct).
Modified symmetric cipher E.tailFallback ([KL20], Exercise 5.10, printed p. 165):
keyGen and encrypt are identical to E, while decrypt n k ct returns E.decrypt n k ct
whenever that succeeds and otherwise falls back to E.decrypt n k ct.tail on non-empty ct.
Its ciphertext space is E.ctSpace together with the nonempty words whose tail lies in it.
E.tailFallback has the exact same cpaGame as E.
E.tailFallback has the exact same cpaOneTimeGame as E.
tailFallback preserves INDCPA ([KL20], Exercise 5.10, printed p. 165).
tailFallback preserves OneTimeINDCPA.
Reduction adversary that runs adversary and drops the leading bit of its candidate
ciphertext (List.tail).
tailCIAdversary preserves strict oracle-PPT admissibility (IsOraclePPT).
tailCIAdversary preserves any per-input query-count bound IsQueryBounded Q.
Quantitative EncForge bound for E.tailFallback ([KL20], Exercise 5.10,
printed p. 165): any fresh-message forgery against E.tailFallback either already succeeds
directly against E on ct or succeeds against E on ct.tail via tailCIAdversary.
tailFallback preserves EncForge ([KL20], Exercise 5.10, printed p. 165).
One-query ciphertext-integrity / EncForge adversary that queries encryption on bit^n
(truncating the reply to ctBound n) and prepends false to the returned ciphertext.
prependFalseBitCIAdversary is strict oracle-PPT whenever ctBound is computable in plain
polynomial time.
In ciOneTimeGame against E.tailFallback, prependFalseBitCIAdversary bit ctBound wins
with probability 1 at every security parameter n where ctBound n bounds ciphertext lengths.
In ciGame against E.tailFallback, prependFalseBitCIAdversary bit ctBound wins with
probability 1 at every security parameter n where ctBound n bounds ciphertext lengths.
E.tailFallback never satisfies OneTimeCiphertextIntegrity ([KL20],
Exercise 5.10, printed p. 165).
E.tailFallback never satisfies CiphertextIntegrity ([KL20], Exercise 5.10,
printed p. 165).
E.tailFallback never satisfies OneTimeAuthenticatedEncryption.
E.tailFallback never satisfies AuthenticatedEncryption.
Two-query CCA adversary against E.tailFallback ([KL20], Exercise 5.10,
printed p. 165): queries left-or-right encryption on (0^n, 1^n) to obtain ct, queries
decryption on false :: ct, and outputs whether the decrypted message equals some 1^n.
tailFallbackCCAAdversary is strict oracle-PPT whenever ctBound is computable in plain
polynomial time.
If E.EncForge holds, then E.tailFallback fails OneTimeINDCCA
([KL20], Exercise 5.10, printed p. 165).
If E.EncForge holds, then E.tailFallback fails INDCCA
([KL20], Exercise 5.10, printed p. 165).
Katz–Lindell Exercise 5.10 counterexample
([KL20], Exercise 5.10, printed p. 165): from any INDCPA and EncForge symmetric
cipher E, E.tailFallback simultaneously satisfies INDCPA and EncForge while failing
OneTimeCiphertextIntegrity, CiphertextIntegrity, OneTimeINDCCA, and INDCCA.
Katz–Lindell Exercise 5.4: Encrypt-then-MAC Under a Non-Strong MAC #
Given any M : MACScheme, M.redundantTag keeps msgLen, keyGen, and sign unchanged, while
verify accepts tag whenever either M.verify sk msg tag holds or tag is non-empty and
M.verify sk msg tag.tail holds. Consequently:
M.redundantTagpreservesEUFCMAandOneTimeEUFCMA(any fresh-message forgery(msg, tag)againstM.redundantTagyields a fresh-message forgery againstMon either(msg, tag)or(msg, tag.tail)),M.redundantTagfailsOneTimeSUFCMAandSUFCMA(redundantTagForgerqueries0^(M.msgLen n)to obtaintagand outputs(0^(M.msgLen n), false :: tag)),- when composed with any
E : SymmetricCipherviaencryptThenMAC E M.redundantTag hctLen, the resulting cipher satisfiesINDCPA(ifE.INDCPA) andEncForge(ifM.EUFCMA), yet failsOneTimeCiphertextIntegrity,CiphertextIntegrity,OneTimeINDCCA, andINDCCA([KL20], Exercise 5.4, printed p. 164).
Redundant-tag MAC transformation ([KL20], Exercise 5.4, printed p. 164):
M.redundantTag keeps msgLen, keyGen, and sign unchanged, while verify accepts tag when
either M.verify sk msg tag holds or tag is non-empty and M.verify sk msg tag.tail holds.
Forger reduction that strips the leading bit of the candidate forgery tag.
tailTagForger preserves strict oracle-PPT admissibility (IsOraclePPT).
Quantitative EUFCMA bound for M.redundantTag ([KL20], Exercise 5.4,
printed p. 164): any fresh-message forgery against M.redundantTag either succeeds directly
against M or succeeds after stripping the leading bit of the tag via tailTagForger.
Quantitative OneTimeEUFCMA bound for M.redundantTag.
redundantTag preserves EUFCMA ([KL20], Exercise 5.4, printed p. 164).
redundantTag preserves OneTimeEUFCMA.
One-query strong-MAC forger against M.redundantTag: queries 0^(M.msgLen n) (truncating the
reply to tagBound n) and prepends false to the returned tag.
redundantTagForger is strict oracle-PPT whenever tagBound is computable in plain polynomial
time.
In sufOneTimeGame against M.redundantTag, M.redundantTagForger tagBound wins with
probability 1 at every security parameter n where tagBound n bounds tag lengths.
In sufCmaGame against M.redundantTag, M.redundantTagForger tagBound wins with probability
1 at every security parameter n where tagBound n bounds tag lengths.
M.redundantTag never satisfies OneTimeSUFCMA ([KL20], Exercise 5.4,
printed p. 164).
M.redundantTag never satisfies SUFCMA ([KL20], Exercise 5.4, printed p. 164).
If M.EUFCMA holds, then encryptThenMAC E M.redundantTag hctLen satisfies EncForge
([KL20], Exercise 5.4, printed p. 164).
One-query ciphertext-integrity adversary against encryptThenMAC E M.redundantTag hctLen
([KL20], Exercise 5.4, printed p. 164): queries encryption on 0^n (truncating the
reply to ctBound n) to obtain ct = encPair encBits encBits (c, tag), and outputs
encPair encBits encBits (unframe ct, false :: dropFrame ct).
etmRedundantCIAdversary is strict oracle-PPT whenever ctBound is computable in plain
polynomial time.
In ciOneTimeGame against encryptThenMAC E M.redundantTag hctLen,
etmRedundantCIAdversary ctBound wins with probability 1 at every security parameter n where
ctBound n bounds ciphertext lengths.
In ciGame against encryptThenMAC E M.redundantTag hctLen,
etmRedundantCIAdversary ctBound wins with probability 1 at every security parameter n where
ctBound n bounds ciphertext lengths.
encryptThenMAC E M.redundantTag hctLen never satisfies OneTimeCiphertextIntegrity
([KL20], Exercise 5.4, printed p. 164).
encryptThenMAC E M.redundantTag hctLen never satisfies CiphertextIntegrity
([KL20], Exercise 5.4, printed p. 164).
encryptThenMAC E M.redundantTag hctLen never satisfies OneTimeAuthenticatedEncryption.
encryptThenMAC E M.redundantTag hctLen never satisfies AuthenticatedEncryption.
Two-query CCA adversary against encryptThenMAC E M.redundantTag hctLen
([KL20], Exercise 5.4, printed p. 164): queries left-or-right encryption on
(0^n, 1^n) to obtain ct, queries decryption on
encPair encBits encBits (unframe ct, false :: dropFrame ct), and outputs whether the decrypted
message equals some 1^n.
etmRedundantCCAAdversary is strict oracle-PPT whenever ctBound is computable in plain
polynomial time.
In ccaOneTimeGame against encryptThenMAC E M.redundantTag hctLen at challenge bit bit,
etmRedundantCCAAdversary ctBound outputs true iff some (List.replicate n bit) encodes to
encOption encBits (some (List.replicate n true)).
encryptThenMAC E M.redundantTag hctLen never satisfies OneTimeINDCCA
([KL20], Exercise 5.4, printed p. 164).
encryptThenMAC E M.redundantTag hctLen never satisfies INDCCA
([KL20], Exercise 5.4, printed p. 164).
Katz–Lindell Exercise 5.4 counterexample ([KL20], Exercise 5.4, printed p. 164):
for any INDCPA symmetric cipher E and any EUFCMA message authentication code M,
M.redundantTag is EUFCMA-secure yet not SUFCMA-secure, and
encryptThenMAC E M.redundantTag hctLen satisfies INDCPA and EncForge while failing
OneTimeCiphertextIntegrity, CiphertextIntegrity, OneTimeINDCCA, and INDCCA.
Concrete Non-Vacuous PRF-Based Instantiations #
End-to-end PRF-based instantiation of Exercise 5.10: for any secure
PseudorandomFunction family,
(prfEncryptThenMAC family hprf.polyTime hprf.length_eq).tailFallback satisfies INDCPA and
EncForge while failing OneTimeCiphertextIntegrity, CiphertextIntegrity, OneTimeINDCCA, and
INDCCA.
Concrete PRF-based Encrypt-then-MAC cipher with a non-strong redundant-tag MAC ([KL20], Exercise 5.4, printed p. 164).
End-to-end PRF-based instantiation of Exercise 5.4: for any secure
PseudorandomFunction family, prfEncryptThenMACRedundantTag satisfies INDCPA and EncForge
while failing OneTimeCiphertextIntegrity, CiphertextIntegrity, OneTimeINDCCA, and INDCCA.