Cesar Cipher


Cesar

One of the simplest examples of a substitution cipher is the Caesar cipher. This cipher is MONOALPHABETIC because only one alphabet was used.

bullet

Development

Julius Caesar (100-44 BC) used a simple substitution with the normal alphabet (just shifting the letters a fixed amount) in government communications. This cipher was less strong than other methods, by a small amount, but in a day when few people read in the first place, it was good enough.

The idea of this method is shifting each letter in the plaintext by fixed amount equal to the key chosen by the user. Each letter in the alphabet will have an index according to his order in the alphabet series starting from 0 to 25.

bullet

How To Work

In encryption the index of the plain letter will be added to the key value to get the cipher letter index, we must take modulo to the result of the previous addition because the alphabet series is circular, which mean the after Z letter will be A letter.

For example if the plaintext is letter U and the key is 12 the cipher text will be G (the U letter has the index 20 and the key 12 the cipher letter index will be (20 +12) MOD 26 =6. 6 is the index of letter G).

On the other hand, In decryption the index of the cipher letter will be subtracted from the key value and add to it 26 to avoid the negative value to get the cipher letter index, we must take modulo to the result of the previous result because the alphabet series is circular.

For example if the ciphertext is letter G and the key is 12 the cipher text will be D (the G letter has the index 6 and the key 12 the cipher letter index will be (6-12+26) MOD 26 =20. 20is the index of letter U).

The rules of this method is

Encryption: Ci=(Pi +K) mod 26

Decryption: Pi=(Ci-K+26) mod 26

Where C is the ciphertext, Pi is the plaintext, K is key number.

bullet

Weakness

Obviously, Caesar Cipher had a weakness, that the algorithm was not particularly strong. If trial and error couldn't crack the algorithm, then some simple analysis would. If English text were being encrypted, then it would be relatively simple to compare the frequency of letters in the cipher text against the frequency of letters in Standard English. Statistics would soon reveal patterns that pointed out the probable plain text letter associated with each cipher text letter.

 

bullet

Frequency analysis

 

Caesar's Cipher is so vulnerable to frequency analysis. It is because there is a one-to-one relationship between each letter. If a sufficiently large ciphertext is given, the plaintext can be found out by frequency analysis.

 


The frequency table of the letter appears in English

 

If there were a sufficiently large ciphertext, it would be solved by comparing the frequency of letters in the cipher text against the frequency of letters in Standard English. If the frequency of the letter in the cipher text is almost the same as the frequency of letters in Standard English, we can find out which letter is substituted for the letter in ciphertext. Then the message would be decrypted.

 

Development
 

How To Work

Weakness
 

Frequency Analysis