Re: .htpasswd encryption

From: Date: Mon, 09 Apr 2001 20:46:45 +0000
Subject: Re: .htpasswd encryption
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47879@lists.php.net to get a copy of this message
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" <kurth@usaexpress.net> 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: php-general-unsubscribe@lists.php.net >> For additional commands, e-mail: php-general-help@lists.php.net >> To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47879) next »