You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <js...@gmail.com> on 2004/07/09 17:27:34 UTC
Re: [users@httpd] md5 password authentification
On Fri, 09 Jul 2004 15:38:50 +0200, Peter Vandersteegen
<pe...@intec.ugent.be> wrote:
> Hello,
>
> thx for reading this problem on a win2000 machine with apache 2.0.49.
>
> My problem concerns the use of md5-passwords created with htpasswd2.
> Simply put: I want to check if a given username and its password correspond
> with the hashed_passwd in a stored ./password_file?
There is a little issue of a password "salt" to deal with. Passwords
are created using a random salt to make it more difficult to use a
dictionary to crack them. So the same password entered twice will get
two different encrypted hashes.
So to match passwords, the algorithm needs to be aware of the salt,
and use the same salt to generate the encrypted password for
comparison.
Now, since apache uses a custom md5 password hash (to get
cross-platfrom compatibility), I doubt that php has a proper password
checking function for it. Your best bet might be write a small
program in c that calls apr_password_validate (from apr-util/md5) to
check the password for you.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org