Encryption between Python & PHP

Bryan Olson fakeaddress at nowhere.org
Mon Aug 9 02:33:44 EDT 2004


Geoff Caplan wrote:
 > Looks like I should persist and track down the
 > problem. Perhaps something to do with the keys? When I try to
 > decrypt I am getting binary garbage out instead of an ascii string.
 >
 > Any pointers about where to start looking would be welcome!

First check the obvious: do you have exactly the same
key/IV/ciphertext.

If that's not it, the most popular bug in Blowfish
implementations is an endian dependency.  It causes
implementations to be self-consistent, but ciphertext is not
portable between big-endian and little-endian machines.  Bruce
Schneier's original implementation had the bug, and many others
followed.


-- 
--Bryan



More information about the Python-list mailing list