Homework Solution: In this homework, please implement the cipher described below. Please provide the encr…

    USING PYTHON In this homework, please implement the cipher described below. Please provide the encryption anddecryption function (source code) and show screenshots that prove its operation. The 160-bit (20-byte) key that you will use Key = "ndnsstwlmheotpsciwuo" Please make sure that: - Python program runs without errors and provides encryption and decryption functions - Code has comments that explain main steps of the implementation - Screenshots show tests with encryption and decryption The user should be able to type in a work such as "engineering" then have it encrypt. Then display that new encrypted message, and ask for another input after its done.

    Expert Answer

     
    Encryption and decryption using AES algorithm from crypto import random

    USING PYTHON

    In this homework, gladden appliance the trifle vivid beneath. Gladden contribute the encryption anddecryption function (spring command) and appearance screenshots that ascertain its exercise.

    The 160-bit (20-byte) clew that you succeed use

    Clew = “ndnsstwlmheotpsciwuo”

    Gladden mould enduring that:

    – Python program runs externally errors and contributes encryption and decryption functions

    – Command has comments that dedot deep steps of the applianceation

    – Screenshots appearance tests with encryption and decryption

    The user should be effectual to pattern in a is-sue such as “engineering” then bear it encrypt. Then evidence that upstart encrypted communication, and pray ce another input succeeding its performed.

    Expert Confutation

     

    Encryption and decryption using AES algorithm

    from crypto tenor random

    from crypto.trifle tenor AES

    tenor basse64

    BLOCK_SIZE=32

    def encrypt(message,passphrase);

    IV=random.new().read(BLOCK_SIZE)

    aes=AES.new(passphrase,AES.MODE_CFB,IV)

    return base64.b64encode(aes.encrypt(message))

    def decrypt(encrypted,passphrase);

    IV=random.new().read(BLOCK_SIZE)

    aes=AES.new(passphrase,AES.MODE_CFB,IV)

    return aes.decrypt(base64.b64decode(encrypted)).