About the Vigenère Cipher
The Vigenère cipher is a classical polyalphabetic substitution cipher first described in the 16th century. Instead of shifting every letter by the same amount (like a Caesar cipher), it shifts each letter by a different amount determined by a repeating keyword. That variation is what makes it far harder to break by simple frequency analysis than a single-shift cipher.
The formula
Every letter A-Z is assigned a numeric value: A=0, B=1, C=2, ... Z=25. To encrypt, each plaintext letter Pi is combined with the matching keyword letter Ki (repeated to cover the whole message) using modular addition:
- Encryption: Ci = (Pi + Ki) mod 26
- Decryption: Pi = (Ci - Ki + 26) mod 26
The "mod 26" simply wraps the result back into the alphabet whenever the sum runs past Z (or below A). Spaces, digits, and punctuation are not part of the 26-letter alphabet, so this calculator copies them through unchanged and does not advance the keyword position for them — the standard convention. Letter case in the input is preserved in the output.
Worked example
Encrypting ATTACKATDAWN with the keyword LEMON: the keyword repeats as LEMONLEMONLE to line up with all twelve letters. A(0)+L(11)=11=L, T(19)+E(4)=23=X, T(19)+M(12)=31 mod 26=5=F, A(0)+O(14)=14=O, and so on, producing LXFOPVEFRNHR. Decrypting that ciphertext with the same keyword subtracts instead of adds and recovers ATTACKATDAWN exactly.
How to use this calculator
- Paste or type your message into Message text — plaintext to encrypt, or ciphertext to decrypt.
- Enter a keyword of one or more letters; any non-letter characters in the keyword itself are ignored.
- Choose Encrypt or Decrypt, then press Calculate. The keyword cycles automatically to cover the entire message.
Security note
The Vigenère cipher was considered unbreakable for centuries and earned the nickname "le chiffre indéchiffrable." It was eventually broken using Kasiski examination (finding repeated ciphertext fragments to estimate the keyword length) and later the index of coincidence method developed by Friedman. Today it is a teaching tool and puzzle cipher, not a secure one — real confidentiality needs a modern algorithm such as AES.