Coders Packet

Vigenere Cipher in C++

By Sankalp Verma

Vigenere cipher is one of the most popularly used alphabetic cipher. This program implements Vigenere cipher in C++.

Vigenere Cipher in C++

 

One of the most famous and simple polyalphabetic substitution ciphers is the Vigenere Cipher.

Vigenere Cipher uses a key to select which alphabet is used for each letter of the message. The encryption is done using the Vigenere table which is shown below:-

 

Vigenere Table

Algorithm

1. Plain text and key is taken from the user. (Constraint: Length of key<=Length of Plain Text)

2. Each alphabet from the key is taken with each alphabet of the plain text with respect to each position.

3. If the length of the key is exhausted, then the key is reused from start with the corresponding alphabets of the plain text which were left.

4. The alphabets are encrypted using the table taking the key alphabet in the row(i) and the plain text alphabet in the column(j).

5. The encrypted alphabet is the (i,j)th entry in the table.

 

Implementation

 

 

Download project

Reviews Report

Submitted by Sankalp Verma (sankalpshanky007)

Download packets of source code on Coders Packet