Caesar Cipher

Table of Contents

Caesar Cipher

The Caesar Cipher is a very simple example of a substitution cipher. It is also one the oldest examples of a cryptographic system. It was used by Roman military leaders, in particular Julius Caesar and Octavius.

The cipher simply involves shifting the plain-text alphabet by a fixed number of character. The key is the number of characters shifted by. For example, if the key is 3, then we have the following cipher-text alphabet:

abcdefghijklmnopqrstuvwxyz
DEFGHIJKLMNOPQRSTUVWXYZABC

where small letters represent the plaintext (not encrypted) alphabet and capital letters represent the ciphertext (encrypted) alphabet. For example, try to decipher the following message:

WKLV LV HDVB WR FUDFN

To make decrypting the ciphertext slightly harder, word spaces are often ignored, and the letters are arranged in groups of five:

WKLVL VHDVB WRFUD FNXXX

Note the three X's at the end to complete the block of five characters. This is known as padding.

The Caesar Cipher is extremely easy to break. There are only 25 possible keys, and it would not take long to try them all until you find the right one. In fact, you only need test the first three or four characters of the ciphertext to see if the key turns it into recognisable English.

Mathematically, we can express the Caesar Cipher as:

where is the ciphertext, the plaintext and the key.

Author: Harry Wright <harry@harrywright.net>

Date: 2009-06-09 13:13:26 BST

HTML generated by org-mode 6.27trans in emacs 23




Home Page Section Site Map