Documentation

VCVio.CryptoFoundations.SymmEncAlg

Symmetric Encryption Schemes. #

This file defines a type SymmEncAlg spec M K C to represent a protocol for symmetric encryption using oracles in spec, with message space M, secret keys of type K, and ciphertext space C.

structure SymmEncAlg (m : Type u → Type v) (M K C : Type u) extends ExecutionMethod m :
Type (max (u + 1) v)

Symmetric encryption algorithm with access to oracles in spec (simulated with state σ), where M is the space of messages, K is the key space, and C is the ciphertext space.

Instances For
    class SymmEncAlg.Complete {m : TypeType v} {M K C : Type} [AlternativeMonad m] (encAlg : SymmEncAlg m M K C) :

    A SymmEncAlg is complete if decrypting an encrypted message always returns that original message, captured here by a guard statement.

    TODO: should this be a class?

    Instances
      def SymmEncAlg.perfectSecrecy {m : TypeType v} {M K C : Type} [AlternativeMonad m] (encAlg : SymmEncAlg m M K C) :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem SymmEncAlg.perfectSecrecy_iff_of_card_eq {m : TypeType v} {M K C : Type} [AlternativeMonad m] [LawfulAlternative m] [Fintype M] [Fintype K] [Fintype C] (encAlg : SymmEncAlg m M K C) [encAlg.Complete] (h1 : Fintype.card M = Fintype.card K) (h2 : Fintype.card K = Fintype.card C) :
        encAlg.perfectSecrecy (∀ (k : K), [=k|encAlg.exec encAlg.keygen] = (↑(Fintype.card K))⁻¹) ∀ (m_1 : M) (c : m C), ∃! k : K, k OracleComp.support (encAlg.exec encAlg.keygen) encAlg.encrypt k m_1 = c

        Shanon's theorem on perfect secrecy, showing that encryption and decryption must be determined bijections between message and cipher-text space, and that keys must be chosen uniformly.