Tuesday, July 1, 2008

Caesar Cipher

This is the earliest know substitution cipher, and was know to be used by Julius Caesar and hence the name.

The procedure:

Each letter of the alphabet is shifted 3 letters down the stream.

Note that the alphabet is wrapped around, so that the letter following Z is A..



The transformation can be defined by listing as follows:

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: D 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



The mathematical analysis can be given as:

encryption:

C = E ( k , p ) = ( p + k ) mod 26

where,

C -> Cipher output.
E -> Encryption.
p -> Letter to be shifted.
k -> No. of places to shift the letter. its value lies between 1 to 25

decryption:

p = D ( k , c ) = ( c - k ) mod 26

where,

D -> Decryption.

an example:


Plaintext:  the quick brown fox jumps over the lazy dog
Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ

Problems with Caesar Cipher:
  • The encryption and the decryption methods are known to everyone.
  • There are only 25 keys to try the brute force attack.
  • The language of the plaintext is know and easily recognizable.

No comments:

Custom Search