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 adherence molehill is made up of multiple pure adherence molehills. Coercion stance, there ability be five divergent pure adherence molehills authenticationd; the detail undivided authenticationd changes with the pose of each tindividual of the plaintext. .Coercion stance: Assume we enjoy a guideword: apple - This guideword conciliate repeat: appleappleapple.... - The apostacy of each communication in the guideword is the offset n (from your statute in Labl, except here you demand to authentication the ASCII consideration). Our plaintext is: ENGINEER - Our molehilltext conciliate be: &753&53 if you authentication ord and chr with modulus 128 (the unimpaired ASCII consideration) -This is the encoding or encrypting separate Now coercion 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 discharge coercion the adherence molehill. Please admit the authenticationr to input any guide. In the overhead stance, it was APPLE, except it could be any guideword: WHITE, AVERYLONGWORDMANYTIMESOVER Using python

    A polyalphabetic adherence molehill is made up of multiple pure adherence molehills. Coercion stance, there ability be five divergent pure adherence molehills authenticationd: the detail undivided authenticationd changes with the pose of each tindividual of the plaintext. Coercion stance: Assume we enjoy a guideword: apple This guideword conciliate repeat: appleappleapple…. The apostacy of each communication in the guideword is the offset “n” (from your statute in Lab1, except here you demand to authentication the ASCII consideration). Our plaintext is: ENGINEER Our molehilltext conciliate be: & > 753&53 if you authentication ord and chr with modulus 128 (the unimpaired ASCII consideration) This is the encoding or encrypting separate Now coercion 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 discharge coercion the adherence molehill. Please admit the authenticationr to input any guide. In the overhead stance, it was APPLE, except it could be any guideword: WHITE, AVERYLONGWORDMANYTIMESOVER absence of wonder..

    Expert Tally

     

    Copyable Statute:

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

    conspicuous = [‘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 rule : ‘))

    notice = input(‘Enter notice : ‘)

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

    if choise == 2:

    guide = -key

    coercion char in notice:

    if char.islower():

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

    if char.isupper():

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

     

    translate += char

    print translate