Using the S1 table in the section above, find the 4-bit outputs of S1 for the 6-bit inputs (a) 011011 and (b) 100110.
DES, Triple DES, AES and IDEA are the classic symmetric block ciphers. Their block sizes, key sizes, round counts and internal steps — Feistel rounds and S-boxes, EDE, SubBytes–ShiftRows–MixColumns–AddRoundKey, and IDEA's mixed arithmetic — are among the most frequently asked security facts.
A block cipher encrypts a fixed-size block of plaintext (64 or 128 bits) into a ciphertext block of the same size under a key. To be secure it must behave like a randomly chosen permutation of all possible blocks — yet be described by a short key. Designers get there by iterating a simple round many times, each round using a different subkey (round key) derived from the main key by a key schedule.
Horst Feistel at IBM proposed a structure that makes any round function invertible. Split the block into a left half L and a right half R. Each round passes R through a round function F together with the subkey, XORs the result into L, and swaps the halves.
Notice that decryption computes F in the forward direction again. That is the beauty of the Feistel design: F can be any complicated, even non-invertible, function, and the same hardware performs both encryption and decryption — only the subkeys are fed in reverse order. DES, 3DES, Blowfish, Twofish and CAST are Feistel ciphers.
In the early 1970s IBM's team led by Horst Feistel designed Lucifer, a cipher with a 128-bit key. When the US National Bureau of Standards (NBS, now NIST) asked for a national encryption standard, IBM submitted a modified version. After review by the NSA — which shortened the key to 56 bits and redesigned the S-boxes — it was published as the Data Encryption Standard (DES), FIPS PUB 46, in 1977.
| Parameter | DES value |
|---|---|
| Block size | 64 bits |
| Key supplied | 64 bits, of which 8 are parity bits (one per byte) |
| Effective key | 56 bits → 2⁵⁶ ≈ 7.2 × 10¹⁶ keys |
| Structure | Feistel network, 16 rounds |
| Round subkeys | 16 subkeys of 48 bits each |
| Round function parts | Expansion E (32 → 48), XOR with subkey, 8 S-boxes (6 → 4 bits each), P-box (32-bit permutation) |
| Extra steps | Initial permutation (IP) before round 1, a 32-bit swap after round 16, final permutation IP⁻¹ |
| Year | Event |
|---|---|
| 1977 | DES adopted as FIPS PUB 46 by NBS |
| 1990–94 | Differential (Biham–Shamir; 2⁴⁷ chosen plaintexts) and linear cryptanalysis (Matsui; 2⁴³ known plaintexts) — both theoretical |
| 1998 | EFF's "Deep Crack" machine (cost under US $250,000) recovers a DES key in 56 hours |
| 1999 | Deep Crack plus distributed.net volunteers: 22 hours 15 minutes; FIPS 46-3 now recommends Triple DES |
| 2005 | NIST withdraws DES as a standard |
The 64-bit plaintext first passes through the fixed initial permutation (IP) and is split into 32-bit halves L₀ and R₀. Sixteen Feistel rounds follow, the halves are swapped once more, and the final permutation IP⁻¹ produces the ciphertext. IP and IP⁻¹ add no security (they are public and fixed); they simply reflected how 1970s hardware loaded data.
Reading an S-box. Each S-box is a 4 × 16 table of the numbers 0–15. For a 6-bit input b₁b₂b₃b₄b₅b₆, the two outer bits b₁b₆ select the row (0–3) and the four middle bits b₂b₃b₄b₅ select the column (0–15). The table entry, written as 4 bits, is the output.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
row 0: 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
row 1: 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
row 2: 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
row 3: 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
Input 011011: row = b1b6 = 01 = 1, column = b2..b5 = 1101 = 13
S1[1][13] = 5 -> output 0101Decryption runs exactly the same algorithm on the ciphertext with the subkeys applied in reverse order, K₁₆ first and K₁ last. This follows directly from the Feistel structure: each round undoes the matching encryption round without inverting F.
The obvious fix — encrypt twice with two independent keys, C = E(K2, E(K1, P)) — seems to give a 112-bit key. It does not, because of the meet-in-the-middle attack (Diffie and Hellman, 1977).
Why encrypt–decrypt–encrypt? If all three keys are equal, the middle decryption cancels the first encryption and 3DES becomes ordinary DES. One 3DES implementation can therefore talk to old single-DES equipment. 3DES (also called TDEA) was standardised in ANSI X9.52 (1998) and FIPS 46-3 (1999).
3DES runs 48 DES rounds, so it is three times slower than DES, and it keeps DES's 64-bit block. With a 64-bit block, a birthday-type collision is expected after about 2³² blocks (32 GB), which the Sweet32 attack (2016) exploited against long HTTPS and VPN sessions. NIST therefore limited the data per key and disallowed 3DES for encryption after 2023 — AES replaces it.
In 1997 NIST launched an open, worldwide competition for a successor to DES. Fifteen candidates entered; five reached the final round — MARS (IBM), RC6 (RSA Laboratories), Rijndael (Joan Daemen and Vincent Rijmen, Belgium), Serpent (Anderson, Biham, Knudsen) and Twofish (Schneier and colleagues). Rijndael won in October 2000 for its combination of security, speed and small memory needs, and was published as the Advanced Encryption Standard, FIPS-197, in November 2001.
| Variant | Key length | Key words Nk | Rounds Nr | Round keys (Nr + 1) | Expanded key |
|---|---|---|---|---|---|
| AES-128 | 128 bits | 4 | 10 | 11 | 44 words = 176 bytes |
| AES-192 | 192 bits | 6 | 12 | 13 | 52 words = 208 bytes |
| AES-256 | 256 bits | 8 | 14 | 15 | 60 words = 240 bytes |
AES works on a state of 16 bytes arranged as a 4 × 4 matrix, filled column by column from the input block. It is a substitution–permutation network, not a Feistel cipher: every round transforms the entire state.
Decryption applies the inverse steps — InvShiftRows, InvSubBytes, AddRoundKey and InvMixColumns — with the round keys in reverse order. Because XOR is its own inverse, AddRoundKey is the same in both directions.
AES treats each byte as an element of the finite field GF(2⁸): a polynomial of degree below 8 with coefficients 0 or 1. Adding two bytes is a plain XOR. Multiplying them is polynomial multiplication reduced modulo the irreducible polynomial m(x) = x⁸ + x⁴ + x³ + x + 1 (hexadecimal 11B). Multiplying by 2 (the operation called xtime) is a left shift, followed by an XOR with 1B if a bit fell off the top.
| Row | Before | Rotate left by | After |
|---|---|---|---|
| 0 | 00 04 08 0C | 0 | 00 04 08 0C |
| 1 | 01 05 09 0D | 1 | 05 09 0D 01 |
| 2 | 02 06 0A 0E | 2 | 0A 0E 02 06 |
| 3 | 03 07 0B 0F | 3 | 0F 03 07 0B |
The International Data Encryption Algorithm (IDEA) was designed by Xuejia Lai and James Massey at ETH Zürich. It grew out of their 1990 PES design, strengthened against differential cryptanalysis and published in 1991 (as IPES), and renamed IDEA in 1992. It became famous as the bulk cipher of PGP (Pretty Good Privacy) version 2; its patents expired in 2011–2012.
| Parameter | IDEA value |
|---|---|
| Block size | 64 bits, handled as four 16-bit sub-blocks X₁ … X₄ |
| Key size | 128 bits |
| Rounds | 8 identical rounds + an output transformation (a half round) — often written 8.5 |
| Subkeys | 52 subkeys of 16 bits: 6 per round × 8 + 4 for the output transformation |
| Key schedule | Take eight 16-bit subkeys from the key, rotate the 128-bit key left by 25 bits, take the next eight, and repeat |
| Structure | Lai–Massey design (neither Feistel nor SPN): mixing of incompatible algebraic operations |
No two of these operations distribute over each other or associate with each other, so an attacker cannot simplify a chain of them algebraically. This mixing replaces the S-boxes of DES as the source of confusion, while a multiply–add structure in each round spreads every input bit across all outputs (diffusion). Decryption uses the same structure with the multiplicative and additive inverses of the subkeys, taken in reverse order.
| Cipher | Year / designer | Block (bits) | Key (bits) | Rounds | Structure | Status |
|---|---|---|---|---|---|---|
| DES | 1977, IBM / NBS | 64 | 56 | 16 | Feistel | Broken by brute force; withdrawn 2005 |
| 3DES (TDEA) | 1998–99, ANSI / NIST | 64 | 112 or 168 | 48 | Three DES passes (EDE) | Legacy; disallowed for encryption after 2023 |
| AES | 2001, Daemen & Rijmen | 128 | 128 / 192 / 256 | 10 / 12 / 14 | SPN | Current worldwide standard |
| IDEA | 1991, Lai & Massey | 64 | 128 | 8 + output transform | Lai–Massey (mixed groups) | Unbroken in practice; 64-bit block limits use |
| Blowfish | 1993, Bruce Schneier | 64 | 32 – 448 | 16 | Feistel, key-dependent S-boxes | Superseded; lives on in bcrypt |
| Twofish | 1998, Schneier et al. | 128 | 128 / 192 / 256 | 16 | Feistel | AES finalist; unbroken |
| RC5 | 1994, Ron Rivest | 32 / 64 / 128 | 0 – 2,040 | 0 – 255 (chosen) | Feistel-like, data-dependent rotations | Parameterised, e.g. RC5-32/12/16 |
Try the problem first, then reveal the working one step at a time.
Using the S1 table in the section above, find the 4-bit outputs of S1 for the 6-bit inputs (a) 011011 and (b) 100110.
A toy cipher uses the 8-bit initial permutation IP = 2 4 6 8 3 5 1 7 (output bit i is input bit IP[i]). (a) Apply IP to P = 10101010. (b) Find the inverse permutation IP⁻¹ and check that it restores P.
An attacker holds two known plaintext–ciphertext pairs for double DES, C = E(K2, E(K1, P)). Estimate the work and memory of a meet-in-the-middle attack and compare with brute force on the 112-bit key.
Compute {57} • {13} in the AES field GF(2⁸) using repeated xtime (multiply by {02}).
Find the S1 outputs for the 6-bit inputs 101010 and 111111.
IDEA arithmetic on 16-bit words: compute (a) 0x0000 ⊙ 0x0002 (multiplication mod 2¹⁶ + 1), (b) 0xFFFF ⊞ 0x0002 (addition mod 2¹⁶), (c) 0xFFFF ⊕ 0x0002, (d) 0x0100 ⊙ 0x0100. Also state how many key bits the full subkey schedule supplies.
For AES-192 and AES-256 give the number of rounds, the number of round keys and the size of the expanded key. How many S-box lookups does SubBytes make while encrypting one block with AES-128 (ignore key expansion)?
A toy Feistel cipher has 4-bit halves, two rounds and round function F(R, K) = R ⊕ K. With L₀ = 1011, R₀ = 0110, K₁ = 1100 and K₂ = 0101, encrypt the block, then decrypt the result to show that you get L₀R₀ back.
Apply ShiftRows to the state whose rows are r0 = A0 A1 A2 A3, r1 = B0 B1 B2 B3, r2 = C0 C1 C2 C3, r3 = D0 D1 D2 D3. Which original column do the four bytes of the new column 0 come from?
12 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.