Vigenere Cipher

Text

Cipher

How Does the Vigenère Cipher Work?

The Vigenère Cipher is a polyalphabetic substitution cipher that improves upon the Caesar Cipher. It uses a keyword to shift the letters of the alphabet, making it much harder to break than simple substitution ciphers.

This method was first described by Giovan Battista Bellaso in 1553, but misattributed to Blaise de Vigenère in the 19th century. It remained unbroken for three centuries, earning it the nickname "le chiffre indéchiffrable" (the indecipherable cipher).

The formula to encrypt a letter is: E(i) = (P(i) + K(i mod m)) mod 26, where P(i) is the i-th letter of the plaintext, K(i mod m) is the i-th letter of the key (repeated as necessary), and m is the length of the key.

Example

If we use the key KEY to encrypt the word HELLO:

H + K = R, E + E = I, L + Y = J, L + K = V, O + E = S

The encrypted message is: RIJVS

How It Works

1. The key is repeated to match the length of the plaintext.

2. Each letter of the plaintext is shifted by the corresponding letter in the key.

3. The shift is performed by treating A=0, B=1, C=2, etc., adding the values, and taking the result modulo 26.

This process creates a different Caesar Cipher for each letter of the key, significantly increasing the cipher's strength compared to a simple Caesar Cipher.