Documentation

Complexity.Crypto.Computational.Encryption.Basic

Chosen-message security for bit encryption #

The adversary receives the public key, chooses two bits and saves a finite state, then receives an encryption of the selected bit. 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, specialized to bit messages. 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 #

Main results #

References #

A chosen-message adversary. The saved word contains all data retained between stages.

Instances For

    One finite-machine certificate for each whole stage, including the full saved-state cost. There is no parameter-dependent advice or separate algorithm for each security parameter.

    Instances For
      def Cslib.Crypto.Encryption.game (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Bool → ProbComp (List Bool)) (adversary : Adversary) (bit : Bool) (n : ℕ) :

      Sample the key pair and the chosen challenge encryption using the honest algorithms. The secret key is never passed to the adversary.

      Instances For
        def Cslib.Crypto.Encryption.INDCPA (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Bool → ProbComp (List Bool)) :

        Single-challenge IND-CPA for bit encryption against every uniform strict PPT adversary. The negligible bound may depend on the adversary, which is fixed before the parameter.

        Instances For
          theorem Cslib.Crypto.Encryption.eval_game (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Bool → ProbComp (List Bool)) (adversary : Adversary) (bit : Bool) (n : ℕ) :
          (game keyGen encrypt adversary bit n).eval = do let pk ← PMF.map Prod.fst (keyGen n).eval let choice ← (adversary.choose n pk).eval let ciphertext ← (encrypt n pk (if bit = true then choice.1.2 else choice.1.1)).eval (adversary.guess n choice.2 ciphertext).eval

          Only the public-key marginal of key generation is observed by the experiment.

          theorem Cslib.Crypto.Encryption.INDCPA.congr {keyGen keyGen' : ℕ → ProbComp (List Bool × List Bool)} {encrypt encrypt' : ℕ → List Bool → Bool → ProbComp (List Bool)} (h : INDCPA keyGen encrypt) (hkeyGen : ∀ (n : ℕ), PMF.map Prod.fst (keyGen n).eval = PMF.map Prod.fst (keyGen' n).eval) (hencrypt : ∀ (n : ℕ) (pk : List Bool) (bit : Bool), (encrypt n pk bit).eval = (encrypt' n pk bit).eval) :
          INDCPA keyGen' encrypt'

          Equal public-key marginals and equal encryption laws preserve security.