From 1bde1a1739dc31ef69c65377d0e8c40cb1f55c4d Mon Sep 17 00:00:00 2001 From: StNicolay <103897650+StNicolay@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:45:27 +0300 Subject: [PATCH] Now using env. variables for db info --- src/cryptography/other_accounts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptography/other_accounts.py b/src/cryptography/other_accounts.py index 0c983bc..958c46f 100644 --- a/src/cryptography/other_accounts.py +++ b/src/cryptography/other_accounts.py @@ -26,7 +26,7 @@ def encrypt_account_info( """Encrypts login and password of a user using hash of their master password as a key. Returns a tuple of encrypted login password and salt""" salt = bcrypt.gensalt() - key = generate_key(salt, master_pass_hash) + key = _generate_key(salt, master_pass_hash) f = Fernet(key) enc_login = f.encrypt(login.encode("utf-8")) enc_passwd = f.encrypt(passwd.encode("utf-8")) @@ -36,7 +36,7 @@ def encrypt_account_info( def decrypt_account_info( enc_login: bytes, enc_pass: bytes, master_pass_hash: bytes, salt: bytes ) -> tuple[str, str]: - key = generate_key(salt, master_pass_hash) + key = _generate_key(salt, master_pass_hash) f = Fernet(key) login_bytes = f.decrypt(enc_login) pass_bytes = f.decrypt(enc_pass)