[pycrypto] PyCrypto Blowfish CFB limitation

Webie assie181 at gmail.com
Wed Jun 6 11:50:31 EDT 2012


Hi,

I am getting "ValueError: Input strings must be a multiple of the
segment size 8 in length" when trying to decrypt a file by using
Blowfish in CFB mode. The file length is not a multiple of 8. However,
OpenSSL doesn't require file length to be multiple of 8 and it
successfully decrypts the file.

You can see the problem in action by downloading and running
http://dl.dropbox.com/u/1522424/PyCrypto-limitation.tar
(segment_size=64 is required for compatibility with OpenSSL).

1. Is this a limitation imposed by PyCrypto?

2. I could successfully decrypt and inflate the file by padding it
with "x" (randomly chosen). Is this safe and correct?

Thanks!


More information about the pycrypto mailing list