Re: Python and PHP encryption/decryption

2009-08-21 Thread Piet van Oostrum
 Diez B. Roggisch de...@nospam.web.de (DBR) wrote:

DBR Jean-Claude Neveu schrieb:
 I'm looking for a recommendation about encryption/decryption packages for
 Python.
 
 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. However, the project is at
 the development stage so I can easily change how I'm encrypting things in
 PHP if there is a compelling reason on the Python side of things to do
 so.

DBR With PyCrypto[1] you have a wide range of choices, amongst others AES.

DBR If that's the best algorithm, or even the best python-package to implement
DBR it, I don't know.


DBR [1] http://www.dlitz.net/software/pycrypto/

Pycrypto had been stalled in development. The latest release was in
2005. There is now a new developer and that it were the link above goes,
but he has not yet released anything. so you will have to do with the
2005 release.

There is an alternative library: m2crypto
(http://chandlerproject.org/Projects/MeTooCrypto). It is built on top of
OpenSSL which is available for most platforms that have Python whereas
Pycrypto has its own C implementations of crypto algorithms. M2crypto
has a recent release. Also I think because OpenSSL is widely used, its
vulnerabilities are easier detected and corrected, whereas I don't think
that is the case for Pycrypto.

M2crypto is much bigger than you need for this project, however. If that
doesn't bother you I would recommend it.

-- 
Piet van Oostrum p...@cs.uu.nl
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Python and PHP encryption/decryption

2009-08-19 Thread Jean-Claude Neveu
I'm looking for a recommendation about encryption/decryption packages 
for Python.


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. 
However, the project is at the development stage so I can easily 
change how I'm encrypting things in PHP if there is a compelling 
reason on the Python side of things to do so.


Many Thanks,
Jean-Claude

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and PHP encryption/decryption

2009-08-19 Thread Diez B. Roggisch

Jean-Claude Neveu schrieb:
I'm looking for a recommendation about encryption/decryption packages 
for Python.


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. However, the 
project is at the development stage so I can easily change how I'm 
encrypting things in PHP if there is a compelling reason on the Python 
side of things to do so.


With PyCrypto[1] you have a wide range of choices, amongst others AES.

If that's the best algorithm, or even the best python-package to 
implement it, I don't know.



[1] http://www.dlitz.net/software/pycrypto/


Diez
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and PHP encryption/decryption

2009-08-19 Thread Paul Rubin
Jean-Claude Neveu jcn-france1...@pobox.com 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.

-- 
http://mail.python.org/mailman/listinfo/python-list