Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions