Encryption with Python?

Paul Rubin http
Thu May 5 16:56:27 EDT 2005


"Blake T. Garretson" <blake.garretson at gmail.com> writes:
> I want to save some sensitive data (passwords, PIN numbers, etc.) to
> disk in a secure manner in one of my programs.  What is the
> easiest/best way to accomplish strong file encryption in Python?  Any
> modern block cipher will do: AES, Blowfish, etc.  I'm not looking for
> public key stuff; I just want to provide a pass-phrase.

http://www.nightsong.com/phr/crypto/p3.py

It uses SHA1 in OFB mode and is fairly fast for a pure Python function.

> I found a few modules out there, but they seem to be all but abandoned.
>  Most seem to have died several years ago.  The most promising package
> is A.M. Kuchling's Python Cryptography Toolkit
> (http://www.amk.ca/python/code/crypto.html).

Nice toolkit, more flexible and powerful than p3.py, but also more
complicated.



More information about the Python-list mailing list