You can hide a secret note.
You can hide a secret note. 
Imagine you want to send a secret note. 
This code is very easy to break. You can try every possible shift until the words make sense. This is called a brute force attack. People also use frequency analysis to solve it. This means they look at how often letters appear. 
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.
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. 
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. 
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. 
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.
A Caesar cipher is a method of encryption used to hide the meaning of a message. It is a type of monoalphabetic substitution cipher. In this system, every letter in a message is replaced by a different letter. This replacement happens by shifting the alphabet a fixed number of positions. This method is one of the simplest and most famous techniques in the field of cryptography.
To understand the mechanism, imagine two lines of alphabets aligned with one another. The first line contains the standard plain alphabet. The second line is the cipher alphabet, which is the plain alphabet shifted left or right by a specific number. This number is known as the shift parameter or the key. For example, a left shift of three replaces A with X, B with Y, and C with Z. To encrypt a message, a person looks up each letter in the plain line. They then write down the corresponding letter from the cipher line. 
Deciphering is the process of reversing this transformation. If the message was encrypted with a left shift of three, it is decrypted with a right shift of three. This process can also be described using modular arithmetic. First, letters are transformed into numbers where A is 0 and Z is 25. The encryption of a letter $x$ by a shift $n$ is calculated as $(x + n) \pmod{26}$. To decrypt, the formula is $(x - n) \pmod{26}$. If the result falls outside the 0 to 25 range, 26 is added or subtracted to keep it within bounds.
This method is named after Julius Caesar. According to the Roman historian Suetonius, Caesar used a shift of three to protect messages of military significance. His nephew, Augustus, also used a cipher. Augustus used a right shift of one, but he did not wrap the alphabet around to the beginning. While Caesar is the most famous user, other substitution ciphers existed earlier. The grammarian Aulus Gellius even suggested that Caesar used more complicated systems beyond this simple shift. 
Despite its history, the Caesar cipher is very easy to break in modern practice. One method is a brute force attack. Because there are only 25 possible shifts in the English alphabet, an attacker can simply try every single one. They look for the shift that produces meaningful text. Another method is frequency analysis. This relies on the fact that certain letters appear more often than others in a language. 
History shows that even when the cipher was known to be weak, it was still used. During World War I in 1915, the Russian army used it because it was easy for troops to master. However, German and Austrian cryptanalysts found it very easy to decrypt. In more recent history, the cipher has appeared in unexpected places. In 2006, the Mafia boss Bernardo Provenzano was captured partly because of a variation of the cipher. In 2011, a British Airways employee was convicted of terrorism offenses after using a Caesar cipher to discuss plots.
The Caesar cipher also serves as a building block for more advanced systems. The Vigenère cipher is a polyalphabetic substitution that uses a different Caesar shift for each position in the text. This shift is determined by a repeating keyword. If a keyword is as long as the message and is never reused, it becomes a one-time pad, which is impossible to break. Today, a version called ROT13 uses a shift of thirteen. It is often used on the internet to hide spoilers or joke punchlines, though it offers no real security.
🖼️ Images & Media (4)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
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.