2020.06.27 redpwn

Redpwn 2020 Crypto - 12 Shades of Redpwn

Redpwn 2020 Crypto - 12 Shades of Redpwn writeup: cryptography, known_plaintext, guess, base12

Event
redpwn
Category
crypto
Topic
Crypto
Published

12-shades-of-redpwn

Description

Plain text3 lines / static highlight
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.

A sequence of 24 pairs of colored blocks forming the encrypted message.

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 the base-12 values transcribed below.

Plain text1 line / static highlight
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

Python4 lines / static highlight
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}