Cipher Configuration
🔑 Keyword
The keyword determines the shifting pattern. Longer keywords are harder to crack.
Plaintext / Ciphertext Input
chars: 0
alpha: 0
Output
Keyword Alignment Visualizer
Enter text and a keyword to see alignment.
keyword: none
mode: encrypt
📚 Key Terms Explained
Vigenere Cipher
A polyalphabetic substitution cipher that uses a repeating keyword to apply a different Caesar shift to each letter of the plaintext. Named after Blaise de Vigenere, though earlier described by Giovan Battista Bellaso.
Polyalphabetic
Using multiple different cipher alphabets within a single message. The opposite of monoalphabetic, where every letter maps to exactly one other letter. Polyalphabetic ciphers resist simple frequency analysis.
Tabula Recta
A 26x26 grid of letters where each row is the alphabet shifted one position further. Also called the Vigenere square. The intersection of a keyword letter (row) and a plaintext letter (column) gives the ciphertext letter.
Keyword
The secret word or phrase that controls the Vigenere cipher. It is repeated (cycled) over the length of the message. A longer, more random keyword makes the cipher significantly harder to crack.
Ciphertext
The encrypted, unreadable output produced by running plaintext through a cipher. Without knowing the keyword and algorithm, ciphertext should reveal nothing about the original message.
Plaintext
The original, human-readable message before encryption. In decryption, it is the recovered message after the cipher is reversed. Also called cleartext.
Frequency Analysis
A cryptanalysis technique that exploits the fact that certain letters appear more often in a language. In English, E, T, and A are the most common. By counting ciphertext letter frequencies, an attacker can deduce the substitution mapping.
Kasiski Examination
An attack on the Vigenere cipher that finds repeated trigrams in the ciphertext. The gaps between repetitions are likely multiples of the keyword length, revealing it to the attacker.

The Complete Guide to the Vigenere Polyalphabetic Cipher

The Vigenere cipher was called "le chiffre indechiffrable" (the indecipherable cipher) for over 300 years. It takes the simple Caesar cipher and adds a repeating keyword that makes each letter shift differently, producing ciphertext that resists the frequency analysis attacks that trivially break single-substitution ciphers. This guide explains exactly how it works, why it was historically significant, and where it ultimately fails.

How to Use This Tool

Select Encrypt or Decrypt mode at the top. Enter your keyword in the Keyword field - only letters are used, so spaces and numbers are ignored. Type or paste your message in the left panel. The right panel shows the result instantly.

The Keyword Alignment Visualizer below the output shows you exactly which key letter is applied to each plaintext letter in real time. Non-alphabetic characters (spaces, punctuation, digits) are passed through unchanged and consume no keyword position, so the keyword only advances on alphabetic characters.

The Math Behind the Cipher

Every letter is mapped to a number: A=0, B=1, C=2, ... Z=25. For encryption, the formula at each alphabetic position i is: Cipher[i] = (Plain[i] + Key[i mod keyLength]) mod 26. Decryption reverses it: Plain[i] = (Cipher[i] - Key[i mod keyLength] + 26) mod 26. Adding 26 before the modulo prevents negative results.

Example with keyword KEY (K=10, E=4, Y=24): encrypting HELLO gives H(7)+K(10)=17=R, E(4)+E(4)=8=I, L(11)+Y(24)=35 mod 26=9=J, L(11)+K(10)=21=V, O(14)+E(4)=18=S. HELLO becomes RIJVS.

A Partial Tabula Recta (Vigenere Square)

The rows are keyword letters (A-E shown), columns are plaintext letters (A-E shown). Each cell is the ciphertext produced by that row-column pair. The diagonal is highlighted - it represents encrypting with key=A, which leaves the letter unchanged (a shift of zero).

ABCDE
AABCDE
BBCDEF
CCDEFG
DDEFGH
EEFGHI

Historical Context

Giovan Battista Bellaso described the core idea in 1553. Blaise de Vigenere published a stronger autokey variant in 1586 - yet the simpler repeating-keyword version became known by his name. For nearly three centuries, the cipher was considered unbreakable. Charles Babbage cracked it in the 1840s (unpublished), and Friedrich Kasiski independently published the attack in 1863. The cipher's weakness: a repeating keyword creates periodic structure. If the keyword is 5 letters long, every 5th letter in the ciphertext is shifted by the same amount - reducing it to five simultaneous Caesar ciphers.

Frequently Asked Questions

A Caesar cipher uses a single fixed shift applied to every letter, so all "A"s become "D"s, all "B"s become "E"s, and so on. This makes it trivially breakable with frequency analysis since the most common letter in the ciphertext will almost always correspond to "E". The Vigenere cipher uses a keyword to apply a different shift to each letter position. With a keyword of length N, there are N different Caesar ciphers interleaved. This means the same plaintext letter can map to many different ciphertext letters and vice versa, which dramatically flattens the frequency distribution and defeats simple frequency analysis.
When your keyword is exactly as long as your message (and each keyword letter is used only once), the Vigenere cipher becomes a one-time pad. A one-time pad is theoretically unbreakable with perfect randomness and strict single-use, because every possible plaintext of that length is equally probable given the ciphertext. The keyword never repeats, so the statistical patterns that Kasiski examination exploits cannot appear. This is why intelligence agencies have used one-time pads for the most sensitive communications.
The classic attack is the Kasiski examination: scan the ciphertext for repeated trigrams (3-letter sequences). The distances between repetitions are likely multiples of the keyword length. Find the greatest common divisor of those distances and you have a strong guess for the keyword length. Once you know the keyword length N, split the ciphertext into N groups - every Nth letter. Each group is now a simple Caesar cipher, which you break with index-of-coincidence analysis or straight frequency analysis (the most common letter in each group is likely a shift of "E"). Reconstruct the keyword from the N individual shifts. Modern computer tools can do this in seconds for most short keywords.
No. The Vigenere cipher is a classical cipher and provides no meaningful security for sensitive modern data. It was considered unbreakable for centuries but Charles Babbage and Friedrich Kasiski independently demonstrated its weakness in the mid-1800s. Today, it can be broken programmatically in milliseconds with basic statistical tools. For protecting real data, use modern authenticated encryption such as AES-GCM or ChaCha20-Poly1305, ideally through a well-audited library or protocol like TLS, Signal Protocol, or age. The Vigenere cipher is valuable as a learning tool for understanding how polyalphabetic substitution works and why key reuse is catastrophic.
Frequency analysis is the study of how often letters, pairs (bigrams), or triples (trigrams) appear in a ciphertext, then comparing those frequencies to known patterns in the target language. In English, "E" appears about 12.7% of the time, "T" about 9.1%, "A" about 8.2%, and so on. In a simple substitution cipher, the most frequent ciphertext letter almost certainly represents "E". The Vigenere cipher resists single-letter frequency analysis because each plaintext letter is shifted by a different amount depending on its position in the keyword cycle, but it remains vulnerable to the Kasiski examination once the keyword length is known.