Caesar cipher

cryptography
print Print
Please select which sections you would like to print:
verifiedCite
While every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions.
Select Citation Style
Share
Share to social media
URL
https://flykep.top/topic/Caesar-cipher
Feedback
Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login).
Thank you for your feedback

Our editors will review what you’ve submitted and determine whether to revise the article.

Also known as: Caesar shift cipher, shift cipher
Also called:
shift cipher or Caesar shift cipher
Related Topics:
substitution cipher
Top Questions

What is a Caesar cipher?

Who used the Caesar cipher historically?

How does the ROT13 cipher work?

What is a limitation of the Caesar cipher?

What is an alternative to the Caesar cipher?

Caesar cipher, simple substitution encryption technique in which each letter of the text to be encrypted is replaced by a letter a fixed number of positions away in the alphabet. For example, using a right letter shift of four, A would be replaced by E, and the word CIPHER would become GMTLIV. The technique is named after Julius Caesar, who used it in his letters. The simplicity of the Caesar cipher makes it a popular source for recreational cryptograms.

Origin

SuetoniusLives of the Caesars describes the substitution cipher used by Julius Caesar, in which he replaced each letter in a message with a letter three places down in the alphabet. For letters at the end of the alphabet, the cipher cycled back to the start of the alphabet.

In the original Caesar cipher, blanks were ignored, and uppercase and lowercase letters were treated the same. Augustus, Julius Caesar’s successor, found the method too complicated and simplified it by replacing each letter with the one right after it. Augustus’ cipher was not circular. Thus, Z was replaced not by A but by AA.

A Caesar cipher with shift 13, called ROT13, is widely used in UNIX to protect data against inadvertent reading. ROT13 was chosen because applying the same cipher twice returns the original text. For example, CODE in ROT13 would be PBQR; applying ROT13 to PBQR returns CODE.

Illustration

The Caesar cipher requires just two lines. The first line has the alphabet in the right order, and the second line has the letters shifted by the number of places being used in the cipher. For example, using a Caesar cipher with a right shift of four letters would produce the following table:

Plain 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
Cipher E F G H I J K L M N O P Q R S T U V W X Y Z A B C D

When encrypting, one looks at each letter in the text in the plain line and writes the corresponding letters from the cipher line. Thus, THIS IS AN ARTICLE ABOUT THE CAESAR CIPHER encrypts to XLMW MW ER EVXMGPI EFSYX XLI GEIWEV GMTLIV. To decrypt, one looks at each letter in the cipher line and replaces it with the corresponding letter in the plain line.

Decryption and alternatives

The Caesar cipher allows only 25 different encryptions when using plain text. A brute force method can hence be used to decipher the message, using all 25 possible shifts and then selecting the one that makes sense as text. The frequency distributions of letters in the plain text and in the cipher text are also identical, as each letter is always encrypted to the same cipher text letter. Caesar cipher encryptions are thus susceptible to frequency analysis. Employing multiple Caesar ciphers is no help either; for example, applying a shift of two letters followed by a shift of three letters is the same as a single cipher using a five-letter shift.

Removing the condition of always encrypting each letter to the same cipher text letter would make the cipher much harder to crack, yielding many more than 25 possibilities. The Vigenère cipher follows this approach.

Sanat Pai Raikar