summaryrefslogtreecommitdiffstats
path: root/system/libraries/Encryption.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-12-14 15:42:29 +0100
committerAndrey Andreev <narf@devilix.net>2015-12-14 15:42:29 +0100
commit788fb4aa823179e7c4401f5384207d916697bb7e (patch)
tree551fd91834cc4f259d44d2355638552130ca2749 /system/libraries/Encryption.php
parent97ecf2fcce8e3133e286e16de1b49612235a8dcf (diff)
parentbc05b84995d5425d6bdc28c43174e70b720840ce (diff)
Merge branch '3.0-stable' into develop
Diffstat (limited to 'system/libraries/Encryption.php')
-rw-r--r--system/libraries/Encryption.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php
index f3e039881..151ce8dec 100644
--- a/system/libraries/Encryption.php
+++ b/system/libraries/Encryption.php
@@ -337,6 +337,11 @@ class CI_Encryption {
*/
public function create_key($length)
{
+ if (function_exists('random_bytes'))
+ {
+ return random_bytes((int) $length);
+ }
+
return ($this->_driver === 'mcrypt')
? mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)
: openssl_random_pseudo_bytes($length);