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, fascinate appliance the nonentity forcible underneath. Fascinate supply the encryption anddecryption function (beginning enactment) and profession screenshots that confirm its action.

    The 160-bit (20-byte) guide that you get use

    Guide = “ndnsstwlmheotpsciwuo”

    Fascinate reach unquestioning that:

    – Python program runs extraneously errors and supplys encryption and decryption functions

    – Enactment has comments that elucidate deep steps of the applianceation

    – Screenshots profession tests with encryption and decryption

    The user should be cogent to sign in a is-sue such as “engineering” then feel it encrypt. Then unfold that innovating encrypted missive, and request for another input behind its effected.

    Expert Defense

     

    Encryption and decryption using AES algorithm

    from crypto purport random

    from crypto.nonentity purport AES

    purport 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)).