Crypto 300 - Everybody Lies
download algorithm.py
Most xor operations cancel out each other especially the token[0-6] except token[7]. As 'token' is reset in the last line of the encoding loop with the 7th character of the sha1 hash of the previous char, we can decrypt all but the first character of the cipher text starting from the end.
We can combine all xor operations
0xfe ^ 0xc3 ^ 0x42 ^ 0x21 ^ 0xc2 ^ 0xf3 ^ 0x27 ^ 0x4c ^ 0x21 ^ 0xfe ^ 0xa3 ^ 0xf0 ^ 0x11 ^ 0x54 ^ 0xca ^ 0x3c ^ 0x20 ^ 0xd1 ^ 0xf2 == 0x38
Here is a ruby script to accomplish the same.
$ ruby everybody_lies.rb
_lied_no_flag_for_you!
With a little guessing game the first character turns out to be 'i'
so the flag is 'i_lied_no_flag_for_you!'
0 comments:
Post a Comment