Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedon 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

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions