note 88177 added to mcrypt.examples
| From: | mircea at skywards dot ro | Date: | Wed, 14 Jan 2009 01:15:13 +0000 |
| Subject: | note 88177 added to mcrypt.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149171@lists.php.net to get a copy of this message | ||
Thank you jizz for the post, was really usefull.
In .NET applications and not only, the string keys are not safe, uncommon and much easier to be
guessed. Insted, byte array keys can be used.
This is how you can use them in PHP too (and is compatible with .Net byte array keys):
$key=pack("c24",0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23); // 24 bit Key
$iv=pack("c8",0, 1, 2, 3, 4, 5, 6, 7); // 8 bit IV
----
Server IP: 69.147.83.197
Probable Submitter: 78.97.214.248
----
Manual Page -- http://www.php.net/manual/en/mcrypt.examples.php
Edit -- https://master.php.net/note/edit/88177
Del: integrated -- https://master.php.net/note/delete/88177/integrated
Del: useless -- https://master.php.net/note/delete/88177/useless
Del: bad code -- https://master.php.net/note/delete/88177/bad+code
Del: spam -- https://master.php.net/note/delete/88177/spam
Del: non-english -- https://master.php.net/note/delete/88177/non-english
Del: in docs -- https://master.php.net/note/delete/88177/in+docs
Del: other reasons-- https://master.php.net/note/delete/88177
Reject -- https://master.php.net/note/reject/88177
Search -- https://master.php.net/manage/user-notes.php