Krypton Level 5
Krypton Level 5 — break a Vigenère cipher when the key length is unknown, by first discovering the length from patterns in the ciphertext.
Table of Contents
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level Info
FA can break a known key length as well. Lets try one last polyalphabetic cipher, but this time the key length is unknown. Note: the text is writen in American English
Enjoy.
Study guide
Level map: logged in as krypton5, decrypt the file that holds the password for krypton6.
What this level teaches
How to find an unknown key length, then reuse the Level 4 method.
Key ideas
- Repeated sequences (Kasiski examination). If the same plaintext fragment is encrypted at positions separated by a multiple of the key length, it produces the same ciphertext. Distances between repeats suggest the length.
- Index of coincidence. A statistic measuring how uneven the letter distribution is. When you split text by the correct key length, each group looks like English and the statistic jumps.
- Try lengths systematically. A short script that computes the statistic for lengths 1 to about 20 is quick to write.
- Then proceed as before with frequency analysis for each position.
How to approach it
- Look for repeated sequences and note their spacing, or compute the coincidence statistic.
- Pick the most plausible key length.
- Apply the method from Level 4.
Why it matters
Key-length discovery generalises to many attacks on reused keys, including repeating-key XOR, which you will meet again.