note 44743 deleted from function.crypt by nlopess
| From: | nlopess@php.net | Date: | Sun, 15 Aug 2004 17:20:01 +0000 |
| Subject: | note 44743 deleted from function.crypt by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74710@lists.php.net to get a copy of this message | ||
Note Submitter: haavard ( at ) creanet.no
----
The crypt-function only takes the 8 first character into consideration when creating the output.
For example
crypt("aaaaaaaa222","aa");outputs the same as
crypt("aaaaaaaa111","aa");
Could be fatal if you e.g use crypt($hostname + $username,"aa") as validation to your
website.
md5 would do good, but creates a 32 character string, that doesn't look good in the addressbar.
My suggested solution:
$crypted_long_string = crypt(md5($long_string),"aa");