Created
December 13, 2018 01:19
-
-
Save bhrdn/280aee03b8d7b3203e72dde1855307ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import ascii_lowercase as u | |
import string | |
with open('secret.txt') as f: | |
datas = f.read().splitlines() | |
datas = { | |
'plain': datas[0], | |
'key': map(lambda x: -int(x), datas[1].split(',')) | |
} | |
assert len(datas['plain']) == len(datas['key']) | |
flag, shift = "", lambda x, y: x.lower().translate(string.maketrans(u, u[y:] + u[:y])) | |
for index, data in enumerate(datas['plain']): | |
flag += shift(data, datas['key'][index]) | |
print flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment