note 88201 deleted from mcrypt.examples by danbrown
| From: | danbrown@php.net | Date: | Thu, 15 Jan 2009 17:00:31 +0000 |
| Subject: | note 88201 deleted from mcrypt.examples by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149286@lists.php.net to get a copy of this message | ||
Note Submitter: mircea at skywards dot ro
----
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