intro lesson 6
This commit is contained in:
parent
1c7b2f2e64
commit
e3dd61f8d0
2 changed files with 24 additions and 1 deletions
11
intro.py
11
intro.py
|
|
@ -29,3 +29,14 @@ def int_to_message_rsa(input: int) -> str:
|
|||
# Challenge intro-5
|
||||
def xor_13(input: str) -> str:
|
||||
return xor(input, 13).decode("utf-8")
|
||||
|
||||
|
||||
# Challenge intro-6
|
||||
def unxor_flag(
|
||||
key1: str, key2_key1: str, key2_key3: str, flag_key1_key3_key2: str
|
||||
) -> str:
|
||||
key_1 = int_to_message_rsa(key1)
|
||||
key_2 = xor(int_to_message_rsa(key2_key1), key_1)
|
||||
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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue