0% found this document useful (0 votes)
26 views1 page

Classwork 3

The document describes the Caesar cipher, an encryption technique that transforms readable text into unreadable text by shifting letters a fixed number of positions in the alphabet. It provides a Python programming task to encrypt three-letter airport codes using the Caesar cipher, requiring user input for the airport code and the number of shifts. Additionally, it includes a hint about handling the wrap-around from Z to A in the alphabet.

Uploaded by

tofu1002022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Classwork 3

The document describes the Caesar cipher, an encryption technique that transforms readable text into unreadable text by shifting letters a fixed number of positions in the alphabet. It provides a Python programming task to encrypt three-letter airport codes using the Caesar cipher, requiring user input for the airport code and the number of shifts. Additionally, it includes a hint about handling the wrap-around from Z to A in the alphabet.

Uploaded by

tofu1002022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Classwork 3.

Caesar Cipher
Caesar cipher is an encryption technique. Like other encryptions, it will transform readable
texts into something unreadable, thereby safeguarding sensitive information. The method is
named after Julius Caesar, who used it in his private correspondence.
Under a Caesar cipher, each letter in the plaintext is replaced by a letter with 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, and Z becomes C (Figure 1).

Figure 1. A Caesar Cipher with a right shift of 3


Write a Python program to encrypt airport codes (e.g., HKG) using the Caesar Cipher:
1) Ask the user to input a three-letter airport code and the number of shifts.
2) Encrypt the word based on the number of shifts and display it.
The program should be capable of the following.

Follow the same submission requirement (.py file and screenshot) as before.

Hint: Use the reference string in the slides examples. Some care needs to be taken when
starting over from the alphabet (e.g., X ↦ A ).

You might also like