I am trying to figure out why my Python client and the Ruby server are having a disagreement about how to encrypt data. The only difference I see in the Ruby code and my code is that they are not specifying the Initialization Vector, therefore its falling back to the default of all \x0's
When I try to instantiate PyCrypto without the iv it gives me an error. Here is an example:
from Crypto.Cipher import AES
test = "Very, very confidential data"
key = b'Thirty Two Byte key, made Beef y'
gryp = AES.new(key, AES.MODE_CBC)
(This example is essentially the example code from the PyCrypto docs without specifying the IV) The docs say w/r/t the IV " It is optional and when not present it will be given a default value of all zeroes." However I get the error "ValueError: IV must be 16 bytes long".
So I could specify the IV, that is not the problem pre se, but I am trying to figure out that if it thinks it cannot use the default, if there is something else wrong with the way I am using the library.