Skip to main content
Challenges Repeating-key XOR
Cryptography Medium Repeating key Solves: 4

Repeating-key XOR

Author: CyberSamSU
Points
40

To encrypt a long text with a short key, the key is repeated in a cycle: ct[i] = pt[i] ^ key[i % len(key)]. This method is the binary version of the Vigenère cipher.

Its vulnerability is this: if the key length is L, the text can be divided into L columns and each column becomes a simple single-byte XOR. That is, one difficult challenge is divided into L very easy challenges.

This time the key length is known: L = 5. The key itself is unknown. The ciphertext is in the attached file shifrmatn.txt (in hex format).

When solving a column, try 256 keys and score the result: +3 for a space, +2 for a lowercase letter, a large minus for a non-printable byte. The key that scores the highest is the correct key. Do not rely only on the shortcut "most frequent byte = space": in the Uzbek language, vowels are also very frequent, and in some columns a or i will overtake the space.

Attached files
shifrmatn.txt Log in to download
SHA-256 checksums
shifrmatn.txt: 7752f5c34bca29547533be8a75eaa4312c9b9ff706fbb2d5c0c83677a84e6bad
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −4 pts Log in
Hint 2 −8 pts Log in
Hint 3 −12 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 26.10.2026
3. Odam 05.11.2026
4. arcanum 11.11.2026