From 65d0aae9c9b4af0f5555fc18d62977d1093e2879 Mon Sep 17 00:00:00 2001 From: ASPP Student Date: Mon, 26 Aug 2024 15:05:02 +0300 Subject: [PATCH] fix password hashing # doc.python.org --- auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auth.py b/auth.py index 036a62a..76a5eb4 100644 --- a/auth.py +++ b/auth.py @@ -31,7 +31,10 @@ def write_pwdb(pwdb, PWDB_PATH): def pwhash(pwd): - return sha256(pwd) + encoded_pwd = pwd.encode("utf-8") + m = sha256() + m.update(encoded_pwd) + return m.hexdigest() if __name__ == "__main__": PWDB_PATH = 'pwdb.json'