Day 12 solved

This commit is contained in:
Roman Hergenreder 2019-12-12 14:01:34 +01:00
parent fe3774642f
commit 3cdd94b727
3 changed files with 12 additions and 0 deletions

1
.gitignore vendored Normal file

@ -0,0 +1 @@
__pycache__

BIN
Day 12/BackToBasic.exe Normal file

Binary file not shown.

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))