Vigenère Cipher — Encrypt & Decrypt With a Keyword

Search Engine Optimization
  1. Home
  2. Developer Tools
  3. Vigenère Cipher
Share: Report

Vigenère Cipher

100% free · Runs 100% in your browser · No signup needed

Text
Keyword (letters only — the key repeats, A=0 … Z=25)
Your result will appear here.
Honest label: the Vigenère cipher is for learning and puzzles — not secure by modern standards. Never use it for real secrets.

Formula: Ci = (Pi + Ki) mod 26 with A=0. Letter case is preserved, non-letters pass through unchanged, and the keyword repeats over letters only.

Try the classic example: key LEMON, plaintext ATTACKATDAWN → LXFOPVEFRNHR

Sobre Vigenère Cipher

What Is the Vigenère Cipher?

The Vigenère cipher is one of the most famous encryption methods in history — a polyalphabetic substitution cipher that uses a repeating keyword to encrypt a message. For roughly 300 years it was considered unbreakable, earning the nickname "le chiffre indéchiffrable" ("the indecipherable cipher"). Today we know better, which makes it a perfect tool for learning how cryptography works: simple enough to do by hand, rich enough to teach the ideas behind real ciphers.

The Vigenère Cipher tool on fisthost.com/tools lets you encrypt and decrypt messages with any keyword, right in your browser. It preserves letter case, passes non-letters through unchanged, and even explains the underlying square so you can follow along by hand.

How It Works: The Tabula Recta

The cipher is built on the tabula recta — a 26×26 grid where each row is the alphabet shifted by one more position. Encryption works letter by letter: for each plaintext letter, find the row given by the current keyword letter and the column given by the plaintext letter. Mathematically, with A=0 through Z=25:

Ci = (Pi + Ki) mod 26

Decryption reverses it: Pi = (Ci − Ki) mod 26. The keyword repeats as needed, so keyword letter Ki cycles through the key. Because the shift changes with every letter, the same plaintext letter encrypts to different ciphertext letters — that is what makes it polyalphabetic, and what defeated the frequency analysis that breaks simple substitution ciphers.

Worked Example: Key LEMON, Plaintext ATTACK

This is the classic textbook example. Align the repeating key under the plaintext:

PlaintextATTACK
KeyLEMONL
Numbers0+1119+419+120+142+1310+11
mod 2611235141521
CiphertextLXFOPV

ATTACK with key LEMON becomes LXFOPV. Notice the two T's became X and F — different ciphertext for the same letter, the signature of polyalphabetic encryption. Try it in the tool and then decrypt LXFOPV with the same key to watch it reverse.

A Brief History

  • 1553 — Bellaso. The method was first described by Giovan Battista Bellaso, an Italian cryptologist, in his book La cifra del Sig. Giovan Battista Bellaso.
  • 16th century — Vigenère. Blaise de Vigenère, a French diplomat and cryptographer, described a related autokey cipher; his name became conventionally attached to the keyword cipher we use today.
  • ~300 years of confidence. The cipher resisted all known attacks for centuries and was trusted by military and diplomatic users.
  • ~1854 — Babbage. Charles Babbage worked out how to break it using repeated-fragment analysis but never published.
  • 1863 — Kasiski. Friedrich Kasiski published the first general method for breaking the cipher: find repeated fragments in the ciphertext, measure the distances between them, and deduce the key length — after which each Caesar-shifted alphabet falls to frequency analysis. The related Friedman test uses the index of coincidence to the same end.

The Honest Label: Educational, Not Secure

This is important: the Vigenère cipher is NOT secure by modern standards. Kasiski examination and Friedman analysis break it reliably whenever the ciphertext is long enough, and short keys fall to brute force. Never use it to protect real secrets, passwords, or sensitive communications.

So what is it good for? Plenty:

  • Learning cryptography — it teaches modular arithmetic, key repetition, and why frequency analysis matters.
  • Puzzles and games — treasure hunts, escape rooms, and puzzle hunts love Vigenère.
  • Appreciating modern crypto — understanding why Vigenère fails is the first step to understanding why modern ciphers are designed the way they are.

For anything that actually needs protection, use modern, vetted tools — like the Bcrypt Hash Generator for password hashing — never a classroom cipher.

How the Tool Behaves

  • Encrypt/decrypt toggle — one input box, one keyword box, a switch for direction.
  • Case preserved — "Hello" encrypts with the H and e keeping their case in the output.
  • Non-letters pass through — spaces, punctuation, and numbers are copied unchanged, so your message stays readable in structure.
  • Key repeats with A=0 — the letter A in the key means "shift by zero", exactly matching the textbook definition.
  • Square explanation — the page shows how the tabula recta works so you can verify results by hand.
  • One-click copy — grab the result for your puzzle or message.

Vigenère vs. Caesar: What's the Difference?

Caesar CipherVigenère Cipher
TypeMonoalphabetic (one shift)Polyalphabetic (many shifts)
KeyA single numberA keyword, repeated
Same letter →Always the same ciphertext letterDifferent ciphertext letters
Broken bySimple frequency analysis / brute force (25 tries)Kasiski / Friedman analysis (needs longer text)
EraAncient RomeRenaissance, trusted for ~300 years

Try both side by side: the Caesar Cipher shows the simplest possible substitution, and this tool shows the historical leap forward.

Fun Things to Try

  • Encrypt your name with the key of your birth year spelled out — then hand the ciphertext to a friend with the key as a puzzle.
  • Encrypt the same message with a 3-letter key and a 12-letter key. Which ciphertext looks more random? (Longer keys resist Kasiski analysis better — another lesson the tool teaches.)
  • Use a key of all A's — the output equals the input. That is the cipher telling you A means "shift by zero".
  • Encode a treasure-hunt clue and hide the keyword in a separate riddle.

Build Your Cryptography Playground on FistHost

Fascinated by ciphers and thinking of building your own crypto playground, puzzle site, or coding blog? FistHost shared hosting starts at just $0.99/month, with a free domain included on the annual plan. Reliable, affordable hosting gives your experiments a permanent home on the web.

Frequently Asked Questions

Is the Vigenère cipher secure?

No — not by modern standards. It is vulnerable to Kasiski and Friedman analysis and should be used for education and puzzles only, never for real secrets.

Why was it considered unbreakable for 300 years?

Because it defeats simple frequency analysis: the same plaintext letter encrypts to different ciphertext letters. It took the insight of analyzing repeated fragments to recover the key length before frequency analysis could be applied per alphabet.

Does the tool send my text to a server?

No. Encryption and decryption run entirely in your browser via JavaScript. Nothing is uploaded or stored.

What happens to spaces and punctuation?

They pass through unchanged. Only the letters A–Z (in either case) are transformed, and case is preserved.

Who was Vigenère, really?

Blaise de Vigenère was a 16th-century French diplomat and cryptographer. The keyword cipher named for him was actually first described by Giovan Battista Bellaso in 1553 — a fun historical footnote the tool's article preserves.

Explore More Code Tools

Continue your cryptography tour: the Caesar Cipher for the classical starting point, the Morse Code Translator for signaling history, the Bcrypt Hash Generator for how passwords are really protected today, and the JWT Generator for modern web tokens.

Launch Your Site With FistHost

From puzzle blogs to full web applications, every project deserves dependable hosting. FistHost offers shared hosting from $0.99/month with a free domain on annual plans — get online today with hosting that is fast, affordable, and backed by real support.

User Reviews

No reviews yet. Be the first to review this tool!

Write a Review

★★★★★

Captcha

Reviews are protected by captcha and moderated before they appear.


FistHost

Blazing-Fast Web Hosting

Plans from $0.99/mo
Free domain included

Get Hosting
FistHost Web Hosting Blazing-fast hosting for your website Plans from $0.99/mo · Free domain included Get Hosting