Things Have History

cryptography

The Caesar cipher, or how a shift of three kept Rome's orders from Gallic hands

Listen

In the winter of 54 BCE, a javelin sailed over the walls of a besieged Roman camp in the territory of the Nervii. Attached to its shaft was a letter. The camp, commanded by Quintus Tullius Cicero — brother of the orator — was completely encircled; ordinary messengers had already been killed trying to get through. The missile landed near a tower and went unnoticed for two days before a soldier spotted it, pulled it down, and brought it to Cicero. He read it aloud to the assembled cohort. The men cheered: Caesar was two days’ march away. The letter had been written in Greek characters so that any Gaul who intercepted it could not read it.

Julius Caesar governed a vast and hostile territory through written orders. In the Gallic Wars alone, his legions operated across a dozen theaters simultaneously, each legate needing instructions from a proconsul who might be three days’ march away. The information on those roads was strategically lethal if captured. Caesar’s solution was both elegant and cheap: take the Latin alphabet — J and U not yet having separated from I and V — and shift every letter three positions forward. A becomes D. B becomes E. X wraps back to A.

Suetonius, writing in Lives of the Twelve Caesars around 121 CE, records the method precisely: “If he had anything confidential to say, he wrote it in cipher — by so changing the order of the letters of the alphabet that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others.” The technique has a name Caesar himself never used: per notas scripsit — he wrote it in marks.

Caesar’s heir took the idea and ran with it. Augustus, the first emperor, used the same cipher but with a shift of one: A became B. He left the method in writing, which his adoptive father conspicuously had not. Two men, two shifts, same principle — the oldest recorded exercise in key management. The algorithm is public; the number is the secret.

The Caesar cipher is not, by any modern measure, secure. Al-Kindi of Baghdad would demolish it around 850 CE by counting letters: in any language, some letters appear far more frequently than others, and a shift doesn’t change that fact. Disguise A as D all you like — D will now cluster wherever A did, and its frequency will betray it. But Al-Kindi’s attack was still eight centuries in the future when Caesar was fighting the Nervii. By then, the important idea had already escaped: that a message could be transformed by a key, and that security lived in the key rather than the method.

Al-Kindi would find the flaw in the number. The idea of having a number at all — that was not flawed.

Sources