What is the Caesar Cipher?
The Caesar Cipher is a substitution cipher, named after Julius Caesar who used it in his private correspondence. It is also known as the shift cipher, Caesar Code or shift code.
Despite the name it was not invented by Julius Caesar, other substitution ciphers were known to exist around that time. It offers no real protection in the modern age and can easily be broken by hand and more easily with a computer – because the letters are only shifted once, there are only 25 other combinations of letters to test. It is also broken with frequency analysis. However in the time of Julius Caesar many people were illiterate or could have mistaken it for another language.
The ciphers ease of use makes it fun to use in clues for treasure hunts and escape rooms. The Caesar Cipher can be used in conjunction with other ciphers to enhance encryption.
It works by substituting one letter (plain text) of the alphabet by another letter (cipher text) further along the alphabet line. The difference between the plain text letter and the cipher text letter is called the shift. For example, if plain text A becomes cipher text B then a shift of 1 has occurred.
Try out the Caesar Cipher encoder/decoder
Use the below JavaScript app to encrypt and decrypt your own messages! This also visualises the shift to see how the letters are substituted.
To encrypt
- Type your unencrypted message in the ‘Plain Text’ box.
- Select a shift by typing a number from -25 to 25 or clicking on the up/down arrows on the shift box.
- Review the output in the ‘Ciphertext’ box.
To decrypt
- Type your encrypted message in the ‘Plain Text’ box.
- Select the encryption key/shift by typing a number from -25 to 25 or clicking on the up/down arrows on the shift box.
- Review the output in the ‘Ciphertext’ box, this should be your new plain text message.
Caeser Cipher app
Original | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
Shifted |
Can you decode these messages?
U JXOHP QEB PMLQ
HIN UFF NLYUMOLY CM MCFPYL UHX AIFX
VGF ABG NOBHG GUR GERNFHER VGF NOBHG GUR UHAG
Feel free to use the Caesar Cipher encoder/decoder app above to try and work these out.
Other Caesar Cipher resources
Crypto Museum – https://www.cryptomuseum.com/crypto/caesar/cipher.htm
Practical Cryptography – http://practicalcryptography.com/ciphers/caesar-cipher/
Wikipedia – https://en.wikipedia.org/wiki/Caesar_cipher
Caesar cipher decryption tool – https://www.xarg.org/tools/caesar-cipher/