Day 12 solved

This commit is contained in:
Roman committed 2019-12-12 14:01:34 +01:00
1 parent fe3774642f
commit 3cdd94b727
3 files changed
+12

No files matched your search

+1
View File
@@ -0,0 +1 @@
__pycache__
Binary file not shown.
+11
View 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))