2020.06.27 redpwn

Redpwn 2020 Crypto - 12 Shades of Redpwn

CTF writeup: redpwnCTF 2020's 12 Shades of Redpwn makes the color wheel do arithmetic. Map hues to base-12 digits and convert the result to text.

Event
redpwn
Category
crypto
Topic
Crypto
Published
Markdown source Attached files Read article
Cite

Copy this citation into your bibliography, or download the BibTeX file.

Download .bib
PDF

12-shades-of-redpwn

Description

Plain text
Everyone's favorite guess god Tux just sent me a flag that he somehow encrypted with a color wheel!

I don't even know where to start, the wheel looks more like a clock than a cipher... can you help me crack the code?

Files

Twelve colored circles arranged like a clock, progressing from yellow through red, purple, blue, and green.

Colored ciphertext blocks, quarter 1 of 4. Colored ciphertext blocks, quarter 2 of 4. Colored ciphertext blocks, quarter 3 of 4. Colored ciphertext blocks, quarter 4 of 4.

Lets think like a clock, and start numbering colors from 0-11

Color wheel labeled clockwise 0 through 9, 10/a, and 11/b, with 0 on yellow.

And if we map the corresponding numbers, we get

Colored ciphertext pairs labeled with base-12 values, quarter 1 of 4. Colored ciphertext pairs labeled with base-12 values, quarter 2 of 4. Colored ciphertext pairs labeled with base-12 values, quarter 3 of 4. Colored ciphertext pairs labeled with base-12 values, quarter 4 of 4.

Plain text
86 90 81 87 a3 49 99 43 97 97 41 92 49 7b 41 97 7b 44 92 7b 44 96 98 a5

Now, we know that the flag begins with the prefix flag{, which helps us easily guess what it is, since 'f' and 'l' differ by 4, here the ciphertext also differs by 4 i.e 90-86. Also, 'l' and 'a' differ by 11, which confirms, that it is base 12 encoding.

Voila, here we go

Python
EXTRACTED = '86 90 81 87 a3 49 99 43 97 97 41 92 49 7b 41 97 7b 44 92 7b 44 96 98 a5'

flag = ''.join([chr(int(i,12)) for i in EXTRACTED.split()])
print(flag)

flag = flag{9u3ss1n9_1s_4n_4rt}