Einloggen funktioniert

This commit is contained in:
2024-12-03 16:30:56 +01:00
parent b028638d56
commit 7157176b5b
13 changed files with 804 additions and 50 deletions

View File

@@ -47,9 +47,9 @@ class Vermasseln:
return cipher
@classmethod
def userPasswordHash(self, password):
salt = "".join(random.choice(string.ascii_letters + string.digits) for i in range (32))
def userPasswordHash(self, password, salt = None):
if not salt:
salt = "".join(random.choice(string.ascii_letters + string.digits) for i in range (32))
hash_pw = (salt + password).encode("utf-8")
h_obj = SHA3_512.new(hash_pw)
password = salt + "$" + h_obj.hexdigest()