Skip to content

Commit 728d99e

Browse files
committed
Update AES256Encryption.php
1 parent 9804409 commit 728d99e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

berry/encryption/AES256Encryption.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,15 @@
2626

2727
class AES256Encryption
2828
{
29-
3029
private static string $OPENSSL_CIPHER_NAME = "aes-256-cbc"; //Name of OpenSSL Cipher
3130
private static int $CIPHER_KEY_LEN = 32; // 32 bytes (256 bits)
3231

3332
static function getRandomIV()
3433
{
35-
$length = 16;
3634
$characters = '0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()-=_+ABCDEFGHIJKLMNOPQRSTUVWXYZ';
3735
$charactersLength = strlen($characters);
3836
$randomString = '';
39-
for ($i = 0; $i < $length; $i++)
37+
for ($i = 0; $i < AES256Encryption::$CIPHER_KEY_LEN; $i++)
4038
{
4139
$randomString .= $characters[rand(0, $charactersLength - 1)];
4240
}
@@ -92,5 +90,4 @@ static function decrypt(string $key, string $data)
9290
return $decryptedData;
9391
}
9492
}
95-
9693
?>

0 commit comments

Comments
 (0)