Question: Write python program for the Affine cipher with the following requirements: ( 1 ) Define a function to encrypt with the following header. It takes
Write python program for the Affine cipher with the following requirements:
Define a function to encrypt with the following header. It takes in an English message
containing letters only and a pair of keys between and inclusively, with a as the
multiplicative key and as the additive key, and returns the ciphertext:
def encryptmessage a b:
Define a function to decrypt with the following header. It takes in a ciphertext and a pair of
keys between and inclusively, with a as the multiplicative key and b as the additive
key, and returns the ciphertext:
def decryptmessage a b:
Define a main function. First, it asks user what to do: encrypt or decrypt. Once the user
makes the choice, it then asks for the text and the keys. It should output the corresponding
results.
def main:
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
