Reference
The Caesar Cipher Explained
The Caesar cipher shifts every letter of a message a fixed number of places along the alphabet. With a shift of 3, A becomes D, B becomes E, and Z wraps around to C. It is named after Julius Caesar, who used it for military messages.
How to encode and decode
To encode, pick a shift from 1 to 25 and move each letter forward that many places, wrapping past Z back to A. To decode, move the same number of places backward, or shift by 26 minus your key.
Only letters change; spaces, digits and punctuation stay as they are. That means the spacing of the ciphertext still hints at word lengths, which is one reason the cipher is easy to break.
How the Caesar cipher is broken
There are only 25 possible shifts, so an attacker can simply try them all and look for readable text. This is called a brute-force attack and takes only moments by hand.
Even without trying every key, the most common letter in the ciphertext is likely to be a shifted E, the most common letter in English. That single clue often reveals the shift. This is why the cipher is a teaching tool, not real protection.
Frequently asked questions
What is a Caesar cipher with a shift of 3?
A shift of 3 moves each letter three places forward: A becomes D, B becomes E, and Z wraps to C. This is the shift Julius Caesar is said to have used.
How do you break a Caesar cipher without the key?
Try all 25 shifts and look for readable text, or find the most common letter and assume it is a shifted E. Both methods crack it in seconds.