htpasswd-style password generation w/PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, all -

I've been trying to figure out a reliable way of creating user:pass
combinations to be used from within an Apache-based .htpasswd file.

>From what I understand, PHP's crypt() function is almost identical to
the Linux system crypt() function, which 'htpasswd' uses.  However, when
using PHP's crypt(), my result string is much longer than the one that
can be found in your ordinary .htpasswd file generated by 'htpasswd'.

However, thi smight be what I'm looking for, since 'htpasswd' is know to
use two different types of password encryption:

(from htpasswd's manpage)

"htpasswd  encrypts  passwords  using either a version of MD5 modified
for Apache, or the system’s crypt() routine. Files managed by htpasswd
may contain both types of passwords; some user records may have
MD5-encrypted passwords while others in the same file may have passwords
encrypted with crypt()."

Does PHP's crypt() use that modified version of an MD5 routine, and
that's what I'm seeing?

Basically I'd like to make an application that can modify any .htpasswd
file, adding and deleting users, without actually running the 'htpasswd'
utility.

Thanks!
-dant

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux