From 3f4989223d5927c94d5cc1f56cedc2c1df0785ac Mon Sep 17 00:00:00 2001 From: Christian Hagenest Date: Thu, 6 Jun 2024 00:13:23 +0200 Subject: [PATCH] encode to bytes --- chatmaild/src/chatmaild/doveauth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmaild/src/chatmaild/doveauth.py b/chatmaild/src/chatmaild/doveauth.py index db1a7c7b..440d587d 100644 --- a/chatmaild/src/chatmaild/doveauth.py +++ b/chatmaild/src/chatmaild/doveauth.py @@ -23,7 +23,7 @@ class UnknownCommand(ValueError): def encrypt_password(password: str): # https://doc.dovecot.org/configuration_manual/authentication/password_schemes/ - passhash = hashlib.sha512(password).hexdigest() + passhash = hashlib.sha512(password.encode('UTF-8')).hexdigest() return "{SHA512-CRYPT}" + passhash