Caesar Cipher

What is the Caesar Cipher?

The Caesar Cipher is a very simple cipher developed long ago by Caesar and his army as the name suggests.

The Caesar Cipher is very simple, requiring only a message and a number from 1 to 26 as the key. Based on the key, the message is shifted that many letters.

Caesar Cipher example

Let's take an original message "hello world" with a key of 4.

Each letter in the message would shift 4 places, with h becoming l, as it goes h-i-j-k-l, e becomes i, l becomes p, etc.

After encrypting the full message, it results in "lipps asvph"

Caesar Cipher example with a plaintext of hello and a key of 3

This example has a key of 3

Caesar Cipher decryption

Decrypting the Caesar Cipher is very simple, as it merely requires shifting the message back based on the key.

For example, with a ciphertext of "lipps asvph" and a key of 4, you would shift back 4 keys, going l-k-j-i-h, and so on until you get back the original message "hello world"

Problems with the Caesar Cipher

Without online tools, longer messages can take a while to encrypt or decrypt even with the key.

However, the biggest issue with the Caesar Cipher is the lack of security. Especially with a computer, it can be exeptionally easy to crack with brute force, only requiring 26 attempts (realistically only 25, as a key of 26 would result in the original message)

Storing important information with the Caesar Cipher is a major security risk, which is why it is rarely used today, and when it is used the information it's encrypting is rarely important.

Additionally, cracking the Caesar Cipher can be even easier using letter frequency anylysis, as few one-sentence messages have 5 q's

Letter frequency anylysis is the process of observing which letters appear more often in the ciphertext and assuming those correspond with common letters in the english alphabet.

If a short message does have 5 q's, it is likely those q's are e's in plaintext, meaning the key is 12.

While the most common letter does vary by message, most messages have the same few letters as the most common ones, and the longer the message, the more effective letter frequency anylysis is.

Why I like the Caesar Cipher

The Caesar Cipher is very easy to understand and is a great introduction to ciphers, a rabbit hole that goes deeper than I could have ever imagined.

It can also be fun to mess around with the Caesar Cipher, such as when we played the game where we tried to decode a message with or without the key (depending on your role).

But the Caesar Cipher is only one way to relay information, so if you want to see another...

Want More?
Return Home