Caesar Cipher
"The simplest cipher — and the most famous failure in history."
Exhaustive shift search; frequency evidence helps rank candidates.
Why This Matters
Suetonius records Caesar’s use of a letter shift. The modern A–Z demonstration makes modular substitution easy to inspect; it does not establish the invention date of substitution encryption.
Julius Caesar used this cipher to communicate with his generals during the Gallic Wars. Suetonius records it in The Twelve Caesars (c. 121 AD): "If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out."
Suetonius describes Caesar’s shift of three. His account of Augustus describes a different convention, including AA for Z rather than a modern wraparound alphabet. This exhibit’s fixed 26-letter model should not be mistaken for a facsimile of Roman correspondence.
ROT13 — the modern variant — applies a shift of 13. Because 13+13=26, ROT13 is its own inverse: applying it twice returns the original text. It's still used in online forums to hide spoilers.
Each letter is replaced by the letter a fixed number of positions down the alphabet. The shift wraps around using modular arithmetic:
Encrypt: C = (P + shift) mod 26 Decrypt: P = (C − shift + 26) mod 26 Example (shift = 3): A → D N → Q B → E O → R Z → C (wrap-around)
Encryption steps:
- Convert each plaintext letter to a number (A=0, B=1 … Z=25)
- Add the shift value and take modulo 26
- Convert the result back to a letter
- Non-alphabetic characters (spaces, punctuation) pass through unchanged
Shift Diagram (shift = 3)
Long English samples often have E among their most frequent letters, but individual messages may differ greatly. A Caesar shift preserves the observed letter counts. Treating the most common ciphertext letter as E proposes a key; other shifts and the resulting language must still be checked.
The entire keyspace is just 25 shifts. There are only 25 nonidentity shifts to test. Recognizing the intended plaintext can still require context. This is the simplest form of exhaustive key search — a technique that scales to modern ciphers but requires vastly more computation.
Why it fails fundamentally: there are only 25 nonidentity shifts on A–Z (26 including leaving the text unchanged). AES-256 has 2²⁵⁶ possible keys. The difference illustrates why a tiny keyspace is vulnerable, but keyspace size alone never proves a cipher secure.
| Caesar Concept | Evolved Into |
|---|---|
| Letter substitution | AES combines nonlinear byte substitution with key addition and diffusion; a substitution table alone preserves frequencies |
| Shift = key | Symmetric key concept — both parties share a secret parameter |
| 25-key space | Generic search of a uniform AES-256 key takes about 2²⁵⁵ trials on average |
| Frequency leak | Diffusion in block-cipher design spreads input changes; this is not a property of every cryptographic construction |
Shannon's confusion: Claude Shannon (1949) defined "confusion" as making the relationship between key and ciphertext as complex as possible. Caesar’s relation C = P + k (mod 26) is easy to invert for each candidate key. “Zero confusion” is not a numerical security measurement. AES combines nonlinear substitution with other round operations; its strength cannot be attributed to an S-box alone.
The Disney series Gravity Falls popularized a generation of Caesar-solvers by hiding end-credit clues in simple shifts and layered substitutions. It is a modern example of why classical ciphers remain pedagogically powerful: fast to learn, satisfying to break, and instantly reusable in storytelling.
Paste any ciphertext to see letter frequencies. Gold bars reveal the pattern — find the tallest bar to guess the shift.
Paste any Caesar ciphertext. The tool tries all 25 shifts and ranks each candidate by how close its letter frequencies are to standard English (chi-squared distance — lower is better).
Press Break Cipher to score all 25 candidate decryptions and rank them by English-likelihood.
What you just witnessed. The tool tries all 25 nonidentity shifts and ranks them by an English letter-frequency score. The top row is a hypothesis, not a guaranteed plaintext: short or unusual messages can rank incorrectly. Exhaustive search covers the small shift space, while recognizing the right message still needs context.
Can you find the shift?