[pycrypto] AES CFB with 128 bit feedback size

Brendan Simon (eTRIX) brendan.simon at etrix.com.au
Tue Jul 20 22:43:55 CST 2010


 I _need_ to decrypt some data that _is_ encrypted with AES using 128
bit CFB.  i.e. feeback size is 128 bits.

I tried MODE_CFB with PyCrypto but the data did not decrypt correctly.
Reading the docs a little closer I see that PyCrypto only seems to
implement 8 bit CFB.

Is there any way to set the feedback size to 128 (or other sizes: 64,
32, 16 or 8 bits) ??

Just for reference, I am porting some VB code to python, and the
equivalent VB decryption code is :

    Dim myAes as New RijndaelManaged()
    myAes.FeebackSize = 128
    myAes.Mode = CipherMode.CFB
    myAes.Key = key
    myAes.IV = iv
    myAes.Padding = PaddingMode.None


If there is no way of doing this with PyCrypto, then I guess I will have
to fall back to using ECB and doing the feedback myself.  Not too
difficult, but it would be nice if PyCrypto had the option of specifying
the CFB Feeback size :)

Thanks, Brendan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dlitz.net/pipermail/pycrypto/attachments/20100721/d5baa07b/attachment.html 


More information about the pycrypto mailing list