Chosen-plaintext attacks on public-key encryption #
In the eavesdropping experiment Cslib.Crypto.Encryption.gameOn the adversary already holds the
public key, so it can encrypt any message itself. Katz and Lindell conclude that, for public-key
encryption, indistinguishability against eavesdroppers implies security against chosen-plaintext
attacks ([KL20], Section 12.2.1, Proposition 12.3, p. 406). This module states the
chosen-plaintext experiment with an explicit encryption oracle and proves that implication.
The chosen-plaintext experiment is the public-key form of [KL20], Definition 3.21: both
stages of the adversary may query an encryption oracle that encrypts any message under the public
key with fresh coins. For one fixed scheme E : PKE PK SK M C, E.cpaOracleExperiment is stated
with typed keys, messages and ciphertexts against a PKE.CPAOracleAdversary, whose stages are
oracle programs over the typed encryption oracle E.encrypt pk. The adversary that answers its own
queries, A.toTwoStage E, plays the eavesdropping experiment E.cpaExperiment with exactly the
same law (PKE.cpaOracleExperiment_eq_cpaExperiment), which is Proposition 12.3 at one scheme.
Asymptotic security quantifies over uniform strict oracle PPT adversaries, which are word-level
oracle programs: both stages of a Cslib.Crypto.Encryption.WordCPAAdversary query the oracle with
bit words. The challenge stage and the admissibility predicate valid are those of gameOn. At
each parameter, cpaOracleGameOn is the typed experiment of the scheme with the same algorithms,
played by adversary.toCPAOracleAdversary n (cpaOracleGameOn_eq_cpaOracleExperiment).
Main definitions #
Cslib.Crypto.PKE.CPAOracleAdversary,Cslib.Crypto.PKE.cpaOracleExperiment: typed chosen-plaintext adversaries and the chosen-plaintext experiment of one fixed scheme.Cslib.Crypto.PKE.CPAOracleAdversary.toTwoStage: the eavesdropper that answers the oracle queries itself, by encrypting under the public key it saved.Cslib.Crypto.Encryption.encryptionOracle,Cslib.Crypto.Encryption.runWithEncryption: the word-level encryption oracle and the execution of an oracle program against it.Cslib.Crypto.Encryption.WordCPAAdversary,Cslib.Crypto.Encryption.WordCPAAdversary.IsPPT,Cslib.Crypto.Encryption.encEncryptInput: chosen-plaintext adversaries, their uniform strict oracle PPT admissibility, and the(1ⁿ, pk, msg)encryption-input encoding.Cslib.Crypto.Encryption.cpaOracleGameOn,Cslib.Crypto.Encryption.WordINDCPAOracleOn,Cslib.Crypto.Encryption.WordINDCPAOracle: the chosen-plaintext experiment and security, the latter under the equal-length rule of [KL20], Definition 3.21.Cslib.Crypto.Encryption.WordCPAAdversary.toCPAOracleAdversary: the typed adversary that a word adversary plays at one parameter.Cslib.Crypto.Encryption.WordCPAAdversary.toAdversary: the word-level eavesdropper that answers the oracle queries itself.
Main results #
Cslib.Crypto.PKE.cpaOracleExperiment_eq_cpaExperiment: the eavesdropping experiment ofA.toTwoStage Eis the chosen-plaintext experiment ofA([KL20], Proposition 12.3, for one scheme).Cslib.Crypto.Encryption.cpaOracleGameOn_eq_cpaOracleExperiment: the word-level experiment at one parameter is the typed one.Cslib.Crypto.Encryption.WordCPAAdversary.isPPT_toAdversary: the eavesdropper is uniform strict PPT when the adversary and the honest encryption algorithm are.Cslib.Crypto.Encryption.WordCPAAdversary.eval_gameOn_toAdversary: its eavesdropping experiment has exactly the law of the chosen-plaintext experiment.Cslib.Crypto.Encryption.INDCPAOn.wordINDCPAOracleOn,Cslib.Crypto.Encryption.WordINDCPA.wordINDCPAOracle: indistinguishability against eavesdroppers implies security against chosen-plaintext attacks ([KL20], Proposition 12.3).
The multiple-encryption form with a left-or-right oracle ([KL20], Section 12.2.2, Theorem 12.6, p. 408) is not formalized here.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Definition 3.21 and Section 12.2.1 (Definition 12.2 and Proposition 12.3, pp. 405–406).
A chosen-plaintext adversary against a public-key scheme with public keys PK, messages M
and ciphertexts C. Both stages are oracle programs that may ask the encryption oracle for an
encryption of any message m : M; σ is the state saved between the stages.
Receive the public key, query the oracle, and choose two challenge messages and a state.
- guess : σ → C → ProbOracleComp (fun (x : M) => C) Bool
Receive the saved state and the challenge ciphertext, query the oracle, and return a guess.
The chosen-plaintext experiment of the scheme E with challenge-pair admissibility predicate
valid (the public-key form of [KL20], Definition 3.21). Draw a key pair; run message
selection against the encryption oracle E.encrypt pk; if valid pk m₀ m₁ holds, encrypt the
message selected by b and run the guessing stage against the same oracle, and otherwise return
false.
The eavesdropper that runs A and answers its oracle queries by encrypting under the public
key, which it saves next to A's state.
Against a public-key scheme, the encryption oracle gives the adversary nothing that the public
key does not: the eavesdropping experiment of A.toTwoStage E is the chosen-plaintext experiment
of A ([KL20], Proposition 12.3, for one fixed scheme).
The encryption oracle under public key pk at parameter n: answer each query word
request.2 with a fresh encryption of it. The oracle keeps no state.
Run an oracle program against encryptionOracle encrypt n pk, with private coins sampled
uniformly, and return its result.
A chosen-plaintext adversary on bit words. Both stages may query the encryption oracle.
Receive the public key, query the oracle, choose two challenge messages, and save a state.
Receive the saved state and the challenge ciphertext, query the oracle, and return a distinguishing bit.
Uniform strict oracle PPT admissibility of both stages of a WordCPAAdversary.
Message selection is uniform strict oracle PPT on the parameter and public key.
- guess : Probability.IsOraclePPTOn encGuessInput Turing.MultiTapeTM.encBool fun (x : ℕ × List Bool × List Bool) => match x with | (n, state, ciphertext) => adversary.guess n state ciphertext
Guessing is uniform strict oracle PPT on the parameter, saved state and ciphertext.
The chosen-plaintext experiment with challenge-pair admissibility predicate valid, the
public-key form of [KL20], Definition 3.21. Sample the key pair; run message selection
against the encryption oracle; if valid n pk m₀ m₁ holds, encrypt the selected message and run
the guessing stage against the oracle, and otherwise return false in both experiments.
Security against chosen-plaintext attacks with admissibility predicate valid, against
every uniform strict oracle PPT adversary.
The typed adversary that adversary plays at parameter n: each word query (_, m) becomes
the typed query m, message selection returns the chosen pair as a MessagePair, and the saved
state word is the typed state.
Running a word oracle program against encryptionOracle encrypt n pk runs its typed form
against the typed oracle encrypt n pk.
The chosen-plaintext experiment at parameter n is the typed experiment of the scheme with
key generation keyGen n and encryption encrypt n, played by
adversary.toCPAOracleAdversary n. The experiment never decrypts, so decrypt is arbitrary.
The eavesdropper that runs a chosen-plaintext adversary and answers its oracle queries by encrypting under the public key. Message selection saves the public key in front of the adversary's state; guessing reads it back.
Running an oracle PPT program against the encryption oracle is PPT, when the parameter, the public key and the program input are computed in polynomial time from the caller's input.
The eavesdropper adversary.toAdversary encrypt is uniform strict PPT, including its saved
public key, when the adversary and the honest encryption algorithm are.
The eavesdropping experiment of adversary.toAdversary encrypt is the chosen-plaintext
experiment of adversary.
Indistinguishability against eavesdroppers implies security against chosen-plaintext attacks, for any admissibility predicate ([KL20], Proposition 12.3).
Indistinguishability against eavesdroppers implies security against chosen-plaintext attacks, under the equal-length rule ([KL20], Proposition 12.3).