Have you got stuck? Need Help? Join our discord server, ask your doubts & get support from our experts.
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: