From 54ab1c7f98656c46b4633f60543b06001da85fe2 Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Wed, 19 Dec 2018 02:41:20 -0500 Subject: [PATCH] add salt --- mail4one/pop3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index 23e00ba..3896da2 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -69,7 +69,9 @@ def write(data): def validate_password(password): - if not compare_digest(Session.password_hash, sha256(password.encode()).hexdigest()): + salt = "balki is awesome+" + salted = f"{salt}{password}" + if not compare_digest(Session.password_hash, sha256(salted.encode()).hexdigest()): raise AuthError("Invalid user pass")