|
|
|
|
@ -10,7 +10,7 @@ declare(strict_types=1); |
|
|
|
|
* This file is for non-sensitive data like session data |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
namespace IOcornetstone\Framework\Services; |
|
|
|
|
namespace IOcornerstone\Framework\Services; |
|
|
|
|
|
|
|
|
|
use IOcornerstone\Framework\Common; |
|
|
|
|
use IOcornerstone\Framework\RandomEngine; |
|
|
|
|
@ -260,7 +260,7 @@ md5-128 0.77 |
|
|
|
|
$key = $this->key; |
|
|
|
|
$key = ($validate) ? $this->getValidKey($key) : $key; |
|
|
|
|
$ivsize = openssl_cipher_iv_length($this->method); |
|
|
|
|
$iv = $this->randomEngine->get_bytes($ivsize); // Requires PHP 7 |
|
|
|
|
$iv = $this->randomEngine->getBytes($ivsize); // Requires PHP 7 |
|
|
|
|
// Encryption key generated by PBKDF2 (since PHP 5.5) |
|
|
|
|
$keys = hash_pbkdf2($this->defaultHash, $key, $iv, $this->_iterations, $this->_length, $this->_raw); |
|
|
|
|
$encKey = substr($keys, 0, $this->_key_bytes); // X bit encryption key |
|
|
|
|
|