Encryption between Python & PHP

Dan Sommers me at privacy.net
Sun Aug 8 09:21:53 EDT 2004


On Sun, 8 Aug 2004 14:00:32 +0100,
Geoff Caplan <geoff at variosoft.com> wrote:

> I have little crypto knowledge, and at first I though that something
> like blowfish was a standard and different libraries should be
> compatible. Now I suspect that internal implementation varies between
> libraries and you have to encrypt/decrypt with the same library. Can
> anyone enlighten me?

I can't help much with your other questions, but I do know about this
one.  By definition, blowfish is blowfish is blowfish.  Any (properly
implemented) blowfish library will be compatible with another; if you
encode something with one library, you will be able to decode it with
the other.  It is up to you to use the same key and to make sense of the
information once you decrypt it.

That said, yes, it is possible that the internal implementation details
may vary slightly between libraries, but not in ways that the user will
notice.  Think of this like calculators:  although calculators use
different hardware and different display devices, they all (should) give
the same answer to the same multiplication problem (keeping the
multiplications in question simple enough so as not to cause some sort
of underflow or overflow error or loss of precision; thankfully,
blowfish implementations do not suffer even this limitation).

HTH,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>
Never play leapfrog with a unicorn.



More information about the Python-list mailing list