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:
(1) Define a function to encrypt with the following header. It takes in an English message
(containing 26 letters only) and a pair of keys (a,b between 0 and 25 inclusively, with a as the
multiplicative key and b as the additive key, and returns the ciphertext:
def encrypt(message, a, b):
(2) Define a function to decrypt with the following header. It takes in a ciphertext and a pair of
keys (a,b) between 0 and 25 inclusively, with a as the multiplicative key and b as the additive
key, and returns the ciphertext:
def decrypt(message, a, b):
(3) 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():
Write python program for the Affine cipher with

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 Programming Questions!