Day 12 solved
This commit is contained in:
parent
fe3774642f
commit
3cdd94b727
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
__pycache__
|
BIN
Day 12/BackToBasic.exe
Normal file
BIN
Day 12/BackToBasic.exe
Normal file
Binary file not shown.
11
Day 12/decode.py
Normal file
11
Day 12/decode.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
def xor(str1, str2):
|
||||||
|
l = min(len(str1), len(str2))
|
||||||
|
return "".join(chr(int(str1[i]) ^ int(str2[i])) for i in range(l))
|
||||||
|
|
||||||
|
str3 = b"6klzic<=bPBtdvff'y\x7fFI~on//N" # expected input encrypted
|
||||||
|
str1 = b"AAAAAAAAAAAAAAAAAAAAAAAAAAA" # input
|
||||||
|
str2 = b"GFIHKJMLONQPSRUTWVYX[Z]\_^a" # input encrypted
|
||||||
|
key = xor(str1, str2).encode("UTF-8") # key
|
||||||
|
print("HV19{%s}" % xor(str3, key))
|
Loading…
Reference in New Issue
Block a user