Multiplicative ElGamal is not CCA secure #
The native multiplicative ElGamal scheme of
CslibFrontier/Crypto/Computational/ElGamal/ProbComp.lean,
(elGamalKeyGenProb d, elGamalEncryptProb encodeMsg d) with decryption elGamalDecryptDet d,
is IND-CPA secure under DDH (DDH.indcpa_elGamalBitEncryptProb,
DDH.indcpaOn_elGamalEncryptProb), but it is malleable and therefore not CCA secure. This module
proves that unconditionally, by an explicit strict oracle-PPT adversary with 1CCA advantage exactly
1 at every security parameter.
- Statement ([BS23], Exercise 12.1, printed p. 512), verbatim: "Show that multiplicative ElGamal from Exercise 11.5 is not CCA secure. Your adversary should have an advantage of 1 in the 1CCA attack game."
Multiplicative ElGamal ([BS23], Exercise 11.5, p. 459) encrypts m as
(v, e) = (β • g, β • u + m) (written additively) and decrypts (v, e) to e - α • v. The
adversary elGamalMaulAdversary is the generic malleability adversary Encryption.maulAdversary
of CslibFrontier/Crypto/Computational/Encryption/CCA/Malleability.lean, instantiated as follows.
It submits two challenge messages encoding distinct group elements x₀ ≠ x₁, maps the challenge
ciphertext (v, e) to (v, e + g) (elGamalMaulCiphertext), whose decryption differs because
g ≠ 0, asks the Phase 2 decryption oracle for it, receives x_b + g, and outputs whether this is
x₁ + g. The proofs supply only these malleability facts to the generic lemmas.
Mapping to the source #
- The 1CCA game of [BS23], Definition 12.2 (p. 468) is
Encryption.cca2GameOn, and its advantage|Pr[W₀] - Pr[W₁]|is the two-worldGame.advantage; the bound proved is exactly1, as the exercise asks (advantage_cca2GameOn_elGamalMaulAdversary). - Exercise 11.5's message space is the group. The headline
not_indcca2Of_elGamalBitEncryptProbrestricts it to the two bit messages0andg(encodeBit), the scheme whose IND-CPA securityDDH.indcpa_elGamalBitEncryptProbproves, and needs no hypothesis beyond a polynomial-time group family. The group-element scheme fails as well whenever its admissibility predicate admits the pair(0, g)under honest public keys (not_indcca2On_elGamalGroupEncryptProb). Both also fail the interleaved multi-challenge CCA notion of Definition 12.1 (not_indcca2InterleavedOf_elGamalBitEncryptProb,not_indcca2InterleavedOn_elGamalGroupEncryptProb). - As in
CslibFrontier/Crypto/Computational/ElGamal/ProbComp.lean, the group at parameternis the fixed descriptiond n, and key generation and encryption sample exponents withF.sampleExp. The attack succeeds for every key and every encryption coin, so these choices do not affect the result. Decryption never rejects, as in the source, so the CCA decryptor iselGamalDecryptOpt d = some ∘ elGamalDecryptDet d.
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.elGamalDecryptOpt: multiplicative ElGamal decryption as anOption-valued decryptor for the CCA games.Cslib.Crypto.PrimeOrderGroupFamily.elGamalMaulCiphertext: the word-level ciphertext map(v, e) ↦ (v, e + g).Cslib.Crypto.PrimeOrderGroupFamily.elGamalMaulAdversary: the one-query 1CCA adversary, an instance ofCslib.Crypto.Encryption.maulAdversary.
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.elGamalMaulCiphertext_encode,Cslib.Crypto.PrimeOrderGroupFamily.elGamalMaulCiphertext_ne,Cslib.Crypto.PrimeOrderGroupFamily.elGamalDecryptDet_elGamalMaulCiphertext,Cslib.Crypto.PrimeOrderGroupFamily.computableInPolyTime_elGamalMaulCiphertext: the mauled ciphertext differs from the original and decrypts to the message plusg; the map is polynomial-time.Cslib.Crypto.PrimeOrderGroupFamily.isPPT_elGamalMaulAdversary: the adversary is strict oracle PPT.Cslib.Crypto.PrimeOrderGroupFamily.eval_cca2GameOn_elGamalMaulAdversary,Cslib.Crypto.PrimeOrderGroupFamily.advantage_cca2GameOn_elGamalMaulAdversary: in worldbthe game outputsbwith probability1, so the advantage is1.Cslib.Crypto.PrimeOrderGroupFamily.not_indcca2On_elGamalEncryptProb: general form, for any efficiently computable admissible pair of messages encoding distinct group elements.Cslib.Crypto.PrimeOrderGroupFamily.not_indcca2Of_elGamalBitEncryptProb,Cslib.Crypto.PrimeOrderGroupFamily.not_indcca2InterleavedOf_elGamalBitEncryptProb,Cslib.Crypto.PrimeOrderGroupFamily.not_indcca2On_elGamalGroupEncryptProb,Cslib.Crypto.PrimeOrderGroupFamily.not_indcca2InterleavedOn_elGamalGroupEncryptProb: multiplicative ElGamal is not CCA secure ([BS23], Exercise 12.1, p. 512).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Exercise 11.5 (p. 459), Section 12.1 (Attack Game 12.1, Definitions 12.1–12.2, pp. 467–468), and Exercise 12.1 (p. 512).
Multiplicative ElGamal decryption as the Option-valued decryptor of the CCA games
(Encryption.cca2GameOn): it never rejects and returns elGamalDecryptDet d n sk ct, as the
decryption algorithm of [BS23], Exercise 11.5 (p. 459) is defined on all of G².
The word-level malleability map of multiplicative ElGamal: send an encoded ciphertext
encPair encBits encBits (v, e) to encPair encBits encBits (v, F.add (d, e, encode g)). On
encoded group elements it maps (v, e) to (v, e + g), combining the ciphertext with the
randomness-free encryption (0, g) of g by the homomorphism of [BS23],
Exercise 11.5(c) (p. 459).
On encoded group elements, elGamalMaulCiphertext maps (v, e) to (v, e + g).
The mauled ciphertext of an encoded ciphertext differs from it, since g ≠ 0.
Malleability of multiplicative ElGamal: the mauled encryption of m decrypts to m + g
under the matching secret key.
elGamalMaulCiphertext is computable in polynomial time.
The 1CCA malleability adversary against multiplicative ElGamal ([BS23],
Exercise 12.1, p. 512): the generic Encryption.maulAdversary with messages (msg₀ n, msg₁ n),
transformation elGamalMaulCiphertext (d n) and target the encoded decryption
some (encodeMsg (d n) (msg₁ n) + g) that world 1 produces. Phase 2 queries the decryption oracle
once, on the mauled challenge, and outputs whether the reply is that target.
elGamalMaulAdversary is strict oracle PPT whenever the group family, the message encoder
and both message choices are computable in polynomial time.
World bit of the 1CCA game against multiplicative ElGamal outputs bit
([BS23], Exercise 12.1, p. 512): if both challenge messages are admissible under every
honest public key and encode distinct group elements, elGamalMaulAdversary outputs the challenge
bit with probability 1.
elGamalMaulAdversary has 1CCA advantage 1 against multiplicative ElGamal
([BS23], Exercise 12.1, p. 512), under the hypotheses of
eval_cca2GameOn_elGamalMaulAdversary.
Multiplicative ElGamal is not 1CCA secure, general form ([BS23], Exercise 12.1,
p. 512): for a polynomial-time group family d and message encoder encodeMsg, if polynomial-time
message choices msg₀ msg₁ are admissible under valid at every honest public key and encode
distinct group elements at every parameter, then (elGamalKeyGenProb d, elGamalEncryptProb encodeMsg d, elGamalDecryptOpt d) fails Encryption.INDCCA2On valid encMsg encBits.
Bit ElGamal is not 1CCA secure ([BS23], Exercise 12.1, p. 512, for the bit
messages 0 and g of encodeBit): for every prime-order group family F and polynomial-time
group family d, the scheme (elGamalKeyGenProb d, elGamalEncryptProb encodeBit d), which is
IND-CPA secure under DDH (DDH.indcpa_elGamalBitEncryptProb), with decryptor
elGamalDecryptOpt d fails Encryption.INDCCA2Of encBool encBits. The adversary
elGamalMaulAdversary with messages false and true has advantage 1 at every parameter.
Bit ElGamal is not CCA secure in the interleaved multi-challenge sense of [BS23],
Attack Game 12.1 and Definition 12.1 (pp. 467–468): by INDCCA2InterleavedOn.indcca2On, from
not_indcca2Of_elGamalBitEncryptProb.
Group-element ElGamal is not 1CCA secure ([BS23], Exercise 12.1, p. 512): for a
polynomial-time group family d and any admissibility predicate valid that admits the encoded
pair (0, g) under every honest public key (in particular any predicate admitting all pairs of
group elements, the message space of Exercise 11.5), the scheme
(elGamalKeyGenProb d, elGamalEncryptProb (fun _ m => m) d, elGamalDecryptOpt d) fails
Encryption.INDCCA2On valid encBits encBits.
Group-element ElGamal is not CCA secure in the interleaved multi-challenge sense of
[BS23], Attack Game 12.1 and Definition 12.1 (pp. 467–468), under the hypotheses of
not_indcca2On_elGamalGroupEncryptProb.