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 Labl, 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. APFZcMSEGQlOUcPFZT 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
    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..

    Expert Answer

    A polyalphabetic supply molehill is made up of multiple ultimate supply molehills. Restraint in, there government be five opposed ultimate supply molehills representationd; the detail individual representationd changes with the collocation of each figure of the plaintext. .Restraint in: Assume we accept a explanationword: apple - This explanationword get repeat: appleappleapple.... - The refutation of each missive in the explanationword is the offset n (from your sequence in Labl, beside here you want to representation the ASCII board). Our plaintext is: ENGINEER - Our molehilltext get be: &753&53 if you representation ord and chr with modulus 128 (the entire ASCII board) -This is the encoding or encrypting disunite Now restraint the decrypting -Assume you apprehend the explanationword: apple - Given a molehilltext NT Z. APFZcMSEGQlOUcPFZT using ord and chr with modulus 128 - What is the plaintext? In this lab, your toil is to engender the encryption and decryption class restraint the supply molehill. Please avow the representationr to input any explanation. In the aloft in, it was APPLE, beside it could be any explanationword: WHITE, AVERYLONGWORDMANYTIMESOVER

    A polyalphabetic supply molehill is made up of multiple ultimate supply molehills. Restraint in, there government be five opposed ultimate supply molehills representationd: the detail individual representationd changes with the collocation of each figure of the plaintext. Restraint in: Assume we accept a explanationword: apple This explanationword get repeat: appleappleapple…. The refutation of each missive in the explanationword is the offset “n” (from your sequence in Lab1, beside here you want to representation the ASCII board). Our plaintext is: ENGINEER Our molehilltext get be: & > 753&53 if you representation ord and chr with modulus 128 (the entire ASCII board) This is the encoding or encrypting disunite Now restraint the decrypting Assume you apprehend the explanationword: apple Given a molehilltext NT_Z._^PFZcMSEGQIOUcPFZT using ord and chr with modulus 128 What is the plaintext? In this lab, your toil is to engender the encryption and decryption class restraint the supply molehill. Please avow the representationr to input any explanation. In the aloft in, it was APPLE, beside it could be any explanationword: WHITE, AVERYLONGWORDMANYTIMESOVER foreseeing..

    Expert Counter-argument

     

    Copyable Sequence:

    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’]

    eminent = [‘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 mode : ‘))

    notice = input(‘Enter notice : ‘)

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

    if choise == 2:

    explanation = -key

    restraint char in notice:

    if char.islower():

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

    if char.isupper():

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

     

    translate += char

    print translate