Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 3. Caesar Cipher Caesar Cipher is an encryption technique. It is a type of substitution cipher in which each letter in the plaintext is

image text in transcribed
Homework 3. Caesar Cipher Caesar Cipher is an encryption technique. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a right shift of 3, A becomes D, B becomes E. .., X becomes A, Y becomes B, Z becomes C (Figure 1). The method is named after Julius Caesar, who used it in his private correspondence. ABCDEF ABCDEF Figure 1. A Caesar Cipher with a right shift of 3 Write a Python program to encrypt three-letter words using the Caesar Cipher: 1) Ask the user to input a three-letter word and the number of shifts. 2) Convert the word based on the number of shifts. If the number of the shifts exceeds 26, start from the beginning of the alphabet (e.g. shifting by 28 is the same as shifting by 2). 3) The program should resemble the following. Include the exit line. Upload the .py file and the output screenshot on Canvas. Enter a 3-letter word: bts Shift? 60 BTS is encrypted to JBA. Press Enter to Exit. Hint: Use the ref string in the slides examples. Some care needs to be taken when starting over from the alphasbet (e.g. S-A). Step 1: Get the first letter from the 3-letter word. Step 2: "Shift" the letter along the ref string - what is its index in ref and what is the index for the shifted letter? Step 3: Repeat the previous steps for the other two letters. Step 4: Concatenate the new letters

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions