salt the hash

This commit is contained in:
ASPP Student 2024-08-26 15:30:59 +03:00
parent 3dd3e3e310
commit b572fd0e7e

10
auth.py
View file

@ -29,10 +29,14 @@ def write_pwdb(pwdb, PWDB_PATH):
json.dump(pwdb, pwdb_file)
def hash_password(password):
hash = 0
hash_1 = 0
for c in password.split():
hash += ord(c)
return hash
hash_1 += ord(c)
hash_2 = int(log(hash_1) * 100000)
hash_3 = 1
for d in list(str(hash_2)):
hash_3 *= ord(d)
return hash_3
if __name__ == "__main__":
PWDB_PATH = 'pwdb.json'