It is said that Julius Caesar used the simple substitution cipher named after him to convey secure messages to his military commanders and emissaries. Secrets of Encryption - first article in a series

Caesar cipher, also known as Caesar's code or Caesar shift, is one of the oldest known ciphers. Its use was attributed to Julius Caesar, the famous Roman general and politician who lived in the first century BC. He rose to power during a civil war that he himself had initiated to overthrow the Roman Republic, expanded the Roman Empire, conducted extensive reforms and was eventually assassinated. During his reign and command he used this cipher to securely communicate with his military commanders. An example for this can be found in his book “The Gallic Wars”, where it is stated that Caesar sent a message to the Roman statesman Cicero, while under siege during the conquest of Gaul (a region in present-day France) and considering surrender. The message was encrypted using Caesar shift and was attached to a spear thrown by a messenger over the besieged city’s walls.

History credits him with the first use of a substitution cipher to communicate with his military commanders. Julius Caesar | Source: New York Public Library, Science Photo Library

## The Cipher

In cryptography, Caesar shift is considered a simple cipher. Basically, it consists of a substitution of each letter in the alphabet with a letter found at a fixed offset from it. For example, in a Caesar shift of 1, each letter is replaced with the letter that follows it in the alphabet. The letter A will be substituted with the letter B, the letter B with C and the letter Z will be substituted with the letter A. In a Caesar shift of 2, each letter is substituted by a letter found two letters from it, meaning that the letter A will be substituted with the letter C, the letter Y with A, and the letter Z will be substituted with B.

In its simplest form, Caesar cipher has 25 possible encryption options using the English alphabet, which has 26 letters. The 26th option is a shift of 0, meaning the original unencrypted text. For example, suppose we would like to encrypt the phrase “Hello, cryptography!” using a Caesar shift of 3. To do this we must first compile an encryption table in which each letter in the alphabet (upper line) is shifted three places forward (bottom line):

After omitting the punctuation marks, the encrypted message we obtain is: “Ebiil zovmqldoxmev”

At first glance this text seems meaningless. A person coming across this collection of letters will comprehend nothing from it, unless he or she is in possession of an encryption table or is familiar with such deciphering methods, resulting in the intended effec.

Deciphering

How can you decipher a text encrypted by Caesar cipher? If the letter is addressed to you, it is likely that you know that the message was encrypted using Caesar cipher and what shift was used by the sender. Thus, you will be able to easily compile a decryption table similar to the one used for encryption, only shifted backwards, instead of forwards. That is how you can decipher the text.

But what can you do if the message was not addressed to you? What, for example, could a Gallic military commander upon intercepting a message intended for Cicero in the besieged city? There must be some very valuable information encrypted in the message! Suppose you assume, or know, that the Roman military uses the Caesar cipher for encryption. How can you decipher it?

There are two main approaches to deciphering such a cipher. The simplest method is deciphering using brute force, that is, testing by trial and error of all possible encryption options, until obtaining legible text. In Caesar cipher there are only 25 shift options, thus it should not take a very long time to decipher a message sent by Julius Caesar sent to the besieged soldiers. Another, more advanced method, is frequency analysis - one of the most useful methods of cracking simple ciphers, which relies on statistical methods. We will deal with this method in the next article in this series.

In the meantime, try to decipher on your own a message written using Caesar cipher!