Encryption is the process of converting plaintext (readable data) into ciphertext (scrambled, unreadable data) using an algorithm and a key. Only someone with the correct key can decrypt it back to readable form. The Edexcel 4CP0 specification requires knowledge of four ciphers.
The Caesar cipher is a substitution cipher where each letter in the plaintext is shifted a fixed number of positions along the alphabet. The shift amount is the key.
Example: Key = 3 (each letter shifted 3 places forward)
Weakness: Only 25 possible keys — easy to crack by brute force (trying all shifts).
The Vigenère cipher uses a keyword instead of a single shift. Each letter of the plaintext is shifted by the value of the corresponding letter in the keyword (repeated). This makes it much harder to crack than Caesar.
Example: Keyword = KEY, Plaintext = HELLO
(K=10, E=4, Y=24 — count from A=0). HELLO → RIJVS
Strength: The same letter can encrypt to different ciphertext letters (e.g. both L's above become different letters), making frequency analysis harder.
The Pigpen cipher is a substitution cipher that replaces each letter with a symbol based on a grid pattern. Letters are placed in two grids (a plain grid and a dotted grid), and the shape of the section containing the letter becomes the symbol.
Each symbol looks like the portion of the grid surrounding the letter, with or without a dot. Used historically by Freemasons.
The Rail Fence cipher is a transposition cipher — letters are rearranged rather than substituted. The plaintext is written diagonally across a number of "rails" (rows), then read off row by row to produce the ciphertext.
Example: 2 rails, Plaintext = HELLOWORLD
| Cipher | Type | Key | Strength |
|---|---|---|---|
| Caesar | Substitution | Single shift (1–25) | Very weak — only 25 keys |
| Vigenère | Polyalphabetic substitution | Keyword | Stronger — multiple shifts |
| Pigpen | Substitution (symbol) | Fixed grid | Weak — same letter always same symbol |
| Rail Fence | Transposition | Number of rails | Weak — letters unchanged, just reordered |