From Caesar to Enigma: A Beginner's Guide to Classical Ciphers
Julius Caesar reportedly pushed every letter of his orders three places down the alphabet, turning DAWN into GDZQ. Centuries later, a German operator pressed a key on a machine whose rotors spun with each stroke and watched a lamp light up in place of a letter. Both are ciphers: rules for scrambling a message so only someone holding the right secret can read it. The distance between them is mostly a story about what happens when attackers learn to spot patterns — and that story is worth knowing, because the same lessons show up in modern encryption.
Substitution: Same Shape, Different Letters
A substitution cipher swaps each letter for another, keeping the order of the message intact. The Caesar shift is the simplest version. Number the alphabet from 0 to 25, pick a shift, and add it to every letter:
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
With a shift of three, ATTACK AT DAWN becomes DWWDFN DW GDZQ. That is easy to do in your head, which is exactly the problem: there are only 25 useful shifts, so anyone can try them all in a minute.
The fix is a monoalphabetic substitution — a scrambled alphabet instead of a shifted one, often built from a keyword. Write the keyword first, remove its repeated letters, then append the rest of the alphabet. With the keyword SILVER you get:
Cipher: SILVERABCDFGHJKMNOPQTUWXYZ
Now there are far too many possible alphabets to test by hand. But the letters still behave like ordinary English. In a long message, E stays the most common letter, T and A follow close behind, and the patterns of double letters (LL, SS, EE) and short words (the, and, of) survive the disguise. That is frequency analysis, and it cracks these ciphers without any computing power at all.
Shift the alphabet differently for each letter and the statistics blur. The Vigenère cipher does this with a repeating keyword. Using the key KEY (shifts of 10, 4, 24), the word MEET encrypts to WICD: M+10 is W, E+4 is I, E+24 wraps to C, T+10 is D. The same plaintext letter produces different ciphertext letters each time, so a simple frequency count reveals nothing. Break it, and you have to find the key length first — repeated chunks of ciphertext hint at it — then solve each shift position as its own small Caesar puzzle.
Transposition: Keep the Letters, Move Them Around
Transposition ciphers never change a letter. They rearrange it. A rail fence writes the message in a zigzag over two or more rows, then reads each row straight across.
Take MEET ME AT NOON, strip the spaces, and write it in two rows:
M E M A N O
E T E T O N
Reading row one then row two gives MEMANOETETON. To decrypt, count the letters, split the text back into rows of the right length, and read down the columns. Three or four rails make it harder, but never hard enough.
Columnar transposition is the stronger cousin. Choose a keyword, write the plaintext in rows beneath it, then read the columns in alphabetical order of the keyword letters. With the key FOUR (order: F, O, R, U) and the plaintext MEETMEATDAWN:
F O R U
M E E T
M E A T
D A W N
Column F reads MMD, column O reads EAW, column R reads TTN, column U reads EEA. The ciphertext is MMDEAWTTNEEA. Notice what did not change: the letter frequencies. A count of that ciphertext looks exactly like English, which tells a solver immediately that nothing was substituted — only shuffled. From there it is an anagram problem, solved by shuffling columns until words appear.
Rotor Machines: Substitution That Never Sits Still
Enigma, the German machine used in the Second World War, combined ideas from both families. Type a letter and the current passes through a plugboard, a set of wired rotors, a reflector, and back out through the rotors to a lamp. Crucially, at least one rotor turns with each keypress, so the internal wiring shifts constantly. Type the same letter twice and two different substitutions handle it.
Three design features made it beatable anyway.
- No letter ever encrypted to itself. The reflector guaranteed it, and codebreakers leaned on that fact constantly.
- Settings repeated. Operators reused rotor positions and plugboard arrangements, sometimes for whole days, giving analysts a fixed target.
- Cribs existed. Weather reports and standard greetings gave predictable phrases to test against the ciphertext.
Polish cryptanalysts reconstructed the machine's wiring before the war, and work at Bletchley Park later exploited cribs and mechanical searching to read traffic at scale. The lesson is not that Enigma was weak. It is that any cipher used by tired people on a schedule leaks.
Cracking a Classical Cipher: A Workflow
- Count letters. If the frequency profile looks like plain English, you are dealing with a transposition. If it looks flat or strange, suspect substitution.
- For substitution, mark the most common letters and map your first guesses — usually E, T, A, O, I, N.
- Hunt for repeats. Double letters and three-letter words such as the and and give away a lot with very little text.
- For transposition, write the ciphertext into a grid whose width divides the length, then read columns in different orders until phrases appear.
- Keep a running key alphabet on a separate sheet. Pencil, not pen — you will revise it many times.
Practising Without Risking Anything Real
These ciphers are excellent puzzles and terrible protection. A modern laptop exhausts the entire key space of a monoalphabetic substitution almost instantly, and no classical method survives a determined attacker with today's tools. Keep them for puzzle books, classroom exercises, and treasure hunts.
The practical habit worth building is the one every codebreaker used: write down what you know. Guess a word, note the letters it forces, and follow the consequences until a contradiction appears or the message opens. Start with a Caesar shift on a sentence you already know, then work up to a keyword alphabet and a columnar grid. By the time you solve your first Vigenère message on paper, the ideas behind modern cryptography — keys, key length, known plaintext, and the danger of patterns — will feel familiar rather than abstract.
Photo: cottonbro studio / Pexels




