From e1650201110e4a33b302c6f636332ccbfe9d936c Mon Sep 17 00:00:00 2001 From: StNicolay Date: Sun, 25 Dec 2022 21:03:08 +0300 Subject: [PATCH] Added blank lines in encryption.other_accounts for better readability --- src/encryption/other_accounts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/encryption/other_accounts.py b/src/encryption/other_accounts.py index 9e02449..52b69c7 100644 --- a/src/encryption/other_accounts.py +++ b/src/encryption/other_accounts.py @@ -32,12 +32,14 @@ def encrypt( salt = os.urandom(64) key = _generate_key(salt, master_pass.encode("utf-8")) f = Fernet(key) + enc_login = base64.urlsafe_b64decode( f.encrypt(account.login.encode("utf-8")), ) enc_password = base64.urlsafe_b64decode( f.encrypt(account.password.encode("utf-8")), ) + return Account( user_id=account.user_id, name=account.name, @@ -55,12 +57,14 @@ def decrypt( DecryptedAccount object""" key = _generate_key(account.salt, master_pass.encode("utf-8")) f = Fernet(key) + login = f.decrypt( base64.urlsafe_b64encode(account.enc_login), ).decode("utf-8") password = f.decrypt( base64.urlsafe_b64encode(account.enc_password), ).decode("utf-8") + return DecryptedAccount( user_id=account.user_id, name=account.name,