Skip to content

Commit 4b1d6c9

Browse files
author
Joan He
committed
Merge remote-tracking branch 'arcticfoxes/MC-13806' into 2.3-qwerty-pr
2 parents 1106fbd + cdd2c00 commit 4b1d6c9

File tree

1 file changed

+8
-8
lines changed
  • lib/internal/Magento/Framework/Encryption

1 file changed

+8
-8
lines changed

lib/internal/Magento/Framework/Encryption/Crypt.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class Crypt
4141
/**
4242
* Constructor
4343
*
44-
* @param string $key Secret encryption key.
45-
* It's unsafe to store encryption key in memory, so no getter for key exists.
46-
* @param string $cipher Cipher algorithm (one of the MCRYPT_ciphername constants)
47-
* @param string $mode Mode of cipher algorithm (MCRYPT_MODE_modeabbr constants)
48-
* @param string|bool $initVector Initial vector to fill algorithm blocks.
49-
* TRUE generates a random initial vector.
50-
* FALSE fills initial vector with zero bytes to not use it.
44+
* @param string $key Secret encryption key.
45+
* It's unsafe to store encryption key in memory, so no getter for key exists.
46+
* @param string $cipher Cipher algorithm (one of the MCRYPT_ciphername constants)
47+
* @param string $mode Mode of cipher algorithm (MCRYPT_MODE_modeabbr constants)
48+
* @param string|bool $initVector Initial vector to fill algorithm blocks.
49+
* TRUE generates a random initial vector.
50+
* FALSE fills initial vector with zero bytes to not use it.
5151
* @throws \Exception
5252
*/
5353
public function __construct(
@@ -66,7 +66,7 @@ public function __construct(
6666
$allowedCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
6767
$initVector = '';
6868
for ($i = 0; $i < $initVectorSize; $i++) {
69-
$initVector .= $allowedCharacters[rand(0, strlen($allowedCharacters) - 1)];
69+
$initVector .= $allowedCharacters[random_int(0, strlen($allowedCharacters) - 1)];
7070
}
7171
// @codingStandardsIgnoreStart
7272
@mcrypt_generic_deinit($handle);

0 commit comments

Comments
 (0)