intro lesson 7: flag XORed with a mystery byte.
This commit is contained in:
parent
e3dd61f8d0
commit
e73c803ae3
2 changed files with 11 additions and 0 deletions
9
intro.py
9
intro.py
|
|
@ -40,3 +40,12 @@ def unxor_flag(
|
|||
key_3 = xor(int_to_message_rsa(key2_key3), key_2)
|
||||
flag = xor(xor(xor(int_to_message_rsa(flag_key1_key3_key2), key_1), key_2), key_3)
|
||||
return flag.decode("utf-8")
|
||||
|
||||
|
||||
# Challenge intro-7
|
||||
def mystery_xor(input: int):
|
||||
str_input = int_to_message_rsa(input)
|
||||
for i in range(1, 128):
|
||||
candidate = xor(str_input, i).decode("utf-8")
|
||||
if candidate.startswith("crypto"):
|
||||
return candidate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue