Documentation

OTP.Distributions

OTP.Distributions.lean #

This file defines the probability distributions related to the one-time pad (OTP) cryptographic scheme. It includes:

Files in this series:

instance key_nonempty {n : } :

Uniform Key Distribution #

noncomputable def μK {n : } :
PMF (Key n)
Equations
Instances For

    Independence and Joint Distribution #

    The crucial assumption for OTP's perfect secrecy is that the key is chosen independently of the message.

    For pmfs μM : PMF (Plaintext n) and μK : PMF (Key n), their joint distribution μMK : PMF (Plaintext n × Key n) assigns probability (μM m) ⬝ (μK k) to the pair (m, k).

    noncomputable def μMK {n : } (μM : PMF (Plaintext n)) :
    Equations
    Instances For

      Ciphertext Distribution #

      noncomputable def μC {n : } (μM : PMF (Plaintext n)) :
      Equations
      Instances For

        ℙ(C = c | M = m) #

        This represents the probability of observing ciphertext c, given the message is M = m.

        If the message is m, the ciphertext r.v. C = encrypt(m, K) depends only on the randomly chosen key (which follows the μK distribution).

        noncomputable def μC_M {n : } (m : Plaintext n) :
        Equations
        Instances For