Browse Source

Day 12 solved

Roman Hergenreder 4 years ago
parent
commit
3cdd94b727
3 changed files with 12 additions and 0 deletions
  1. 1 0
      .gitignore
  2. BIN
      Day 12/BackToBasic.exe
  3. 11 0
      Day 12/decode.py

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+__pycache__

BIN
Day 12/BackToBasic.exe


+ 11 - 0
Day 12/decode.py

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