[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Hashed passwords in userpassword



"David E. Storey" wrote:
> 
> Michael Ströder wrote:
> 
>  php v3.0.12 (and maybe
> a couple versions under that) support mhash:
> 
> <?
> $hashedPW_MD5 = "{md5}".base64_encode(mhash(MHASH_MD5, $userPassword));
> $hashedPW_SHA1 = "{sha}".base64_encode(mhash(MHASH_SHA1, 
> $userPassword));

'{MD5}%s' % base64.encodestring(md5.new(userpassword).digest())
'{SHA}%s' % base64.encodestring(sha.new(userpassword).digest())

isn't that hard to code. :-)

> I'm not sure what scripting engine your using, 

You might have guessed it: Python.

Ciao, Michael.