Question: Write a program to encrypt a message using a specified base for encoding. The program should include the following two functions: def encrypt _ message
Write a program to encrypt a message using a specified base for encoding. The program should
include the following two functions:
def encryptmessage message base
The encryptmessage function should take a message as input and a base from to
from the user in the input box.
For simplicity, only consider accepting characters AZ az and space. Let uppercase
letters AZ correspond to decimals lowercase letters az correspond to decimals
space correspond to
The output should be the encrypted message, for example:
encryptmessageI am on my way
should return the following output:
decryptmessageencryptedmessage, base
The decryptmessage function should take the encrypted message and the base
from to that was used during encryption.
The encrypted message consists of numbers in the given base, which correspond to the
original characters.
The function should reverse the encryption process by converting the values back to their
respective characters and returning the decrypted message.
Requirements:
Your program should print the encrypted message without any space
Your program should detect the space when scanning the encrypted message for
decryption.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
