>> I'm still using Python 2.4.  In my code, I want to encrypt a password
>> and at another point decrypt it.  What is the standard way of doing
>> encryption in python?  Is it the Pycrypto module?
>
>Usually, one doesn't store clear-text passwords. Instead, use a
>hash-algorithm like md5 or crypt (the former is in the standard lib,
don't
>know of the other out of my head) and hash the password, and store that
>hash.
>
>If a user enters the password, use the same algorithm, and compare the
>resulting hashes with the stored one.
>

Have a look at the hashlib module. Should have everything you need.

There's a write up in a recent episode of Doug Hellmann's most excellent
"Python Module of the Week".

http://blog.doughellmann.com/2008/01/pymotw-hashlib.html

Cheers,

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

Reply via email to