Re: how to encrypt passwords?
| From: | pj | Date: | Mon, 14 Apr 2003 09:31:29 +0000 |
| Subject: | Re: how to encrypt passwords? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27076@lists.php.net to get a copy of this message | ||
Hi,
If you use the 'crypt()' function, just have in mind that it's a one-way
hash and cannot be decrypted.
This might be usefull, if yo need to display the pwd in a user form field,
in order to be updated.
When using 'crypt()' I doubt it will happen correct.
Try useing 'encode()' and 'decode()' functions instead.
Example:
'encode($pwd_field, '.s')'
where '.s' is the salt key.
The reverse function is:
'decode(colPWD_inMySQL, '.s')'
Hope this will help.
Best Regards.
pj.
"Kyle Slattery" <kyle@fidgeting.net> wrote in message
news:MBBBLIJDEKNOMMMJGJGJOELICBAA.kyle@fidgeting.net...
> I'm trying to decide on a way to encrypt passwords to be put in a mysql
> database. Do you guys have any opinions on what method I should use?
> md5()? mysql's password()?
>
> Thanks,
> Kyle
>
> ----
> Kyle Slattery
> kyle@fidgeting.net
> http://www.fidgeting.net
>