Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Cyphertext: Encode and Decode 1 . 1 Recall that in Practice Exercises you implemented a cypher text generator, which encrypts a string by

1. Cyphertext: Encode and Decode
1.1 Recall that in Practice Exercises you implemented a cypher text generator, which encrypts a
string by switching every letter at alphabetical position i with the uppercase letter at alphabetical
position 25-i.
In this assignment, you are asked to reimplement it using a function:
Function: cypher(s)
Input: s, a string object
Return: the cypher text corresponding to s
Save the file in ps01_01.py. Test your function by passing it with a meaningful sentence.
Test your function again by passing the string returned by the function from the previous test.
Did you notice that the function can encode as well as decode? Explain why. Use your program
to decode the following: VEVIBLMV HSLFOW GZPV NRHG.6150! What does it say?
1.2 You notice that digits are not encrypted. Improve your program so that any digit at position i
in digits 0-9 is replaced with the digit at 9-i. Save the improved program in ps01_01i.py. What is
the encrypted value of 6150?

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

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

LO2 Distinguish among three types of performance information.

Answered: 1 week ago