note 51004 added to function.crypt
| From: | postal2600 at yahoo dot com | Date: | Wed, 16 Mar 2005 10:07:23 +0000 |
| Subject: | note 51004 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86542@lists.php.net to get a copy of this message | ||
I'll take the example from above and take a situation that I've ecountered and show you
something that puts this function in a dark shadow of insecurity:
<?php
$password = crypt('postal2600','CyberBoard');
if (crypt('postal26??', $password) == $password) {
echo "Password verified!";
}
?>
Instead of ?? you can put anything an see that allway the password will be verified. So i strongly
recomand that the md5 function should be used instead.
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51004
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51004&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51004&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51004&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51004&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51004&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51004&report=yes
Search -- http://master.php.net/manage/user-notes.php