You only need to calculate A+B to get the flag! Wait, what were A and B...?
Beginner Hint 1
- Your goal is to recover the value of
FLAGfrom the values written inoutput.txt. - The
bytes_to_longfunction is provided by thepycryptodomepackage. - The same package also provides the inverse function,
long_to_bytes. Once you have recoveredFLAGas an integer, you can use this function to convert it back into the original string.
Beginner Hint 2
- A well-known identity relating addition and bitwise operations is
A + B = (A xor B) + 2 * (A and B). A good starting point is to understand why this identity holds.