picoCTF/exercises/144/main.py

16 lines
406 B
Python
Raw Normal View History

2023-08-24 16:40:32 +00:00
def rot13(message):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
subs = {char: alphabet[(i + 13) % 26] for i, char in enumerate(alphabet)}
return ''.join(list(map(
lambda x: subs[x] if x in subs else x,
message
)))
if __name__ == '__main__':
with open("./exercises/144/inputs/input") as file:
input = file.read()
print(rot13(input))