Python and PHP encryption/decryption

Paul Rubin http
Thu Aug 20 03:45:53 CEST 2009

Jean-Claude Neveu <jcn-france1972 at> writes:
> I'm working on a project that will require me to store some values in
> a database in encrypted format. I'll be storing them from a PHP script
> and retrieving them (decrypting them) using Python. I'm currently
> using PHP's mcrypt package to encrypt the values, and I'm using AES
> for encryption, so something AES-compatible would be ideal.

There are several python libraries that support AES in the standard
operating modes.  If you are doing something sensible on the PHP side,
you should be able to get Python to interoperate with it.  Be careful
that you are doing the right things algorithmically in terms of modes,
IV's, etc.  If you don't know what you're doing in this area, it's
best to (at minimum) seek more specific advice.

More information about the Python-list mailing list