Question: Write a Python program to implement Ceasar cipher. Caesar cipher is used to encrypt text by replacing each letter by another letter that comes after

Write a Python program to implement Ceasar cipher. Caesar cipher is used to encrypt text by replacing each letter by another letter that comes after it in the alphabet by a fixed number of letters(encryption number n). If the last letter of the alphabet (letter 'z') is reached. the program continues to count from the beginning of the alphabet (letter 'a'). The user enters the text and the encryption number {n}, and the program prints the encrypted text. The program can be used to decrypt an encrypted text by entering the encrypted text and the negative value of the encryption number {-n}.

Example 1:

Enter message: Hello World!

enter encryption key:5

ans: Mjqqt Btwqi!

Example 2:

Enter message:Mjqqt Btwqi!

enter encryption key:5

ans: Hello World!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!