Skip to content

Commit ba81978

Browse files
committed
fix(encryption): use random_bytes for IV generation in OpenSSLHandler
1 parent 3ad5144 commit ba81978

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎system/Encryption/Handlers/OpenSSLHandler.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function encrypt(#[SensitiveParameter] $data, #[SensitiveParameter] $para
9696
$encryptKey = \hash_hkdf($this->digest, $key, 0, $this->encryptKeyInfo);
9797

9898
// basic encryption
99-
$iv = ($ivSize = \openssl_cipher_iv_length($this->cipher)) ? \openssl_random_pseudo_bytes($ivSize) : null;
99+
$iv = ($ivSize = \openssl_cipher_iv_length($this->cipher)) ? random_bytes($ivSize) : null;
100100

101101
$data = \openssl_encrypt($data, $this->cipher, $encryptKey, OPENSSL_RAW_DATA, $iv);
102102

0 commit comments

Comments
 (0)