Re: crypt() function
| From: | Marco Tabini | Date: | Tue, 15 Oct 2002 01:18:04 +0000 |
| Subject: | Re: crypt() function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119976@lists.php.net to get a copy of this message | ||
Have you considered using md5() instead?
On Mon, 2002-10-14 at 16:27, Adam Plocher wrote:
> Hello, I am trying to authenticate a password using the crypt()
> function. Here's what I got:
>
> if (crypt($_SERVER['PHP_AUTH_PW'],$data[1]) == $data[1])
> {
> ...
> }
>
> $data[1] being the salt..
>
> It half-way works... If the users password is 'blah' it will
> authenticate fine, but if you append anything to the end of the password
> string, it will still allow authentication (ie 'blah12345' will still
> work, even though the password is 'blah'). Completely random passwords
> do not work, so it seems to be doing SOME checking. Any help would be
> very appreciated.
>
> Thanks
> -Adam