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 #
Cslib.Crypto.BlockCipher.halfBlockCipher: the half-block scheme built from a block cipher whose blocks have length2 n.Cslib.Crypto.BlockCipher.allOnesForger: the forger that outputs the all-ones block.
Main results #
Cslib.Crypto.BlockCipher.eval_ciGame_halfBlockCipher_allOnesForger: the forger always wins.Cslib.Crypto.BlockCipher.not_ciphertextIntegrity_halfBlockCipher,Cslib.Crypto.BlockCipher.not_authenticatedEncryption_halfBlockCipher,Cslib.Crypto.BlockCipher.not_realIdealAE_halfBlockCipher: the scheme has none of these properties, whatever the block cipher.
Implementation notes #
- Katz and Lindell use
n-bit blocks with ann/2-bit nonce andn/2-bit messages. ASymmetricCipherencryptsn-bit messages, so here the nonce and the message havenbits each and the blocks have2 nbits. - The forger makes no queries, so it also breaks Katz and Lindell's unforgeability.
- The negative results hold for every block cipher. The CCA security of the scheme for a strong pseudorandom permutation, also asked in Exercise 5.8, is not formalized here.
References #
The scheme #
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 messagemsgsamples a uniformn-bit noncerand returns the blockF.encrypt n k (r ++ msg). - Decryption of a word
ctof lengthF.blockLen nappliesF.decrypt n kand drops the firstnbits; 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.
The all-ones forger is a polynomial-time CI adversary.
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.