pyre_1
~# cat Question
Python Rev, where all compilation has been decompiled and you're left with the source code in its entirety!
FILE: trial.exe
trial.exe
The challenge provides a Python script with a custom encryption function pyre_1
and a set of encrypted strings strings
. The goal is to recover the flag by reversing the encryption process.
Solution
Understanding the Encryption Function
pyre_1
The
pyre_1
function XORs each byte of the message with a corresponding byte from the key.The key is repeated cyclically if it's shorter than the message.
Decrypting the Strings
Each string in the
strings
list is formatted as<key>.<encrypted_message>
.We then decode the base64 key and message by XORing them to recover the original message.
Recovering the Flag
We can apply the XOR operation to each encrypted string with the decoded key to recover the flag.
Flag: LNC24{pYth0n_reVer5iNG_is_s0_mUCH_3as1er_tH4n_b1n4ri5s}
Last updated