Breaking Vigenere

And Other Fun with Cryptography

Karim Said
1 min readSep 4, 2017

I’ve been messing around with some basic cryptography challenges ever since DEFCON, which was a ton of fun and very informative. The most recent challenge involved breaking a Vigenere cipher (also known as a repeating key XOR).

Here’s the basic algorithm:

1. Calculate normalized Hamming distances for various key sizes, and take the smallest one.
2. Chunk cipher text into key-sized chunks.
3. Transpose the chunk bytes.
4. Find the single-byte XOR key for each transposed chunk with frequency analysis.
5. Concatenate the keys, and find your plain text.
6. ???
7. Profit!

Fun stuff! So satisfying to see the plain text at the end of a challenge.

--

--