[pycrypto] Typo or bug?

Legrandin gooksankoo at hoiptorrow.mailexpire.com
Tue Jun 26 05:52:50 EDT 2012


>
>   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 part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120626/7afc9474/attachment.html>


More information about the pycrypto mailing list