As you know you can put this code in the .htaccess file: AuthType Basic AuthName "RelateBase Application Library" AuthUserFile "/home/relbase/.htpasswds/lib/passwd" require valid-user and then the passwd file would look like this: relbase:Ap.baxgseHgvJ (I modified a few characters for security) I am writing a php application and can read the files without ht access. However I want to simulate a login window and honor the login username and password. My question is, how do I take the password submitted by the user and encrypt it so I can compare it with "Ap.baxgseHgvJ" above? It is obviously not an md5() encryption. I am unwilling to write my own htpasswd file, I intend to piggy back on the existing apache system for password protecting a folder Thank you for your response. Samuel