Home »
Cryptography
Vigenere Cipher in Cryptography
This article is about a very well-known encryption technique: The Vigenere cipher. In this article, we will first have a brief introduction regarding this technique and then will look into how the encryption and decryption are performed in it?
Submitted by Monika Sharma, on January 17, 2020
The Vigenere cipher is one of the well-known techniques used for encrypting the data, which was proposed by Friedrich Kasiski in 1863. Although the Caeser cipher, which was amongst the firstly developed encryption techniques which gave us the idea of developing the entire encryption and decryption process, was not widely used due to its simplicity and being more prone to be cracked by any outsider. To overcome this, the algorithm of vigenere cipher was developed which was formed by a series of inter-woven caesar ciphers.
Now, talking about its characteristics and details, Vigenere cipher, unlike the Caeser cipher, is a polyalphabetic cipher, which means that if a letter 'm' is replaced by a letter 'c' at a place, it can be replaced by some other letter say 'd' at some other place. This cipher is also a type of shift cipher because in this technique we just shift the letters of the plain text to a certain number, (which is determined by the corresponding character of the key string) in a lexicographic order to obtain the ciphertext. The same process is applied in reverse by subtracting the number. The respective letters are thus shifted in reverse lexicographic order are shifted back in the decryption process to obtain the plain text back.
The following key points can be drawn for the Vigenere cipher,
- The key chosen here is a string whose length must be either less or equal to the length of the plain text.
- It is a type of symmetric-key cryptography.
- It is a type of poly-alphabetic cipher, being a part of the substitution cipher.
Encryption Process
Decryption Process
Here also, the numbers 0-25 represent the English alphabets in lexicographic order, i.e. from a to z, and we choose the same key string 'K' that we used to encrypt our data. Suppose we denote the numbers representing the letters of the ciphertext using 'C'.
The decryption of the ciphertext to convert it back into plain text is performed as follows,
D (C_{i} , K_{i}) = ( C_{i} – K_{i} ) mod 26
Example Problem
Given Plain text: 'GIVE MONEY'
Key: LOCK
Convert the given plain text into cipher text...
Solution:
Similarly, after performing the encryption for the whole plain text, the cipher text that we get for the word 'GIVEMONEY' is 'RWXOXCPOJ'.
Note: You can cross-check your answer by applying the decryption process over the ciphertext, and if it comes back to be the same as the plain text, then it means that our answer is correct.
TOP Interview Coding Problems/Challenges