Chosen-message security for public-key encryption #
The adversary receives the public key, chooses two messages of type Msg and saves a finite
state, then receives an encryption of the selected message. Both stages are single uniform strict
PPT algorithms. Their clocks charge the unary security parameter and the complete encoded input,
including the saved state. The adversary may retain the public key in that state.
This is the single-challenge public-key experiment of
Boneh and Shoup, Section 11.2, Attack Game 11.1, p. 436. That game requires the
two challenge messages to have the same length. Here admissibility is a Boolean predicate
valid : ℕ → List Bool → Msg → Msg → Bool on the security parameter, the public key and the
challenge pair: gameOn valid outputs false in both experiments when the pair is invalid, so an
invalid pair contributes no advantage. The unrestricted experiment game and notion INDCPAOf
are the always-true case. Single-bit messages (Adversary, INDCPA) are unrestricted, and
bit-word messages (WordAdversary, WordINDCPA) use the equal-length predicate
fun _ _ m₀ m₁ => m₀.length == m₁.length. For public-key encryption, further encryptions can be
computed from the public key. The separate multi-challenge equivalence of their Theorem 11.1 is
not formalized here. Encryption correctness and efficiency of the honest algorithms remain separate
properties.
Main definitions #
Cslib.Crypto.Encryption.AdversaryOf,Cslib.Crypto.Encryption.Adversary,Cslib.Crypto.Encryption.WordAdversary: message selection and guessing with explicit saved state, for typed, bit, and bit-word messages.Cslib.Crypto.Encryption.encChoiceOut,Cslib.Crypto.Encryption.encGuessInput,Cslib.Crypto.Encryption.encChallengePairInput: the encodings of the message-selection output, of the guessing-stage input, and of the input of the admissibility predicate.Cslib.Crypto.Encryption.AdversaryOf.IsPPT,Cslib.Crypto.Encryption.Adversary.IsPPT,Cslib.Crypto.Encryption.WordAdversary.IsPPT: native uniform admissibility of both stages.Cslib.Crypto.Encryption.gameOn,Cslib.Crypto.Encryption.game: the key-generation and challenge-encryption experiment, with and without a challenge-pair admissibility predicate.Cslib.Crypto.Encryption.advantage: the advantage between the two sides of an experiment indexed by the challenge bit, such asgameOn, at one security parameter.Cslib.Crypto.Encryption.INDCPAOn,Cslib.Crypto.Encryption.INDCPAOf,Cslib.Crypto.Encryption.INDCPA,Cslib.Crypto.Encryption.WordINDCPA: negligible distinguishing advantage for every admissible adversary, fixed before the security parameter.Cslib.Crypto.Encryption.AdversaryOf.restrict: the adversary that playsgameOn validinside the unrestrictedgame, by recording validity in its saved state.Cslib.Crypto.Encryption.AdversaryOf.toTwoStage: the two-stage adversary of the typed experimentCslib.Crypto.PKE.cpaExperimentplayed at one parameter.
Main results #
Cslib.Crypto.Encryption.eval_gameOn,Cslib.Crypto.Encryption.eval_game: the experiments depend only on the public-key marginal.Cslib.Crypto.Encryption.eval_game_restrict:gameonadversary.restrict validhas the same output distribution asgameOn validonadversary.Cslib.Crypto.Encryption.gameOn_eq_cpaExperiment,Cslib.Crypto.Encryption.advantage_gameOn_eq_cpaExperiment,Cslib.Crypto.Encryption.AdversaryOf.isPPT_toTwoStage: at each parameter,gameOnand its advantage are those of the typed chosen-plaintext experiment of the scheme with the same algorithms, and a PPT word-level adversary is a PPT two-stage family.Cslib.Crypto.Encryption.INDCPAOn.congr,Cslib.Crypto.Encryption.INDCPAOf.congr,Cslib.Crypto.Encryption.INDCPA.congr: distributionally equal honest algorithms have the same security guarantee.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 11.2 (Attack Game 11.1, p. 436) and Section 11.3.2.
A chosen-message adversary over message space Msg. The saved word contains all data retained
between stages.
Receive the public key, choose the two challenge messages, and save a state.
Receive the saved state and challenge ciphertext, then return a distinguishing bit.
Message-selection output ((m₀, m₁), state): the two challenge messages, each encoded by
encMsg, then the saved state word. The message pair is framed, and m₀ is framed again inside
it.
Guessing-stage input (1ⁿ, state, ct): the security parameter n in unary, then the state
saved by message selection and the challenge ciphertext, both as bit words. The parameter and the
state are framed. The layout is that of the keyed-algorithm input Cslib.Crypto.encKeyedInput encBits; the name records the role.
Input (1ⁿ, pk, (m₀, m₁)) of a challenge-pair admissibility predicate valid: the security
parameter n in unary, the public key as a bit word, and the two challenge messages, each encoded
by encMsg. The parameter, the public key and m₀ are framed.
One finite-machine certificate for each whole stage over message encoding encMsg, including
the full saved-state cost. There is no parameter-dependent advice or separate algorithm for each
security parameter.
Message selection is uniform strict PPT on the parameter and public key.
- guess : Probability.IsPPTOn 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 PPT on the parameter, saved state, and challenge ciphertext.
A chosen-message adversary for single-bit messages (Bool).
Phase 1 choice ((msg₀, msg₁), state) returned by an AdversaryOf Msg.
Native uniform strict PPT admissibility for a bit chosen-message adversary.
Native uniform strict PPT admissibility for a bit-word chosen-message adversary.
The single-challenge chosen-message experiment with challenge-pair admissibility predicate
valid ([BS23], Section 11.2, Attack Game 11.1, p. 436). Sample the key pair and pass
the public key to adversary.choose. If valid n pk m₀ m₁ holds for the chosen pair, encrypt the
selected message with the honest algorithm and return the adversary's guess; otherwise return
false, in both experiments. The secret key is never passed to the adversary.
The unrestricted chosen-message experiment: gameOn with every challenge pair admissible.
The distinguishing advantage of a two-sided experiment experiment bit n at parameter n:
the advantage between its runs with bit = false and bit = true. The adversary is already part
of experiment, as in gameOn valid keyGen encrypt adversary; INDCPAOn asks that this advantage
be negligible for every admissible adversary.
Single-challenge IND-CPA for encryption over message encoding encMsg with challenge-pair
admissibility predicate valid, against every uniform strict PPT adversary. The negligible bound
may depend on the adversary, which is fixed before the parameter. This is semantic security,
[BS23], Attack Game 11.1 and Definition 11.2 (pp. 436–437), with the source's rule that
the two messages have the same length replaced by valid: a pair that valid rejects makes both
experiments output false. With the equal-length rule it is the source's notion (WordINDCPA).
Efficiency and correctness of keyGen and encrypt, which the source's scheme has, are separate
properties.
Single-challenge IND-CPA with every challenge pair admissible: [BS23], Attack
Game 11.1 and Definition 11.2 (pp. 436–437), with every pair of messages admitted as a challenge in
place of the source's rule that the two messages have the same length. The notion is generic in the
message type Msg. It is exactly the source's notion when all messages of Msg have one length,
as for Bool. At List Bool it is strictly stronger, so it is not the source's notion there;
WordINDCPA is.
Single-challenge IND-CPA for bit encryption against every uniform strict PPT adversary: semantic security, [BS23], Attack Game 11.1 and Definition 11.2 (pp. 436–437), for the message space of single bits.
Single-challenge IND-CPA for bit-word encryption under Attack Game 11.1's equal-length rule
([BS23], Section 11.2, p. 436): challenge pairs with m₀.length ≠ m₁.length are
inadmissible.
Only the public-key marginal of key generation is observed by gameOn.
Only the public-key marginal of key generation is observed by the unrestricted experiment.
Equal public-key marginals and equal encryption laws preserve INDCPAOn.
Equal public-key marginals and equal encryption laws preserve security.
Equal public-key marginals and equal bit-encryption laws preserve security.
Playing a restricted game inside the unrestricted one #
The adversary that plays gameOn valid inside the unrestricted game. Its choose runs
adversary.choose n pk and puts the bit valid n pk m₀ m₁ in front of the saved state; its
guess returns false when that bit is false and otherwise runs adversary.guess on the rest of
the state. The challenge pair itself is passed on unchanged.
Running the unrestricted game on adversary.restrict valid has the same output distribution
as running gameOn valid on adversary.
Word-level algorithms as a typed scheme #
The two-stage adversary that adversary plays at parameter n: message selection returns
the chosen pair as a MessagePair, and the saved state word is the two-stage state.
A uniform strict PPT word-level adversary is a uniform strict PPT two-stage family over the same encodings of the public key, challenge pair, ciphertext and state.
At each parameter n, the word-level experiment gameOn is the chosen-plaintext experiment
of the scheme with key generation keyGen n and encryption encrypt n, played by
adversary.toTwoStage n. The experiment never decrypts, so decrypt is arbitrary.
The word-level advantage of gameOn at parameter n is the advantage between the two sides of
the typed chosen-plaintext experiment, so a bound on one fixed scheme transfers to INDCPAOn.