In this article, you will learn how to make custom Encryption and Decryption with python. To understand this program, you should have knowledge of the following Python Programming topics:

 

Problem Definition

Write a program that encryption and decryption the user input. Note – Your input should be only lowercase characters with no spaces. Your program should have a secret distance given by the user that will be used for encryption and decryption. Each character of the user’s input should be offset by the distance value given by the user

For Encryption:

  • Take the string and reverse the string.
  • Encrypt the reverse string with each character replaced with distance value (x) given by the user.

For Decryption:

  • Take the string and reverse the string.
  • Decrypt the reverse string with each character replaced with distance value (x) given by the user.

Sample:

The program should ask the user for input to encrypt and then display the resulting encrypted output. Next, your program should ask the user for input to decrypt and then display the resulting decrypted output.

 

Program Solution

Encryption and Decryption with python

Leave a Comment