Question: Task 2 : Encrypting with AES 1 2 8 - OFB Problem Statement: You need to encrypt a string using AES 1 2 8 in
Task : Encrypting with AESOFB
Problem Statement: You need to encrypt a string using AES in Output Feedback OFB mode.
Your Specific Inputs:
String to Encrypt: "Salam Alaikom wa Rahmat Allah wa Barakatoh,
Key: aececcbb
IV Initialization Vector: fcac
Your Student ID:
Python Code Snippet:from Crypto.Cipher import AES
import hashlib
def encryptaesofbinputstr key, iv:
cipher AES.newkey AES.MODEOFB, iv
ciphertext cipher.encryptinputstrencodeutf
return ciphertext
def getshahashdata:
return hashlib.shadatahexdigest
if namemain:
key b
iv b
inputstring
encrypteddata encryptaesofbinputstring, key, iv
printSHA Hash of Encrypted Output:", getshahashencrypteddata
Expected Output: You should provide the SHA hash of the encrypted output, ensuring your code can encrypt any string using the same key and IV to achieve full score.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
