Shift Cipher is one of the earliest and the simplest cryptosystems. A given plaintext is encrypted into a ciphertext by shifting each letter of the given plaintext by n positions.
The 26 letters of the alphabet are assigned numbers as below:
An example of encrypting the plaintext by shifing each letter by 3 places.
Plaintext: shift cipher is simple
Mathematically, the shift cipher encryption process is taking a letter and move it by n positions. Let
x be the position number of a letter from the alphabet
n be the an integer which 0<=n<=25, it is the key for encryption and decryption of shift cipher cryptosystem
Any number (mod 26) will result in an integer less than 26 and greater than 0.
The encryption process is (the x here represents a letter from plaintext):
x+n (mod 26)
The decryption process is (the x here represents a letter from ciphertext):
x-n (mod 26)
For example, if x is 3 which represents the letter d, and n is 3 which means shift by 3 spaces, then the letter d will become g after encryption.
The next cryptosystem, Affine ciphers will be a little more complex and stronger than the shift ciphers.
Search within Codexpedia
Search the entire web