Question: on python PROJECT 1 DESCRIPTION Write 2 functions that perform a Caesar Cipher on a string. A Caesar Cipher is a classic example in cryptography
on python
PROJECT 1 DESCRIPTION Write 2 functions that perform a "Caesar Cipher" on a string. A Caesar Cipher is a classic example in cryptography wherein a user encodes a message by using a shift in the alphabet (explained below) . They give their key to the decoder, and with that key, the decoder can read the intended message from apparent gibberish. When you finish your project, you can upload your solution (just your code, NOT including sample input/output) to Blackboard as a .txt file. Please do not upload a .py file!! Good luck! Problem 1. Write a function with the following description: def encryption(S, n): input: A string S consisting of only lower case letters and empty spaces of arbitrary length, and n, an integer; output: A string w-T+str(n). is a string which has been encrypted by replacing each letter in the string S by a letter n letters ahead in the alphabet. For example, encryption( "hello", 0) return hello0. encryption ( "hello world", 1) returns "ifmmp xpsme1", that is, each letter has been replaced by one letter ahead of it. Empty space character remains unchanged. Note that the alphabet shifting is circular. Shifting z by 1 letter gives a. Problem 2. Write a function with the following description: def decryption(W): input: A string W, encrypted as described in Problem 1 output: Based on the trailing integer in W, return the original content of the string S. For example, decryption ("ifmmp xpsmel") returns "hello world
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
