So I am fairly new to AES en/decryption and I want to decrypt a message, which was encrypted via AES256 (Rjindael). I was given a key and a IV, both as string. Cyphermode is cbc, If this matters.
I use the Crypto Library.
key = "some_key"
iv = "some_iv"
cipher = AES.new(key, AES.MODE_CBC, iv)
message = Crypto.Util.Padding.unpad(cipher.decrypt(ct), AES.block_size)
This code gives me and Error saying 'IV must be 16 bytes long'. I added this under iv but this did not change anything
iv = bytes(iv,'utf-8')
What am I missing here? I am sure it is some basic concept which I missed, so I'd be glad, if you could help out
source https://stackoverflow.com/questions/71115738/given-iv-as-type-string-not-16-bytes-long-aes-decryption-in-python
Comments
Post a Comment