Documentation

CslibFrontier.Crypto.Computational.Encryption.HalfBlockPRP

Half-Block Encryption from a Block Cipher #

This module formalizes the scheme of Katz and Lindell, Exercise 5.8, which encrypts m under a block cipher F as F_k(r ‖ m) for a fresh nonce r, and proves Katz and Lindell, Exercise 5.9: the scheme is not authenticated encryption. Every block of the right length decrypts, so an adversary that makes no queries and outputs a fixed block wins the ciphertext-integrity game with probability 1.

Main definitions #

Main results #

Implementation notes #

References #

The scheme #

noncomputable def Cslib.Crypto.BlockCipher.halfBlockCipher (F : BlockCipher) (hblock : ∀ (n : ℕ), F.blockLen n = 2 * n) :

The half-block encryption scheme of Katz and Lindell, Exercise 5.8, built from a block cipher F whose blocks have length 2 n at security parameter n.

  • Key generation samples a uniform key of length F.keyLen n.
  • Encryption of an n-bit message msg samples a uniform n-bit nonce r and returns the block F.encrypt n k (r ++ msg).
  • Decryption of a word ct of length F.blockLen n applies F.decrypt n k and drops the first n bits; words of any other length are rejected.
  • The ciphertext space is the words of length F.blockLen n.

The scheme is not authenticated encryption #

The forger that makes no queries and outputs the all-ones word of length F.blockLen n.

Every word of length F.blockLen n decrypts and the forger makes no queries, so it wins ciGame against the half-block scheme with probability 1.

The half-block scheme does not have ciphertext integrity, whatever the block cipher.

Katz and Lindell, Exercise 5.9. The half-block scheme is not an authenticated encryption scheme, whatever the block cipher.

The half-block scheme is not authenticated encryption in the real/ideal sense of Katz and Lindell, Definition 5.4 either.