Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I am working on a python programming assignment and I am having some trouble. I cant seem to figure out how to decrypt a

Hello, I am working on a python programming assignment and I am having some trouble. I cant seem to figure out how to decrypt a plain text Caesar cipher. Here are the instruction and below that is my code. PLEASE HELP!

Create a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher.

The script should work for any printable characters.

An example of the program input and output is shown below:

Enter the coded text: Lipps${svph% Enter the distance value: 4 Hello world! 

defdecrypt(encryptedText,distance):

plainText=''

foriinencryptedText:

newDistance=ord(i)-(distance%128)

ifnewDistance<0:

newDistance=128+newDistance

plainText=plainText+chr(newDistance)

returnplainText

encryptedText=input("Enterthecodedtext:")

distance=input("Enterthedistancevalue:")

print(decrypt(encryptedText,distance))

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Describe the site, major events, and outcomes of glycolysis.

Answered: 1 week ago

Question

When would it be feasible and advisable for

Answered: 1 week ago

Question

Discuss How do you implement Atomicity and Durability?

Answered: 1 week ago

Question

Discuss about Complex integrity constraints in SQL?

Answered: 1 week ago

Question

Explain about Schema refinement in Database design?

Answered: 1 week ago

Question

Illustrate Concurrent execution of transaction with examples?

Answered: 1 week ago