K1ngkai

Untitled

Apr 8th, 2022
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def main():
  2. cypher = {'A': 'M', 'B': 'N', 'C': 'O', 'D': 'P', 'E': 'Q', 'F': 'R', 'G': 'S', 'H': 'T', 'I': 'U', 'J': 'V',
  3. 'K': 'W', 'L': 'X', 'M': 'Y', 'N': 'Z', 'O': 'A', 'P': 'B', 'Q': 'C', 'R': 'D', 'S': 'E', 'T': 'F',
  4. 'U': 'G', 'V': 'H', 'W': 'I', 'X': 'J', 'Y': 'K', 'Z': 'L'}
  5.  
  6. infile = open('texttoencrypt.txt', 'r')
  7. file_contents = infile.read()
  8. infile.close()
  9. uppercase = file_contents.upper()
  10.  
  11. for k,v in cypher.items():
  12. uppercase = uppercase.replace(k,cypher[v])
  13. print(uppercase)
  14.  
  15.  
  16.  
  17.  
  18. main()
Advertisement
Add Comment
Please, Sign In to add comment