Question: PYTHON Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. An example of the program interface is shown
PYTHON



Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. An example of the program interface is shown below: Enter the input file name: encrypted.txt Enter the output file name: a Enter the distance value: 3 decrypt. py encrypt.py 2 3 File: decrypt.py 4 Decypts an input string of lowercase letters and prints 5 the result. The other input is the distance value. 7 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 18 print plainText 19 ordValueord(ch) cipherValue ordValue - distance if cipherValue ord('a cipherValue ord z - (distance (ordValue ord'a-1) plainText chr(cipherValue)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
