Nepedia
Back to Discover
Fluent Reader
🔢

Caesar cipher

math Maturity 11-13 Next article →

Imagine you want to send a secret message to a friend. You do not want anyone else to read it. You could use a special way to hide your words. This is called a Caesar cipher. It is a type of substitution cipher. This means you swap every letter for a new one. You pick a fixed number of spots to move down the alphabet.

Caesar cipher left shift of 3
Caesar cipher left shift of 3

For example, you might move every letter three spots to the left. This turns an A into a D. It turns a B into an E. This simple trick makes your message look like nonsense to others.

To use this code, you need a key. The key is the number of spots you shift the alphabet. You can imagine two lines of alphabets sitting one above the other. The top line is your plain message. The bottom line is your secret code. To encrypt, you find your letter on the top line. Then you write down the letter directly below it.

Confederate cipher disk
Confederate cipher disk

To read the secret message, you just do the opposite. You move the letters back the same number of spots. This is called deciphering. It is a very steady and predictable way to change text.

This method is named after the famous leader Julius Caesar. A Roman historian named Suetonius wrote about how Caesar used it. Caesar used a shift of three to protect important military messages. His nephew Augustus also used a secret code. Augustus used a shift of only one spot. However, Augustus did not wrap around to the start of the alphabet. The grammarian Aulus Gellius even mentioned that Caesar used more complicated systems too.

Bust of Julius Caesar from History of the World (1902)
Bust of Julius Caesar from History of the World (1902)

These old stories show how people have always valued secrets.

Even though it is old, the Caesar cipher is very easy to break. An attacker can use a brute force attack. This means they try every possible shift one by one. There are only 25 possible shifts in the English alphabet. They just keep trying until the words make sense. Another way to break it is called frequency analysis.

English letter frequency percentages
English letter frequency percentages

In English, some letters like E appear much more often than others. If you see a pattern in the letters, you can guess the shift. This makes the code very weak for modern use.

We still see versions of this idea in our world today. You might find secret decoder rings in a toy box. Some people use a version called ROT13 to hide spoilers online. This version shifts the alphabet by thirteen spots. It is also used in more complex schemes like the Vigenère cipher. In the 1915 era of World War I, the Russian army used it too. It was easy for soldiers to learn, even if it was easy to break. It shows how simple ideas can last for a very long time.

469 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (4)
File:Caesar cipher left shift of 3.svg
Caesar cipher left shift of 3.svg
File:Bust of Julius Caesar from History of the World (1902).png
Bust of Julius Caesar from History of the...
File:Confederate cipher disk.jpg
Confederate cipher disk.jpg
File:English letter frequency percentages.png
English letter frequency percentages.png
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.