Home / Expert Answers / Computer Science / modify-the-scripts-of-projects-1-and-2-to-encrypt-and-decrypt-entire-files-of-text-an-example-of-t-pa794

(Solved): Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text. An example of t ...




Modify the scripts of Projects 1 and 2 to encrypt and decrypt entire files of text.
An example of the program interface is sh
2 File: encrypt.py
Project \( 4.3 \)
Encypts a text file. The inputs are the names of
the input file and the output file and
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 Grading When you have completed your program, click the Submit button to record your score. 2 File: encrypt.py Project \( 4.3 \) Encypts a text file. The inputs are the names of the input file and the output file and the distance value. The encrypted code is witten to a new file. (") plaintext = input("Enter a one-word, lowercase message: ") distance = int(input("Enter the distance value: ")) code \( =" \cdots \) for ch in plaintext: ordValue \( = \) ord \( (\mathrm{ch}) \) cipherValue \( = \) ordValue \( + \) distance if ciphervalue > ord \( \left(' z^{\prime}\right): \) ciphervalue \( =\operatorname{ord}\left({ }^{\prime} a^{\prime}\right)+ \) distance \( -1 \) \( \left(\operatorname{ord}\left({ }^{\prime} z^{\prime}\right)\right. \) - ordValue \( \left.+1\right) \) code \( +=\operatorname{chr} \) (cipherValue) print (code)


We have an Answer from Expert

View Expert Answer

Expert Answer


Now we are going to modifying the scripts of projects 1 and 2 to encrypt and decrypt entire files of text. read the file name from the user and open t
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe