From 849bd5a6ecc332d5a0d58800ff19acded3160b8e Mon Sep 17 00:00:00 2001 From: Samer Afach Date: Tue, 27 Mar 2018 23:56:38 +0200 Subject: [PATCH] Function rename --- SamAuthenticator/Authenticator.py | 3 ++- SamAuthenticator/AuthenticatorWindow.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SamAuthenticator/Authenticator.py b/SamAuthenticator/Authenticator.py index a9bf676..d6e2bdf 100644 --- a/SamAuthenticator/Authenticator.py +++ b/SamAuthenticator/Authenticator.py @@ -9,9 +9,10 @@ import copy _salt = "V5RlhpuwACffXuUNLex7Al9ulPy4SRHbyaAxWigjX9Z01OVaCO" -def GetDefaultSalt(): +def get_default_salt(): return copy.deepcopy(_salt) + def encrypt_data(data_bytes, password, salt): password_hash = argon2.argon2_hash(password=password, salt=salt) encoded_hash = base64.urlsafe_b64encode(password_hash[:32]) diff --git a/SamAuthenticator/AuthenticatorWindow.py b/SamAuthenticator/AuthenticatorWindow.py index a684e22..b1eeadf 100644 --- a/SamAuthenticator/AuthenticatorWindow.py +++ b/SamAuthenticator/AuthenticatorWindow.py @@ -100,7 +100,7 @@ class AuthenticatorGUI(QMainWindow): try: with open(source_file[0], 'rb') as f_load: ciphered_data = f_load.read() - readable_data = auth.decrypt_data(ciphered_data, password_from_dialog[0], auth.GetDefaultSalt()) + readable_data = auth.decrypt_data(ciphered_data, password_from_dialog[0], auth.get_default_salt()) with open(dest_file[0], 'wb') as f_save: f_save.write(readable_data)