🗝️

Vigenere Cipher

Keyword-driven polyalphabetic encrypt and decrypt, case preserved.
Vigenere 📂 Encode 👤 ToolWorld 🏷️ v1.1.12
Loading...

Vigenere Cipher

Keyword · polyalphabetic

Input text 0
Output 0

How to Use

📖 Tool Introduction


The Vigenere cipher is a polyalphabetic substitution developed during the Renaissance, and for several centuries it was widely believed to be unbreakable, until frequency analysis finally matured enough to crack it. It fixes the main weakness of the Caesar cipher, which applies the same fixed shift to every letter. Instead, encryption derives a whole stream of varying shift letters from a keyword, and applies that stream one letter at a time across the plaintext. The recipe is straightforward: each keyword letter is mapped to a number with A equal to zero, B equal to one and so on up to Z equal to twenty-five; that number is added to the position of the plaintext letter and reduced modulo twenty-six to produce the ciphertext letter. When the keyword runs out, it simply repeats from the beginning until every letter is covered. Decryption subtracts the same values, and with the identical keyword the original text is restored. This tool follows the standard A to Z table exactly: any non-letter inside the keyword is dropped automatically and only the letters cycle through; uppercase and lowercase plaintext are computed on separate tables while their original case is preserved; digits, punctuation and spaces neither participate in the math nor consume the next keyword letter. After you run a conversion, a key stream is shown directly above the output, aligned character by character with your message, so you can see with your own eyes exactly how the keyword loops around to drive each letter, which makes it an excellent teaching and demonstration aid. Because everything runs locally, experimenting with different keywords never exposes your plaintext to a server, and you can freely study how a longer keyword flattens letter frequencies and resists simple analysis. Longer keywords flatten the letter frequency far more effectively than a single fixed shift, which is exactly why this cipher resisted casual analysis for centuries, and watching the repeating key stream line up with your message is the fastest way to appreciate how that strength arises from mere repetition. Because you can switch between encrypt and decrypt without retyping the keyword, it is easy to round-trip a sentence and confirm the two directions are exact inverses.

✨ Key Features


  • Polyalphabetic: a keyword drives a varying shift per letter, stronger than Caesar
  • Both directions: encrypt adds, decrypt subtracts, the same key restores text
  • Case preserved: uppercase and lowercase use separate tables
  • Non-letters ignored: non-letters in key or text are skipped safely
  • Key stream visible: the looping keyword aligned to your message is shown live
  • Fully offline: pure in-browser math, copy and download, private

📝 How to Use


  1. Type an English word into the keyword box as your secret key
  2. Choose encrypt or decrypt direction
  3. Type the text to process into the input area
  4. Click Run, or press Ctrl+Enter
  5. Read the output and compare it with the key stream above to trace each shift

⚠️ Notes


  • Keyword required: a keyword with no letters triggers a clear prompt
  • Latin letters only: CJK characters are not transformed and stay as-is
  • For teaching: Vigenere is still a classical cipher and not for real secrets
  • Same key: encrypt and decrypt must use the exact same keyword
  • Non-letter gaps: spaces and punctuation appear as gaps in the key stream

Related

⏫︎