Hackvent_2019/Day 08/decode.py

21 lines
394 B
Python
Raw Permalink Normal View History

2019-12-08 19:19:40 +01:00
#!/usr/bin/python
import base64
import operator
strings = [
b'SlQRUPXWVo\Vuv_n_\\ajjce',
b'QVXSZUVY\ZYYZ[a',
b'QOUW[VT^VY]bZ_',
b'SPPVSSYVV\YY_\\\\]',
b'RPQRSTUVWXYZ[\]^',
b'QTVWRSVUXW[_Z`\\b'
]
def decodeChar(c, i = 0):
return chr((int(c) - 30 - i) % 256)
for s in strings:
decoded = "".join([decodeChar(s[i], i) for i in range(len(s))])
print(decoded)