Kasiski Examination

Advanced Vigenère Key Length Analysis

💡 Tip: Longer texts (200+ characters) provide better results
Shorter = more patterns, but more noise
Higher = more possibilities to check

🎯 Probable Key Lengths:

🔄 Repeated Sequences Found:

📊 Distance Factor Analysis:

📈 Index of Coincidence (IC) Analysis:

🔓 Interactive Decryption Assistant

📌 Next Step: Use the key length analysis above to begin frequency analysis. Select a key length below to begin frequency analysis.

🔑 Reconstruct the Key:

📄 Decrypted Message:

English Letter Frequency vs Your Decrypted Text

Compare to validate if decryption is correct. Good decryptions match English patterns.

📚 How Kasiski Examination Works

1

Find Repeated Sequences

The tool scans your ciphertext for repeated patterns (trigrams or longer). In Vigenère encryption, the same plaintext encrypted with the same portion of the key produces identical ciphertext.

2

Calculate Distances

For each repeated sequence, we measure the distance (in characters) between occurrences. These distances are always multiples of the key length.

3

Factor Analysis

We find all factors of each distance. The key length will be a common factor across many distances. Factors that appear frequently are strong candidates.

4

Index of Coincidence (IC)

We test each probable key length by calculating IC values. Correct key lengths produce IC values close to 0.065 (English plaintext), while incorrect lengths stay near 0.038 (random text).

5

Frequency Analysis

Once the key length is determined, split the ciphertext into groups (one for each key position). Each group is a simple Caesar cipher that can be solved with frequency analysis.

💡 Pro Tips:

  • Minimum Text Length: 200+ characters recommended. Shorter texts may not have enough repeated patterns.
  • Sequence Length: Start with trigrams (3 letters). Too short = noise, too long = few matches.
  • Multiple Candidates: The tool ranks key lengths by probability. Try the top 3-5 candidates.
  • No Spaces: Remove spaces from ciphertext before analysis for best results.
  • Case Doesn't Matter: The tool converts everything to uppercase automatically.

🕰️ Historical Context

The Kasiski examination was published by Friedrich Kasiski in 1863, though Charles Babbage discovered it independently around 1854. This method broke the supposedly "unbreakable" Vigenère cipher that had been in use for centuries.

Before Kasiski, the Vigenère cipher was considered secure because it resisted simple frequency analysis. Kasiski's insight was recognizing that repeated sequences in ciphertext revealed the key length, reducing the problem to multiple simple substitution ciphers.

❓ Frequently Asked Questions

Q: What is the Vigenère cipher?

The Vigenère cipher is a polyalphabetic substitution cipher that uses a keyword to encrypt text. Each letter of the keyword determines a Caesar shift for the corresponding plaintext letter. The keyword repeats to match the plaintext length.

Q: How accurate is Kasiski examination?

Very accurate for texts over 200 characters with a reasonable key length (5-15 letters). Short texts or very long keys may produce ambiguous results. The IC analysis helps validate findings.

Q: What if no repeated sequences are found?

This usually means: (1) the text is too short, (2) the key is very long, or (3) it's not a Vigenère cipher. Try with longer ciphertext or consider other cryptanalysis methods.

Q: Can this break modern encryption?

No. The Vigenère cipher is a classical cipher from the 1500s. Modern encryption (AES, RSA) is mathematically secure against all known attacks. This tool is for educational purposes and historical cipher analysis only.

Q: What's the difference between IC and Kasiski?

Kasiski examination uses repeated sequences to find the key length. The Index of Coincidence (IC) validates those findings by testing whether splitting the text at that length produces monoalphabetic-looking distributions. They complement each other.