[pycrypto] PyCrypto Blowfish CFB limitation

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


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
(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?


More information about the pycrypto mailing list