A block cipher operates on a fixed-length block of plaintext of bits, mapping it to a ciphertext block of the same length under a secret key , both drawn from .
For a fixed key , the encryption function is a bijection on , so it is invertible via .
Block Cipher as a PRP
A block cipher’s key design objective is to behave like a family of pseudorandom permutations (PRP) indexed by .
Large messages are divided into blocks and encrypted independently per block:
Per Kerckhoffs’s principle, and are public. Only is secret.
Attacking a Block Cipher
- Ciphertext only
Attacker has only and searches the key space exhaustively for a giving a meaningful . Requires to make this infeasible. - Chosen plaintext (IND-CPA)
Attacker submits chosen plaintexts to an encryption oracle and must not be able to distinguish encryptions of chosen messages better than a coin toss. - Chosen ciphertext (IND-CCA)
Attacker has access to an encryption oracle, a decryption oracle (except for the challenge ciphertext), and a left-right oracle producing for . Wins by guessing . A secure scheme limits this to probability 0.5.
A block cipher is only a building block. The specific design combining a block cipher into a usable encryption scheme is its mode of operation.
Iterated Block Cipher Design
Security comes from repeated application of a round function to the block, over rounds. Increasing increases security up to a stable level.
Feistel Cipher
Named after Horst Feistel. Splits the plaintext block into halves and iterates a round function , keyed by , over rounds, swapping the final halves to produce the ciphertext.
Each encryption round:
Each decryption round, using the round keys in reverse order:
Design parameters of a Feistel cipher:
- Block length .
- Number of rounds .
- Definition of the round function .
- Key schedule generating each round key from .
- Length of the secret key .
DES
The Data Encryption Standard, published 1975, standardized 1977. Superseded by AES (1998/2001).
Design parameters:
- Block length bits.
- Number of rounds .
- Round function combining substitution and permutation.
- 16 round keys of 48 bits each, from a subkey generation algorithm.
- Secret key length 56 bits.
Attacking DES
A brute-force known-plaintext attack averages steps given the 56-bit key.
Double and Triple DES
- Double DES
Encrypting twice with the same key () is broken by the meet-in-the-middle attack, which encrypts forward and decrypts backward over all keys, matching where results agree, in steps. - Double DES with 2 keys
gives an effective key length of 112 bits. - Triple DES (3DES)
, effective key length 168 bits. Setting reduces it to plain DES. - 2-key 3DES
Setting gives , effective key length 112 bits.
Internal Structure of DES
- Initial permutation (IP) of the 64-bit input block.
- Split into left and right halves.
- 16 Feistel rounds.
- Rejoin the halves.
- Final inverse permutation ().
Round Function
Per round, the 32-bit right half is processed:
- Expansion permutation , 32 bits to 48 bits.
- XOR with the 48-bit round key.
- Split into 8 blocks of 6 bits.
- Substitution via 8 S-boxes, each 6-bit input to a 4-bit output.
- Combine the 8 outputs into 32 bits.
- Permutation via the P-box.
- Expansion permutation
Diffuses input bits. The first and last bits of each 6-bit S-box input select a row (of 4) in that S-box, and the middle 4 bits select a column (of 16). - Avalanche effect
16 of the 32 input bits each affect both a row and column selection across 2 different S-boxes, spreading dependencies. A single plaintext bit difference should flip about 50% of ciphertext bits. - S-boxes
Provide the cipher’s non-linearity, the most security-critical component of DES.
Key Schedule
The 64-bit input key has every 8th bit as a parity bit, so the effective key length is 56 bits.
- Permuted Choice 1 (PC-1)
Permutes the 56-bit key, splitting the result into two 28-bit halves . - Rotation
Each round left-rotates and by positions (1 or 2, per a fixed schedule) to get . - Permuted Choice 2 (PC-2)
Rejoins into 56 bits, drops 8 fixed bit positions, and permutes the remaining 48 bits to produce round key .