Cryptography can protect availability.
- Confidentiality and integrity only.
Terminology and Kerckhoffs’s principle, how ciphers are classified, the classical ciphers you must compute by hand (Caesar, keyword, Playfair, Vigenère, one-time pad, Hill, columnar transposition), block ciphers and padding, DES/3DES/AES, the modes (ECB, CBC, CFB, OFB, CTR) and the attacks. Every major exam had a cipher, a padding count and a modes figure from this deck.
Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.
Tip Hand-cipher rules: CAESAR C = (P + k) mod 26 · VIGENÈRE add the repeated key letter (subtract to decrypt) · PLAYFAIR pairs: same row → right, same column → below, rectangle → own row, other letter’s column; X between doubles · HILL row vector × K mod 26, decrypt with K⁻¹ (det must be coprime with 26) · TRANSPOSITION write in rows, read columns in key order.
Encryption/decryption → foundations → classical ciphers → block ciphers → modes → attacks.
Encryption in a nutshell: plaintext + key → ciphertext → (key) → plaintext.
Notation: C = E_K(P), P = D_K(C).
Cryptography can protect availability.
Kerckhoffs’s principle says the security of a cryptosystem should depend only on:
Proof that decryption recovers P.
Symmetric needs: efficient E and D, and the ciphertext must be hard to invert without the key. Problem: secure key distribution.
MCQ · problem with symmetric encryption = key distribution
D · why symmetric is preferred for bulk data
The classic problem with symmetric encryption is:
Why is symmetric encryption preferred for large amounts of data? (Major C)
It uses one shared key and simple, fast operations (substitution, permutation, XOR), so it is far faster and lighter than asymmetric algorithms, which do heavy maths on huge numbers. Asymmetric is used only to exchange the symmetric key or to sign (hybrid encryption).
Caesar: shift every letter by k: C = (P + k) mod 26.
Tip Hand-cipher rules: CAESAR C = (P + k) mod 26 · VIGENÈRE add the repeated key letter (subtract to decrypt) · PLAYFAIR pairs: same row → right, same column → below, rectangle → own row, other letter’s column; X between doubles · HILL row vector × K mod 26, decrypt with K⁻¹ (det must be coprime with 26) · TRANSPOSITION write in rows, read columns in key order.
A · find the Caesar key
Plaintext GLOBAL… becomes QVYLKV…. What is the Caesar key?
Caesar with shift 3 encrypts HELLO as:
ROT13; a general substitution cipher has 26! keys.
Monoalphabetic ciphers fall to frequency analysis → encrypt pairs of letters (Playfair).
Playfair 5×5 matrix: keyword letters (no repeats), then the remaining letters; I/J share a cell.
Rules: pairs; X between doubled letters; same row → right; same column → below; rectangle → own row, other letter’s column.
Tip Hand-cipher rules: CAESAR C = (P + k) mod 26 · VIGENÈRE add the repeated key letter (subtract to decrypt) · PLAYFAIR pairs: same row → right, same column → below, rectangle → own row, other letter’s column; X between doubles · HILL row vector × K mod 26, decrypt with K⁻¹ (det must be coprime with 26) · TRANSPOSITION write in rows, read columns in key order.
B · Playfair COMMITTEES with EFFECTIVENESS
A · Playfair decryption
Related question: B · Playfair pairs
Encrypt COMMITTEES with Playfair, keyword EFFECTIVENESS (I/J together). (Major B)
Matrix rows: E F C T I / V N S A B / D G H K L / M O P Q R / U W X Y Z. Pairs: CO MX MI TX TE ES → FP PU RE CY IF CV.
In Playfair, two letters in the same row are replaced by:
HELLO → HE LX LO.
In Playfair, what does cryptanalysis depend on? (Major C)
Recovering the 5×5 key square built from the keyword, usually through digram frequency analysis.
C · decrypt with key RIYADH
MCQ · Caesar with a keyword = Vigenère
An advanced Caesar cipher that shifts each letter by a keyword letter is:
Decrypt CMRUVLERMYOLRX with Vigenère key RIYADH. (Major B)
Subtract the repeated key RIYADHRIYADHRI letter by letter: LETUSENJOYLEAP (“let us enjoy LEAP”).
One-time pad (Vernam/Mauborgne 1917): a truly random key as long as the message, used once → unbreakable.
Which cipher is theoretically unbreakable?
One-time pad example.
Hill (1929): m letters at a time as a vector, multiplied by an m × m key matrix mod 26.
C · Hill encrypt HELP
B · Hill key suitability and decryption
Encrypt HE with a Hill key K = [[3, 3], [2, 5]] using the row approach. (Major A)
HE = (7, 4). (7, 4) × K = (7·3 + 4·2, 7·3 + 4·5) = (29, 41) mod 26 = (3, 15) → DP.
Any 2 × 2 matrix can be used as a Hill cipher key.
Hill example.
Letter numbering A = 0 … Z = 25.
Transposition keeps the letters but changes their positions: write in rows, permute/read columns by the key.
B · columnar transposition
A cipher that keeps the letters but rearranges their positions is a:
Transposition example.
Example.
Example.
Example.
D · blocks and padding for “Incomprehensibilities”
blocks and padding, b = 64
b = 128 bits. Plaintext “Incomprehensibilities”. How many blocks and how many padded bits? (Major A)
21 characters = 21 bytes. A block holds 16 bytes → 2 blocks (32 bytes). Padding = 32 − 21 = 11 bytes = 88 bits.
b = 64 bits, plaintext of 29 bytes. How many blocks?
DES: IBM, adopted 1977, 56-bit key, 64-bit blocks; now broken by brute force.
3DES: three DES passes with three keys: C = E_K3(D_K2(E_K1(P))).
3DES decryption reverses it: P = D_K1(E_K2(D_K3(C))).
MCQ · 3DES decryption order
A · 3DES with K1≠K2≠K3
3DES decryption order is:
AES uses a block size of:
A mode describes how a block cipher handles a sequence of blocks. ECB: each block alone (identical blocks → identical ciphertext).
Tip Modes: ECB C=E(P) · CBC C[i]=E(P[i] ⊕ C[i−1]), C[−1]=IV · CFB C[i]=E(C[i−1]) ⊕ P[i] · OFB keystream V[i]=E(V[i−1]) · CTR keystream E(counter).
D · identify the mode and write P[2]
D · identify the mode and write C[2]
In CBC, write the decryption function for P[2]. (Major A)
P[2] = D_K(C[2]) ⊕ C[1] (with C[−1] = IV for the first block).
Which mode XORs each plaintext block with the previous ciphertext block before encryption?
A · pick the CFB figure
C[i] = E_K(C[i−1]) ⊕ P[i] describes:
OFB: keystream from repeatedly encrypting the IV; C[i] = V[i] ⊕ P[i].
An attacker who can get any plaintext of their choice encrypted is performing a:
Brute force: try every key; effort grows with key size.
End of chapter.
Seen again Ch 6.1, slide 3: Asymmetric cryptography