Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/krypton/krypton5.md
URL /wargames/krypton/krypton5/
Date 2026-04-07

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

  1. Look for repeated sequences and note their spacing, or compute the coincidence statistic.
  2. Pick the most plausible key length.
  3. 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.