DEV Community

Curious4AI
Curious4AI

Posted on AI-assisted

A binary CTF riddle that came down to one byte at a time

The "Binary Riddle" challenge on Com Olho gave me a line of binary numbers. Each group had eight digits.

The description said something seemed off. The hint was more useful: the answer should be 26 characters long, start with "FL" and end with "m}".

I worked through it with AI help. This writeup leaves out the flag and the full challenge input, so you can still try it yourself.

Start with the grouping

Eight bits make one byte. That made text decoding a reasonable first check.

The first two groups were:

01000110 01001100
Enter fullscreen mode Exit fullscreen mode

In decimal, those are 70 and 76. Their ASCII characters are F and L.

That matched the hint. No need to try a cipher yet.

Decode with Python

This is the same method with a different input, not the challenge flag:

binary = "01001000 01100101 01101100 01101100 01101111"

text = "".join(chr(int(byte, 2)) for byte in binary.split())
print(text)
# Hello
Enter fullscreen mode Exit fullscreen mode

split() separates the groups. int(byte, 2) reads each one as a base-2 number. chr() turns that number into a character.

For this puzzle, the values fit ASCII. For other files, I wouldn't assume every byte maps directly to a readable character.

Check the answer, not just the first letters

Applying that decoder to the challenge input produced 26 characters. The beginning and ending matched both parts of the hint.

I also kept the capitalization and symbols exactly as decoded. The challenge said to paste the flag as it was, so "cleaning up" the mixed case would have changed the answer.

This is a decoding result. I'm not claiming a platform acceptance screenshot here.

What I took from it

The description made the puzzle sound stranger than it was. The byte grouping and the length hint gave a simpler explanation.

My first check for another binary text puzzle will be the same: look at the group size, decode a few groups, then see whether the result fits the clues. If it does, finish the decode before adding more complicated steps.

Top comments (0)