Generate longer more secure Key for logins

This commit is contained in:
johnnyq
2022-12-29 18:23:11 -05:00
parent 5d6b03141b
commit 29a9d6ef8f
6 changed files with 19 additions and 14 deletions

View File

@@ -239,8 +239,8 @@ if(isset($_GET['share_generate_link'])){
// Decrypt & re-encrypt password for sharing
$login_password_cleartext = decryptLoginEntry($row['login_password']);
$login_encryption_key = keygen();
$iv = keygen();
$login_encryption_key = bin2hex(random_bytes(8));
$iv = bin2hex(random_bytes(8));
$ciphertext = openssl_encrypt($login_password_cleartext, 'aes-128-cbc', $login_encryption_key, 0, $iv);
$item_encrypted_credential = $iv . $ciphertext;