Caesar cipher is a substitution cipher. You take the whole alphabet and substitute it with a different alphabet. In Caesar’s case you shift the plaintext alphabet to the right by k letters for encryption. Key k is an arbitrary integer.


Let us take English alphabet as plaintext alphabet. Let k = 3, then encryption works as follows:

a -> d
b -> e

x -> a
y -> b
z -> c

It is a cyclical method, therefore after reaching the end of the alphabet you go right to the beginning. The weakness is in the small key size. In case of English alphabet it is equal to 26. This kind of Caesar cipher is very vulnerable to brute force. You can easily break it in almost no time just by trying all possible (26) keys.


To decrypt you shift the cipher text by k letters to the left.