SLIDE 1 / 10
CSZone.co.uk
Click anywhere to advance · Arrow keys also work
AQA 7517 · Paper 2 · 4.5.6a

Caesar &
Vernam Ciphers

Classical encryption · Symmetric cryptography · Section 4.5

WHAT YOU'LL LEARN
Substitution ciphers · Caesar shift · Frequency analysis · Vernam one-time pad · Perfect secrecy
AQA SPEC LINK
4.5.6 — Encryption: Caesar cipher, Vernam cipher, one-time pad
Why Encryption?

Encryption & Cryptography

Encryption transforms plaintext into ciphertext that is unreadable without a key
Symmetric encryption — same key used to encrypt and decrypt
Two key concepts: confusion (obscure relationship between key and ciphertext) and diffusion (spread plaintext statistics through ciphertext)
AQA spec covers Caesar cipher (historic, weak) and Vernam cipher (theoretically perfect)
Caesar Cipher

The Caesar Cipher

A substitution cipher where each letter is shifted a fixed number of positions in the alphabet. Julius Caesar used a shift of 3.
Plaintext: A B C D E F G H I J K
Ciphertext: D E F G H I J K L M N

Shift = 3: A → D, B → E, Z → C (wraps)
Caesar Example

Encrypting & Decrypting

Encrypt "HELLO" with shift 3:
H→K, E→H, L→O, L→O, O→R
Ciphertext: KHOOR
Decrypt "KHOOR" with shift 3:
K→H, H→E, O→L, O→L, R→O
Plaintext: HELLO
Formula: Encrypt: (c + shift) mod 26 · Decrypt: (c − shift + 26) mod 26
Breaking Caesar

Why Caesar Cipher is Weak

Only 25 possible keys — brute force tries all shifts in seconds
Frequency analysis — in English, 'E' is most common (13%). Most frequent letter in ciphertext is likely 'E'
Letter patterns preserved — if 'T' encrypts to 'W', all T's become W's
Known-plaintext attack: if you know one word, you know the shift
Vernam Cipher

The Vernam Cipher (One-Time Pad)

Invented by Gilbert Vernam (1917). Uses a key as long as the plaintext
Each plaintext bit XORed with the corresponding key bit: C = P XOR K
Key must be: truly random, same length as plaintext, used only once, kept secret
Mathematically proven to be perfectly secret — ciphertext gives zero information about plaintext without the key
Vernam Example

XOR Encryption & Decryption

Plaintext key: H(72) I(73) = 01001000 01001001
One-time key: 01101001 11001010
XOR (cipher): 00100001 10000011
To decrypt: ciphertext XOR same key = plaintext
00100001 XOR 01101001 = 01001000 → 'H' ✓
XOR is its own inverse — decryption identical to encryption
Practical Problems

Why Vernam Isn't Used Everywhere

Key distribution — key must be securely shared before communication. As hard as the original problem!
Key length — key must be at least as long as all messages. For large files = impractical
True randomness — computer-generated "random" numbers are pseudo-random, not truly random
One-time use — reusing the key breaks perfect secrecy (WWII Lorenz cipher broken this way)
AQA Exam Style

Practice Question

AQA 7517 — Paper 2 Style
(a) Using a Caesar cipher with shift 4, encrypt the word "BYTE". [2]
(b) Give TWO reasons why the Caesar cipher is considered insecure. [2]
(c) A Vernam cipher uses the key 11010110 to encrypt the plaintext bit pattern 01001000. Show the ciphertext. [2]
(d) State ONE condition that must be met for the Vernam cipher to provide perfect secrecy. [1]
[7 marks]
2 marks
(a) B(1)+4=F, Y(24)+4=C(wraps), T(19)+4=X, E(4)+4=I → FCXI
2 marks
(b) Only 25 possible keys (brute force trivial) / frequency analysis exploits preserved letter frequencies
2 marks
(c) 11010110 XOR 01001000 = 10011110
1 mark
(d) Any one of: key must be truly random / key must be same length as plaintext / key must be used only once / key must be kept secret
Summary

Key Points to Remember

Caesar cipher — shift letters by fixed amount; 25 possible keys; broken by brute force/frequency analysis
Vernam cipher — XOR plaintext with key; theoretically unbreakable if conditions met
Decryption is identical to encryption in Vernam (XOR is its own inverse)
One-time pad conditions — truly random, same length, used once, kept secret
Both are symmetric — same key for encryption and decryption
🎉 Lesson complete — move to the quiz!