InCTF Jr 2022
August - November, 2022
InCTF Jr

exclusive-OR

Easy Crypto

Author: Sahith

Given that the length of the flag is 24 bytes.

The encryption algorithm in provided in python as a chall.py file:

And the output.txt file has the ciphertext

Looking into chall.py, we can see that:

-> the plaintext has been divided into blocks of 16 bytes each.

-> and a random single byte has been used as a key to xor against every block.

Exploit:

We can convert the given hexstring to bytes and then seperate them into blocks of 16 bytes each.

Then bruteforce the single byte used for every block and check if the flag format exists in the plaintext.

Script: