Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from base64 import b64decode
- sys.stdin = open(r"path to messages.txt")
- def caesar_cipher(text, shift):
- result = ""
- for char in text:
- if char.isalpha():
- start = ord('A') if char.isupper() else ord('a')
- result += chr((ord(char) - start + shift) % 26 + start)
- else:
- result += char
- return result
- def decode(line):
- s = b64decode(line.split()[2])
- ciphertext = caesar_cipher(str(s)[2:-1], 13)
- return ciphertext
- while True:
- plaintext = input()
- print(decode(plaintext))
Add Comment
Please, Sign In to add comment