more secure crypt() function
Paul Rubin
http
Sat Oct 4 14:12:05 EDT 2003
Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
> def md5x(str) md5.new(str).hexdigest()[:16]
Bah.. the above should say
def md5x(str)
return md5.new(str).hexdigest()[:16]
And the following
> def hash(password):
> salt = <say 4 some random characters>
> return = salt + md5x(salt + password)
should say:
def hash(password):
salt = <say 4 some random characters>
return salt + md5x(salt + password)
I think the last one (below) is ok, but note I haven't tested any of them.
> def verify(password, hashed):
> salt, digest = hashed[:4], hashed[4:]
> return digest == md5(salt + password)
More information about the Python-list
mailing list