From ac1cf7a6cf38b606fe5cb7d97dbe51586f89736b Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 14 Dec 2022 22:03:48 +0100 Subject: [PATCH] random(): use random_bytes instead of mcrypt_create_iv --- lib/php/nb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/php/nb.php b/lib/php/nb.php index 3017bab8..5dc0b54b 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -903,7 +903,7 @@ class Nb { } public static function random_str($length=32) { - return bin2hex(mcrypt_create_iv($length/2, MCRYPT_DEV_URANDOM)); + return bin2hex(random_bytes($length/2)); } public static function encrypt($key,$value) { -- 2.47.3