Homework Solution: imple substitution ciphers used: the particular one used changes with the position of each c…

    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 Using python
    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 unartificial supply molehills. Ce stance, there effectiveness be five contrariant unartificial supply molehills explanationd; the point undivided explanationd changes with the standing of each capacity of the plaintext. .Ce stance: Assume we keep a guideword: apple - This guideword allure repeat: appleappleapple.... - The apostacy of each communication in the guideword is the offset n (from your order in Labl, save here you want to explanation the ASCII consideration). Our plaintext is: ENGINEER - Our molehilltext allure be: &753&53 if you explanation ord and chr with modulus 128 (the all ASCII consideration) -This is the encoding or encrypting dissect Now ce the decrypting -Assume you distinguish the guideword: apple - Given a molehilltext NT Z. APFZcMSEGQlOUcPFZT using ord and chr with modulus 128 - What is the plaintext? In this lab, your business is to invent the encryption and decryption capacity ce the supply molehill. Please grant the explanationr to input any guide. In the over stance, it was APPLE, save it could be any guideword: WHITE, AVERYLONGWORDMANYTIMESOVER Using python

    A polyalphabetic supply molehill is made up of multiple unartificial supply molehills. Ce stance, there effectiveness be five contrariant unartificial supply molehills explanationd: the point undivided explanationd changes with the standing of each capacity of the plaintext. Ce stance: Assume we keep a guideword: apple This guideword allure repeat: appleappleapple…. The apostacy of each communication in the guideword is the offset “n” (from your order in Lab1, save here you want to explanation the ASCII consideration). Our plaintext is: ENGINEER Our molehilltext allure be: & > 753&53 if you explanation ord and chr with modulus 128 (the all ASCII consideration) This is the encoding or encrypting dissect Now ce the decrypting Assume you distinguish the guideword: apple Given a molehilltext NT_Z._^PFZcMSEGQIOUcPFZT using ord and chr with modulus 128 What is the plaintext? In this lab, your business is to invent the encryption and decryption capacity ce the supply molehill. Please grant the explanationr to input any guide. In the over stance, it was APPLE, save it could be any guideword: WHITE, AVERYLONGWORDMANYTIMESOVER foreseeing..

    Expert Response

     

    Copyable Order:

    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 sequence : ‘))

    intimation = input(‘Enter intimation : ‘)

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

    if choise == 2:

    guide = -key

    ce char in intimation:

    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