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

Re: Hashed passwords in userpassword



Michael Ströder wrote:

[snip]

> This works fine with using crypt, e.g.
> userpassword: {CRYPT}.5X.al91HG.WI
> But what's the scheme for using MD5 or SHA-1 hashed passwords? I saw
> some examples but forgot where.

very similar to crypt:

userPassword: {sha}W6ph5Mm5Pz8GgiULbPgzG37mj9g=
userPassword: {md5}X03MO1qnZdYdgyfeuILPmQ==

The only real difference is that the hash is base64 encoded.

I'm not sure what scripting engine your using, but 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));
?>

d!