Security FIELD NOTES · 5 MIN READ
Classical Ciphers: Caesar, ROT13, Atbash — and How Vigenère Beat Them All
How the classical ciphers work: Caesar shifts, ROT13 and Atbash as special cases, the frequency analysis that breaks them all, and the moving Vigenère key that stalled codebreakers.
Before computers, secrecy meant moving letters around a 26-letter alphabet — and for two thousand years that was the state of the art. Caesar, ROT13, and Atbash are the ancestors, Vigenère the long-reigning champion, and the story of how each one fell is really the story of one idea: language leaves fingerprints, and any cipher that preserves them is already half-broken.
Caesar: shift the alphabet, wrap around
Julius Caesar's method is a fixed rotation of the alphabet by a secret number. With shift 3, every letter moves three places forward and wraps at the end — hello becomes khoor, and z wraps around to c. Decryption is the same rotation backwards. The wraparound is why implementations compute the shift modulo 26: a shift of 29 is a shift of 3, and decrypting with shift 3 is encrypting with shift 23. Only 25 shifts actually change anything (shift 0 is the plaintext itself), which is the cipher's fatal flaw: the entire keyspace fits on one line of paper, and an attacker simply tries every rotation until words appear.
ROT13 and Atbash: fixed keyholes
Two famous ciphers are Caesar in special cases. ROT13 is Caesar with shift 13 — exactly half the alphabet, which makes it its own inverse: applying it twice returns the original text, so hello becomes uryyb and uryyb becomes hello with the same operation. With no key to manage, it became internet culture's way to hide spoilers and punchlines — protection against casual eyes, never against an adversary. Atbash is older still: a reflection that swaps the alphabet end to end, a↔z, b↔y, c↔x. It turns hello into svool and is likewise self-inverse. Neither has a key at all — once you recognize the transformation, it is as good as plaintext, which is the point: these are obfuscation, not security.
Why every letter-swap cipher falls: frequency analysis
All three ciphers above are monoalphabetic: one plaintext letter always maps to one ciphertext letter. That consistency is a fingerprint. English text has a rigid letter diet — e leads at roughly 12.7% of letters, followed by t, a, and o — and a substitution cipher preserves those proportions, just wearing different names. The most common ciphertext letter is therefore a good bet for e, and repeated patterns help further: attack encrypts to zggzxp under Atbash, and that doubled letter in the middle screams "double letter" — codebreakers hunt words like letter, coffee, and summer. Short texts resist this attack; give a cryptanalyst a paragraph and the cipher is dead in minutes. You can watch the fingerprint directly with a letter frequency counter.
Vigenère: a shift that moves
The fix that held for three centuries was to stop using one shift. The Vigenère cipher uses a keyword, and each letter of the keyword selects the shift for the plaintext letter above it. Encrypting HELLO with the key KEY: K shifts H by 10 to R, E shifts E by 4 to I, Y shifts L by 24 (with wraparound) to J, then the key cycles back — K shifts L to V, E shifts O to S — giving RIJVS. The same plaintext letter no longer maps to the same ciphertext letter, so the frequency fingerprint smears across the text. Implementations apply the key only to letters, leaving spaces and punctuation untouched, which is convenient for readability and, as we will see, generous to the attacker. For generations the cipher was known as le chiffre indéchiffrable — the indecipherable cipher.
How Vigenère fell: find the key length, then it is Caesar again
The smear is real but periodic, and periodicity is exploitable. Because the keyword cycles, a letter encrypted at positions 1, 6, and 11 was shifted by the same key letter — so ciphertext letters that share a position modulo the key length form a stream that is itself a Caesar cipher. The attack has two steps. First, recover the key length: look for repeated ciphertext strings (they appear where the same plaintext word aligned with the same key slice) and take the distances between them — the key length divides those distances, a method named for Kasiski. Second, split the ciphertext into that many streams, one per key position, and run plain frequency analysis on each to recover one key letter at a time. A key of length 6 is six easy Caesars, not one hard cipher — and a modern computer finishes the job with a brute-force sweep over 26k candidates for any plausible k.
What they are good for today
Classical ciphers teach the central lesson of cryptanalysis — structure leaks, and keys must be as long and as unpredictable as the message — but they belong in puzzles, classrooms, and escape rooms, not in protecting anything. Every cipher on this page is trivially reversible by anyone with the algorithm and patience, which is the opposite of the design goal of real cryptography: systems where security lives entirely in the key, and the algorithm is public. (One-way hashes are a different beast entirely — How Hashing Works explains why digesting data is not the same as encrypting it.) For language fingerprints in a friendlier context, What Word Frequency Reveals shows the same frequency mathematics doing honest work in editing.
Try it yourself
Encrypt hello with a shift of 3 in the Caesar Cipher and confirm you get khoor, then flip the direction to decrypt. Check ROT13's self-inverse trick in the ROT13 Encoder & Decoder — apply it twice — and watch hello become svool in the Atbash Cipher. Encrypt HELLO with the key KEY in the Vigenère Cipher to reproduce RIJVS, then prove the attack: paste the output into the Letter Frequency Counter and watch the e/t/a fingerprint surface.