Advertisement
Guest User

pepperino

a guest
Jan 31st, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. key = open('sub_key.txt', 'r')
  2. cipher = open('sub_ciphertext.txt', 'r')
  3. plainText = open('sub_plaintext.txt', 'w')
  4.  
  5. counter = 0
  6. keylist = []
  7. for line in key:
  8. for char in line:
  9. keylist.append(char)
  10.  
  11. for cipherLine in cipher:
  12. for cipherChar in cipherLine:
  13. if not (cipherChar in keylist):
  14. plainText.write(cipherChar)
  15. else:
  16. plainChar = 65 + keylist.index(cipherChar)
  17. plainText.write(chr(plainChar))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement