# Homework Solution: A polyalphabetic substitution cipher is made up of multiple simple substitution ciphers. For example, there might be five different simple substitution ciphers u… A polyalphabetic substitution cipher is made up of multiple simple substitution ciphers. For example, there might be five different simple substitution ciphers used: the particular one used changes with the position of each character of the plaintext. For example: Assume we have a keyword: apple This keyword will repeat: appleappleapple.... The index of each letter in the keyword is the offset "n" (from your code in Lab1, but here you need to use the ASCII table). Our plaintext is: ENGINEER Our ciphertext will be: & > 753&53 if you use ord and chr with modulus 128 (the whole ASCII table) This is the encoding or encrypting part Now for the decrypting Assume you know the keyword: apple Given a ciphertext NT_Z._^PFZcMSEGQIOUcPFZT using ord and chr with modulus 128 What is the plaintext? In this lab, your job is to create the encryption and decryption function for the substitution cipher. Please allow the user to input any key. In the above example, it was APPLE, but it could be any keyword: WHITE, AVERYLONGWORDMANYTIMESOVER etc.. A polyalphabetic superabundance molehill is made up of multiple primal superabundance molehills. Control development, there potentiality be five opposed primal superabundance molehills verificationd: the detail individual verificationd changes with the posture of each mark of the plaintext. Control development: Assume we keep a solutionword: apple This solutionword earn repeat: appleappleapple…. The abjuration of each epistle in the solutionword is the offset “n” (from your jurisdiction in Lab1, beside here you demand to verification the ASCII consultation). Our plaintext is: ENGINEER Our molehilltext earn be: & > 753&53 if you verification ord and chr with modulus 128 (the total ASCII consultation) This is the encoding or encrypting divorce Now control the decrypting Assume you comprehend the solutionword: apple Given a molehilltext NT_Z._^PFZcMSEGQIOUcPFZT using ord and chr with modulus 128 What is the plaintext? In this lab, your work is to educe the encryption and decryption discharge control the superabundance molehill. Please yield the verificationr to input any solution. In the overhead development, it was APPLE, beside it could be any solutionword: WHITE, AVERYLONGWORDMANYTIMESOVER expectation..

## Expert Retort  Copyable Jurisdiction:

inferior = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’]

better = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z’]

translate = ”

print (‘1. Encryptn2. Decrypt’)

choise = int(input(‘Enter the jurisdiction : ‘))

intimation = input(‘Enter intimation : ‘)

solution = int(input(‘Enter solution : ‘))

if choise == 2:

solution = -key

control char in intimation:

if char.islower():

char = inferior[((ord(char)+key)-(ord(‘a’)))%26]

if char.isupper():

char = better[((ord(char)+key)-(ord(‘A’)))%26]

translate += char

print translate