Function rename

This commit is contained in:
Samer Afach 2018-03-27 23:56:38 +02:00
parent e7a72a78b6
commit 849bd5a6ec
2 changed files with 3 additions and 2 deletions

View File

@ -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])

View File

@ -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)