Vigenère Cipher Encoder & Decoder

Encrypt and decrypt text with a keyword-based Vigenère cipher.

Free Vigenère cipher tool — encrypt and decrypt text with a repeating keyword, all in your browser. Nothing is ever uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does the Vigenère cipher work?

Each letter of the message is shifted by the corresponding letter of a repeating keyword: A shifts by 0, B by 1, and so on. This makes it a polyalphabetic cipher that is much harder to break than a single Caesar shift.

The Vigenère cipher is a classic polyalphabetic substitution cipher: instead of shifting every letter by the same amount like a Caesar cipher, it uses a repeating keyword so each position is shifted by a different value. Described by Giovan Battista Bellaso in 1553 and later misattributed to Blaise de Vigenère, it resisted casual codebreaking for 300 years. This tool encrypts and decrypts text with any keyword, entirely in your browser.

The tabula recta and the key stream

The keyword is first cleaned to letters only and lower-cased, then repeated across the letters of your message (spaces, digits and punctuation pass through and do not advance the keyword). Each plaintext letter is shifted by the alphabet position of the matching keyword letter — A = 0, B = 1, … Z = 25 — wrapping around modulo 26. To decrypt, the tool shifts in the opposite direction (by 26 − shift). Letter case is kept; non-letters are left untouched.

Example

Encrypting ATTACKATDAWN with the keyword LEMON:

PlaintextATTACKATDAWN
KeyLEMONLEMONLE
Shift114121413114121413114
CipherLXFOPVEFRNHR

The result is LXFOPVEFRNHR. Decrypting it with the same keyword returns the original message. Everything happens in your browser, so your message and keyword never leave your device.

Three centuries of “the indecipherable cipher”

The cipher is misattributed: Blaise de Vigenère described a stronger autokey variant in 1586, but the repeating-key scheme that bears his name was published earlier by Giovan Battista Bellaso (1553). For three hundred years it carried the nickname le chiffre indéchiffrable — the indecipherable cipher — because, unlike a Caesar shift, it flattens simple frequency analysis: the same plaintext letter encrypts to different ciphertext letters depending on its position against the key. See the historical overview in Britannica’s Vigenère cipher entry.

How it was finally broken

Two 19th-century insights killed the “indecipherable” reputation:

  • Kasiski examination (1863). Repeated plaintext fragments that happen to align with the same key position produce repeated ciphertext fragments. Measuring the distances between repeats reveals the key length — the distances are multiples of it.
  • Friedman’s index of coincidence (1920s). Statistical analysis of how often letters coincide distinguishes a short repeating key from random text and estimates the key length directly.

Once the key length n is known, the ciphertext splits into n separate Caesar ciphers, each solvable in seconds by frequency analysis. The lesson generalises: a cipher’s strength collapses when key material repeats — which is exactly the property the one-time pad fixes.

The one-time pad connection

Stretch the Vigenère key until it is as long as the message, perfectly random, and never reused, and the scheme becomes the one-time pad — the only encryption with a mathematical proof of unbreakability (Shannon, 1949). Every weakness of Vigenère is a consequence of the key being shorter than the message: repetition creates the statistical structure Kasiski and Friedman exploit. That makes this cipher the single best teaching bridge in classical cryptography — one parameter (key length) walks you from a trivially broken toy to a provably perfect system.

Try it against yourself

A worthwhile exercise: encrypt a paragraph of English with a 4-letter key, then attempt the Kasiski attack by eye — search the ciphertext for repeated trigrams and measure the gaps. On a few hundred characters the key length usually falls out in minutes, which is the most convincing demonstration possible of why key reuse is fatal and why modern systems derive a fresh key stream for every message.

Practical framing for modern readers: Vigenère belongs in puzzles, geocaches, escape rooms and classrooms — never in real secrecy. If you need actual confidentiality, use an audited modern tool (age, GPG, or your platform’s encryption APIs); if you need a puzzle that clever solvers can break with effort, Vigenère with a short English key is exactly the right difficulty, which is why it remains the most-set cipher in CTF beginner tracks.

A small implementation detail worth knowing when checking work by hand: letters are the only characters transformed — digits, spaces and punctuation pass through unchanged and, crucially, do not advance the key stream in this implementation, so the key letters line up against alphabetic characters only. Two tools that handle non-letters differently will produce different ciphertexts from identical inputs, which is the usual explanation when two Vigenère implementations “disagree”.