Cryptography Intermediate

Vigenère Cipher

A different shift for every position, driven by a repeating keyword. That defeats simple frequency analysis — until you find the key length. This tool encrypts, decrypts, and then breaks the cipher using Kasiski spacing and the index of coincidence.

Aligned keystream
Kasiski + index of coincidence
Automatic key recovery
Live
Message and Keyword
A one-letter key is a Caesar cipher. A key as long as the message and never reused is a one-time pad. Everything interesting happens in between.
Result
Ciphertext
Keystream alignment (first 90 letters)
Key length5
Key as shifts11, 4, 12, 14, 13
Index of coincidence—
Letter-by-Letter Working
Break It Without the Key

Paste ciphertext into the input above, then run the two classical steps: find the key length, then solve each column as a separate Caesar cipher. Works best on 200+ letters.

Step 1 — Index of coincidence by key length

English sits near 0.067; random text near 0.038. The lengths scoring highest are the likely ones. Click a bar to try it.

Step 2 — Recovered key

Each column is a Caesar cipher; the best shift for each is found by chi-squared against English.

Best key for that length
—
Decryption with that key
Kasiski: repeated sequences and the spacings between them

A repeated trigram usually means the same plaintext met the same part of the key. The key length tends to divide those spacings.

SequencePositionsSpacingsDivisors
One Cipher Per Position
E(x_i) = (x_i + k_(i mod m)) mod 26

Write the keyword repeatedly under the message. Each plaintext letter is shifted by the letter above it, so the same plaintext letter encrypts differently depending on where it sits.

That is the whole idea: a single letter frequency table of the ciphertext looks nearly flat, because the tall E bar has been smeared across m different positions. For three centuries this was called le chiffre indéchiffrable.

It is really m independent Caesar ciphers interleaved — and that is exactly how it falls.

With a key length of m, letters 1, m+1, 2m+1, ... all use the same shift. Pull out that column and you have an ordinary shift cipher.
How It Was Broken

Two nineteenth- and twentieth-century ideas, both in the panel above:

  • Kasiski examination (1863). When a repeated chunk of plaintext lines up with the same part of the key, the ciphertext repeats too. The distance between repeats is a multiple of the key length, so the common divisors of those distances give it away.
  • Index of coincidence (Friedman, 1922). The chance two random letters of a text match is about 0.067 for English and 0.038 for random letters. Slice the ciphertext into m columns and average the IC of each: when m is right, every column is English-shaped and the value jumps.
  • Then solve each column. Once m is known the problem collapses into m separate Caesar ciphers, each cracked by frequency analysis in an instant.
Longer keys mean shorter columns and weaker statistics, which is why key length matters. Push it to the length of the message, never repeat it, and you have a one-time pad — which genuinely cannot be broken.
Put It Into Practice

The tool shows the mechanism — the slides show why it is built that way.

Cryptanalysis is a skill you can learn

Finding a key length from nothing but ciphertext is the moment cryptography becomes detective work. One-on-one tutoring builds that instinct step by step.

Book a Free Consultation →