[pycrypto] Typo or bug?

Dave Pawson dave.pawson at gmail.com
Tue Jun 26 06:19:49 EDT 2012

On 26 June 2012 10:52, Legrandin <gooksankoo at hoiptorrow.mailexpire.com> wrote:
>>   encobj = AES.new(secret, AES.MODE_CFB)
>>   File "/usr/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.py",
>> line 141, in __init__
>>   self._cipher = factory.new(key, *args, **kwargs)
>> ValueError: IV must be 16 bytes long
>> So although the 'secret' is 16 bytes long, I'm getting a report saying it
>> isn't?
> Hi Dave,
> The key is OK, but the IV is missing and it is mandatory for CFB.
> Your code should be:
> encobj = AES.new(secret, AES.MODE_CFB, some_iv)
> where len(some_iv)==16.

Next question (bet you saw this coming)...
some_iv? Any explanation of this call please?
What should it be?

Sorry to sound so newbie... This code has worked well for a year or more?


Dave Pawson
Docbook FAQ.

More information about the pycrypto mailing list