Question: File Encryption and Decryption Using Python 3.x Write a program that uses the dictionary to assign codes to each letter of the alphabet. For example:
File Encryption and Decryption
Using Python 3.x
Write a program that uses the dictionary to assign "codes" to each letter of the alphabet. For example: codes = { 'A' : '~', 'a' : '`', 'B' :'!', 'b' : '1', 'C' : '@', 'c' : '2', 'D' : '#', 'd' : '3', 'E' : '$', 'e' : '4',\ 'F' : '%', 'f' : '5', 'G' : '^', 'g' : '6', 'H' :, etc...}
Using this example, the letter A would be assigned the symbol `, the letter a would be assigned the symbol `, the letter B would be assigned the symbol !, and so forth.
This program should open a specified text file, read its contents, and then use the dictionary to write an encrypted version of the file's contents to a second file. Each character in the second file should contain the code of the corresponding character in the first file.
Write a second program that opens an encrypted file and displays its decrypted contents on the screen.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
