note 50643 added to function.md5
| From: | whateverever at osu1 dot php dot net | Date: | Sat, 05 Mar 2005 17:04:57 +0000 |
| Subject: | note 50643 added to function.md5 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85974@lists.php.net to get a copy of this message | ||
hkmaly has updated his crypt/decrypt code at http://adela.karlin.mff.cuni.cz/~hkmaly/crypt_using_md5.php.txt
and made a sha1 version.
Note that if you crypt_md5 twice, you get back the first 16 characters.
<?
$time= 1110039695; // time();
$key= "secret key";
print crypt_md5(crypt_md5('This is a very long etc.',$key,$time),$key,$time);
?>
Produces:
This is a very lfkãµìÄcÜ
The same is true for decrypt_md5, and for the _sha1 versions. (The $time parameter is new. Remove
it if you're using the old code.)
You can assess whether this would be a problem in your own situation.
----
Manual Page -- http://www.php.net/manual/en/function.md5.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50643
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50643&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50643&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50643&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50643&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50643&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50643&report=yes
Search -- http://master.php.net/manage/user-notes.php