History of ciphers · Overview

The Caesar cipher: shifting letters to hide a message

The most famous cipher of antiquity: how the three-letter shift works, why it breaks in seconds and what it still teaches today.

The Caesar cipher is a substitution cipher in which every letter of the message is replaced by the letter a fixed number of positions further along the alphabet. With a shift of three, A becomes D, B becomes E, and so on to the end of the alphabet, where you start again from the beginning: X becomes A, Y becomes B, Z becomes C.

It bears the name of Julius Caesar because the historian Suetonius tells us the general used it in confidential correspondence. It is extremely simple, and that is precisely why it has become the first example in every cryptography lesson: it contains in miniature all the fundamental concepts — plaintext, ciphertext, algorithm, key — and shows clearly why a key that is too small protects nothing.

3positions of shift used by Julius Caesar, according to Suetonius
25useful keys on a 26-letter alphabet
< 1 sthe time a computer needs to try them all

The ingredients of every cipher

Plaintext
The original, readable message: VENI VIDI VICI.
Algorithm
The general rule: move every letter forward in the alphabet.
Key
The secret detail that makes the encryption unique: by how many positions to shift.
Ciphertext
The result to transmit: with key 3, YHQL YLGL YLFL.

The distinction between algorithm and key is the most important idea the Caesar cipher hands down to modern cryptography: the method may be known to everyone, and security must depend only on the key. Here the key has just 25 useful values, and that is its fatal limit.

The pages of this topic cover the history, the step-by-step mechanism, a worked example, the mathematics, the attacks, today’s uses and an exercise to solve by hand. You can also try encryption with the interactive wheel on the home page.

↑