Skip to content

Commit

Permalink
Use /dev/urandom for random data.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 30, 2013
1 parent d323ea3 commit e07938e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Security.php
Expand Up @@ -232,7 +232,7 @@ public static function rijndael($text, $key, $operation) {
$cryptKey = substr($key, 0, 32);

if ($operation === 'encrypt') {
$iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
$iv = mcrypt_create_iv($ivSize, MCRYPT_DEV_URANDOM);
return $iv . '$$' . mcrypt_encrypt($algorithm, $cryptKey, $text, $mode, $iv);
}
$iv = substr($text, 0, $ivSize);
Expand Down

0 comments on commit e07938e

Please sign in to comment.