In cryptography, a Shift cipher, also known as the Caesar cipher, is one of the simplest and most widely known encryption techniques. A given plaintext is encrypted into a ciphertext by shifting each letter of the given plaintext by k positions, where k=key.
Encryption: f(p) = (p+k) mod 26
Decryption: f(p') = (p'-k) mod 26
Where, p = positional value of alphabet in the original message
p'= positional value of alphabet in the encrypted message
k = key used for shift encryption
f(p) = positional value of encrypted alphabet
f(p')= positional value of decrypted alphabet