note 47887 added to function.mcrypt-encrypt
| From: | cleong at nflc dot org | Date: | Fri, 03 Dec 2004 22:04:37 +0000 |
| Subject: | note 47887 added to function.mcrypt-encrypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81342@lists.php.net to get a copy of this message | ||
Note that the key need to be a binary string--not a hex string. A 128-bit key would be 16 characters
long, for example.
Use the pack() function to quickly convert a hex string into the actual binary data:
$key_hex = '66e94bd4ef8a2c3b884cfa59ca342b2e';
$key_bin = pack('H*', $key_hex);
$pt = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key_bin, $et, MCRYPT_MODE_ECB);
----
Manual Page -- http://www.php.net/manual/en/function.mcrypt-encrypt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47887
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47887&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47887&report=yes
Search -- http://master.php.net/manage/user-notes.php