It can really depend on your system.

On mine, for instance, it uses regular crypt() with a 2 character salt
So, you can generate a random 2 character string to pass as the salt
argument in php, and create it that way.
IF that is the method used by your system

Wanna test it?

Peek inside etc/passwd and copy out the encrypted string that represents
your password.

Take the first two characters of that string and use that as the salt on
your test page. (say for instance the salt is xT)

In your test page, use the following code

<? Echo crypt("your unencrypted password"."xT"); ?>

That's all you need.
Call it from your browser.
Is the encrypted value the same as in etc/passwd?
If so, then crypt is what you use for .htpasswd file

You can also check against an existing .htpqsswd entry, if you exist in an
.htpasswd file on your system.


On 4/9/01 1:39 PM, "Kurth Bemis" <[EMAIL PROTECTED]> wrote:

> At 04:39 PM 4/9/2001, Brandon Orther wrote:
> 
> i believe that the scheme is md5
> 
> ~kurth
> 
>> Hello,
>> 
>> I am trying to make a script that creates .htpasswd files.  Does anyone know
>> what encryption is used?
>> 
>> Thanks
>> Brandon
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to