Documentation

CatCryptCore.Examples.DetCPA

Deterministic CPA Impossibility #

This file formalizes the impossibility of CPA-secure deterministic encryption from Chapter 7.1 of "The Joy of Cryptography".

Overview #

Any deterministic encryption scheme can be broken by a simple adversary that encrypts the same message twice and checks if the ciphertexts match. For the XOR-based scheme enc(k, m) = xor k m, we show that the distinguishing advantage is exactly 1.

No UC wrapper — this is an attack/insecurity result.

References #

Deterministic Encryption Scheme #

A deterministic encryption scheme: enc(key, msg) → ciphertext.

Instances For

    XOR-based deterministic encryption: enc(k, m) = xor k m.

    Equations
    Instances For

      Two-Encryption Game #

      Game: encrypt two messages under the same random key, return ciphertext pair.

      Equations
      Instances For

        Equality-checking adversary: returns true iff both ciphertexts are equal.

        Equations
        Instances For

          Insecurity Proof #

          For the XOR scheme encrypting the same message twice: the adversary always returns true (advantage 1 side).

          For the XOR scheme encrypting different messages: the adversary always returns false (advantage 0 side).

          Main theorem: XOR deterministic encryption is completely insecure.

          The equality-checking adversary achieves advantage 1 when distinguishing same-message encryption from different-message encryption.