# Caeser Cipher – the Shift Cipher

Only available on StudyMode
• Published: June 17, 2013

Text Preview

CAESER CIPHER – THE SHIFT CIPHER

1. Introduction
2. History & Development
3. How It Works
4. C++ Source Code [Encryption]
5. C++ Source Code [Decryption]
6. Step By Step Explanation [Decryption]
7. Step By Step Explanation [Decryption]
8. Pros & Cons
9. Conclusion
10. Reference

INTRODUCTION

In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.

The encryption step performed by a Caesar cipher is often incorporated as part of more complex schemes, such as the Vigenère cipher, and still has modern application in the ROT13 system. As with all single alphabet substitution ciphers, the Caesar cipher is easily broken and in modern practice offers essentially no communication security.

HISTORY & DEVELOPMENT

The cipher was named after Julius Caesar. It was used during 50BC by notable Romans including Julius Caesar. In cryptography, the Caesar cipher is also known as Caesar’s shift or the Shirt Cipher. Julius Caesar used the Caesar cipher to communicate with his generals during military campaigns to protect and encrypt messages that were important to the military and the government.

The Caesar Cipher is a type of substitution cipher. Each letter in the plaintext is replaced by a letter some fixed number of positions further down the alphabet. The Caesar cipher is a “monoalphabetic substitution cipher”, meaning only one letter is assigned to the alphabet it is supposed to represent.

According to Suetonius, who wrote the book Life of Julius Caesar, Julius Caesar used the substitution cipher to a shift of three; meaning shifted each letter 3 places further through the alphabet, a(plaintext) becomes D(ciphertext).

“If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, which not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others." (Suetonius, Life of Julius Caesar, 56)

Julius Caesar’s nephew, Augustus, also used the Caesar cipher. However, he used it to the shift of one letter only. According to David Kahn’s book, The Code Breakers, lovers used the Caesar code to communicate secretly. In the Caesar Cipher, the plaintext is usually in lower case while the cipher text is in upper case.

The ROT13 is an application of the Caesar cipher. ROT13 replaces each letter by its partner 13 characters further down the alphabet. As the alphabet consist of 26 letters, the “ROT13 function is its own inverse”, meaning C becomes P and P becomes C.

HOW IT WORKS

The Caesar Cipher replaces each letter in the plain text (the alphabet) with a letter that has a fixed number of places down the alphabet. For example, the diagram below has defined its parameters with a shift of 3 also known as the Caesar shift.

As such, the letter B in the plaintext becomes E in the ciphertext. Here is a sample of the revolvable cipher which makes encryption much more convenient by turning the inner and outer wheel.

The outer wheel is the original alphabet or plaintext and the inner wheel is the ciphertext which can be adjusted accordingly.

To encrypt a phrase or word, we could use the table above, where the letters in the dark blue boxes represent the plaintext or the alphabet while the letters in the boxes shaded light blue is the cipher text according to Caesar’s Shift of 3. Therefore, to...