diff --git a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php index fd2284b8b1..00f1d78c53 100755 --- a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php +++ b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php @@ -286,7 +286,11 @@ public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNe private function cryptPassword($sPassword, $oPdo) { $sResult = ''; - $sSalt = substr(str_shuffle('./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), 0, 16); + if (function_exists('random_bytes')) { + $sSalt = substr(base64_encode(random_bytes(32)), 0, 16); + } else { + $sSalt = substr(str_shuffle('./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), 0, 16); + } switch (strtolower($this->sEncrypt)) { default: