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
|
|
@ -5,6 +5,7 @@ from intro import (
|
|||
int_to_message_rsa,
|
||||
xor_13,
|
||||
unxor_flag,
|
||||
mystery_xor,
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
@ -20,4 +21,5 @@ if __name__ == "__main__":
|
|||
0xc1545756687e7573db23aa1c3452a098b71a7fbf0fddddde5fc1,
|
||||
0x04ee9855208a2cd59091d04767ae47963170d1660df7f56f5faf
|
||||
))
|
||||
print(mystery_xor(0x73626960647f6b206821204f21254f7d694f7624662065622127234f726927756d))
|
||||
# fmt: on
|
||||
|
|
|
|||
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