Damjan Cvetko

Damjan Cvetko

Developer, System Architect, Hacker.

2 minutes read

Challenge: Santa has got an essential song locked away in the attached file, but now he forgot the key. He was interested in the basic building blocks of modern cryptography; also he was reading a lot about politics. Can you help him figure out the key so everyone could listen to this song on repeat?

Attached file: crypto1.txt

This one occupied me for quite a while. First things I went to brush up my understanding of “basic building blocks of modern cryptography”. This video sums things up quite well. The knowledge would be useful in later challenges too. But, without more experience if sent me into some wild directions… So, is it Substitution? An what is this “politics” reference?

Basic examples of early ciphers are the Cesar cipher and Vigenere cipher. Could that be the reference?

Looking at the raw values, I also made some observations:

  • All values are int the range of 0x00 - 0x7f
  • A lot of pairs are repeating

Could it be a lookup table I have to guess? I then started to lean towards XOR, but what is the key? There’s another hint, “repeat”… I tried to write some helper programs, that would guess the XOR key based on what we were looking for (xmas{) but made false assumptions and failed there..

Then by googling I found this: https://github.com/hellman/xortool

A tool to do some xor analysis:

  • guess the key length (based on count of equal chars)
  • guess the key (base on knowledge of most frequent char)

This is the output:

Wait, “covfefe”? I know covfefe… So it’s modern/present day politics! :)

Looking af the produced key and decoded files, the right key was “COVFEFE”.

The tool has a good success rate because the plain text has a lot of repetitions and some well known printable charset.

Flag: xmas{D0n4ldJustW4ntsS0meCovf3f30nTwi113r!}

What did I learn: There are tools! Don’t try to do it all by yourself. And somethings about “the basic building blocks of modern cryptography”.

Recent posts

See more

Categories

About