View on GitHub

cyber-camp-2020-writeup

Cyber Camp 2020 CTF by SANS Institute Writeup

CH02

Category Points Difficulty
Crypto 500 Hard

Solution

After extracting the file, we are given three files, crypt1.enc, plain1.txt, and sample.enc. These files don’t seem to be using anything special for encryption, so we can guess that we will need to XOR the files. XOR is a reversible way to encrypt stuff, and works mathematically like so: a ^ b = c, and because it’s reversible, we can say that c ^ b = a. This can be applied to crypto like so: plain ^ key = encrypted, and encrypted ^ key = plain. We are given enough files to get a key: the decrypted and encrypted samples. Using XOR logic, we can say that plain1.txt ^ encrypted = key, but we need a program to do that. Using this StackExchange answer, I derived the key, and used it again to get the plaintext of the crypt1.enc file.

Flag: Full_Xor'd_Jacket_Private