Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key = open('sub_key.txt', 'r')
- cipher = open('sub_ciphertext.txt', 'r')
- plainText = open('sub_plaintext.txt', 'w')
- counter = 0
- keylist = []
- for line in key:
- for char in line:
- keylist.append(char)
- for cipherLine in cipher:
- for cipherChar in cipherLine:
- if not (cipherChar in keylist):
- plainText.write(cipherChar)
- else:
- plainChar = 65 + keylist.index(cipherChar)
- plainText.write(chr(plainChar))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement