You are here: htpasswd-style password generation w/PHP « PHP « IT news, forums, messages
htpasswd-style password generation w/PHP

Posted by Dan Trainor on 10/20/91 11:25

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация