Free Vigenère Cipher

Enter text and a key above to see the Vigenère cipher result

Vigenère Cipher: The Classic Polyalphabetic Encryption Method

The Vigenère cipher is a well‑known polyalphabetic substitution cipher that uses a repeating keyword to apply different Caesar shifts to each letter of the message. Unlike a simple monoalphabetic cipher, this method does not map each plaintext letter to the same ciphertext letter every time, making it much more resistant to frequency analysis. For centuries it was considered unbreakable. Today, a free online Vigenère cipher encoder and decoder allows anyone to encrypt or decrypt text instantly using this historic technique.

How the Cipher Works

The core idea is to assign each letter of the alphabet a number from 0 to 25:

A=0, B=1, C=2, …, Z=25A = 0,\ B = 1,\ C = 2,\ \dots,\ Z = 25

When encrypting, each plaintext letter is shifted by the value of the corresponding key letter. The key is repeated as many times as necessary to cover the entire plaintext. The encryption formula is:

Ci=(Pi+Ki) mod 26C_i = (P_i + K_i) \bmod 26

where CiC_i is the ciphertext letter number, PiP_i is the plaintext letter number, and KiK_i is the key letter number.

To reverse the process, the decryption formula is:

Pi=(Ci−Ki) mod 26P_i = (C_i - K_i) \bmod 26

If the subtraction yields a negative number, simply add 26 to obtain a value in the 0–25 range.

Example: Encrypting "HELLO" with Key "KEY"

First, align the plaintext letters with the key letters (repeating the key):

PlaintextHELLO
KeyKEYKE

Now convert each letter to its numerical equivalent:

  • H = 7, K = 10 → (7 + 10) mod 26 = 17 → R
  • E = 4, E = 4 → (4 + 4) mod 26 = 8 → I
  • L = 11, Y = 24 → (11 + 24) mod 26 = 9 → J
  • L = 11, K = 10 → (11 + 10) mod 26 = 21 → V
  • O = 14, E = 4 → (14 + 4) mod 26 = 18 → S

The resulting ciphertext is “RIJVS”.

To decrypt, take each ciphertext letter and subtract the corresponding key letter (mod 26). For example, R (17) minus K (10) gives 7 → H, and so on.

The Vigenère Square (Tabula Recta)

The Vigenère table is a 26 × 26 grid that provides a visual way to perform encryption and decryption. The top row lists the plaintext letters, the leftmost column lists the key letters, and the intersection of a row and column gives the ciphertext letter. While the calculator automates this process, the table helps illustrate the shifting pattern behind the polyalphabetic cipher.

Using This Free Online Vigenère Cipher Tool

This polyalphabetic cipher tool is designed to function as both a Vigenère cipher encoder and a decoder. To encrypt text with the Vigenère cipher, simply enter your plaintext and your key, then click Encrypt. To decrypt Vigenère cipher online, input the ciphertext and the same key, then click Decrypt. The calculator automatically repeats the key if it is shorter than the text, and it handles all the modulo arithmetic instantly.

The tool supports any text that contains only letters (case is preserved, but the algorithm treats uppercase and lowercase the same). Non‑alphabetic characters are left unchanged, so you can keep spaces, punctuation, and numbers as they are.

Deciphering Without the Key

Without knowing the key, it is not possible to directly decrypt a Vigenère cipher. However, if the key is short or follows a predictable pattern, cryptanalysis methods such as the Kasiski examination or Friedman’s index of coincidence can be used to recover the key length and then the key itself. For a truly secure exchange, the key must be long, random, and kept secret.

Historical Background

The cipher was named after Blaise de Vigenère, but it was actually invented by Giovan Battista Bellaso in 1553. Vigenère later described a more complex cipher in his 1585 book Traité des chiffres, and over time his name became attached to this polyalphabetic method. Despite its age, the Vigenère cipher remains a popular teaching tool in cryptography and a fascinating example of pre‑computer era encryption.

Now you can try the Vigenère cipher calculator yourself: encrypt a secret message, send it to a friend who knows the key, and then let them decrypt it. It’s a simple yet powerful way to explore the world of polyalphabetic ciphers.

FAQ

1. How do I encrypt a message using the Vigenère cipher calculator?

Enter your plaintext and a key in the text input fields, then click the 'Encrypt' button. The calculator will repeat the key as needed and apply the formula C_i = (P_i + K_i) mod 26 to produce the ciphertext.

2. What is the difference between the Vigenère cipher and a simple Caesar cipher?

A Caesar cipher applies the same shift to every letter, while the Vigenère cipher uses a repeating keyword to assign a different shift to each letter. This makes the Vigenère cipher far more resistant to frequency analysis.

3. Can I use the same key for multiple messages?

Yes, you can reuse the same key, but it is not recommended for sensitive communications. If the key becomes known or is guessed, all messages encrypted with it can be decrypted. For security, use a long, random key once.

4. How do I decrypt a Vigenère cipher if I know the key?

Enter the ciphertext and the key into the tool, then click 'Decrypt'. The calculator uses the formula P_i = (C_i - K_i) mod 26 (adding 26 if the result is negative) to recover the original plaintext.

5. Is it possible to decode a Vigenère cipher without the key?

Without the key, direct decryption is not possible. However, methods such as the Kasiski examination or Friedman’s index of coincidence can help recover the key if it is short or repetitive. The tool requires the key to work.

How to Use

  1. Select Encrypt or Decrypt mode, then type or paste your text into the Source Text field.
  2. Enter a keyword. The key is repeated to match the length of your text for polyalphabetic encryption.
  3. The encrypted or decrypted result appears instantly. Click the Copy button to save it to your clipboard.