Question: PYTHON PROGRAM Instructions decrypt.py encrypt.py Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. 3 File: encrypt.py Encypts
PYTHON PROGRAM


Instructions decrypt.py encrypt.py Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. 3 File: encrypt.py Encypts an input string of lowercase Letters and prints 5 the result. The other input is the distance value An example of the program interface is shown below: 7 Enter the input file name: encrypted.txt Enter the output file name: a Enter the distance value: 3 8 plainText = input("Enter a one-word, lowercase message: ") 9 distance int(input(" Enter the distance value:) 10 code 11 for ch in plainText: 12 13 14 15 16 17 18 print code) 19 Grading ordValue ord(ch) cipherValue ordValue distance if cipherValue ord('z When you have completed your program, click the Submit button to record your score. cipherValue orddistance (ord('z-ordValue 1) code chr(cipherValue) Instructions decrypt.py encrypt. Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. 3 File: decrypt.py 4 Decypts an input string of lowercase letters and prints An example of the program interface is shown below: 5 the result. The other input is the distance value 6 7 Enter the input file name: encrypted.txt Enter the output file nane: a Enter the distance value: 3 8 code raw input( "Enter the coded text: ") 9 distance input(" Enter the distance value:") 10 PlainText 11 for ch in code: 12 13 14 15 16 17 plainText chr(cipherValue) 18 print plainText 19 Grading ordValue -ord(ch) cipherValue ordValue distance if cipherValue ord'a When you have completed your program, click the Submit button to record your score cipherValue ord('z-(distance (ordValue ord'a)-)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
