note 52380 added to function.md5

From: Date: Fri, 29 Apr 2005 02:39:56 +0000
Subject: note 52380 added to function.md5
Groups: php.notes 
Request: Send a blank email to php-notes+get-88727@lists.php.net to get a copy of this message
Do not use the hex strings returned by md5() as a key for MCrypt 256-bit encryption. Hex characters only represent four bits each, so when you take 32 hex characters, you are only really using a 128-bit key, not a 256-bit one. Using an alphanumeric key generator [A-Za-z0-9] will also only provide a 192-bit key in 32 characters. Two different MD5s concatenated in raw binary form, or mcrypt_create_iv(32,MCRYPT_DEV_RANDOM) will give you a true 256-bit key string. ---- Manual Page -- http://www.php.net/manual/en/function.md5.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52380 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52380&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52380&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52380&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52380&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52380&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52380&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88727) next »