Implement simple password hashing #9

Open
antoninfo wants to merge 2 commits from antoninfo/2024-heraklion-git:hashing into main
Showing only changes of commit 29fb7baa21 - Show all commits

View file

@ -13,7 +13,7 @@ def authenticate(username, password, pwdb):
return pwhash(password) == pwdb[username] return pwhash(password) == pwdb[username]
def add_user(username, pwdb): def add_user(username, pwdb):
password = input(f'Enter password for {username}: ') password = getpass(f'Enter password for {username}: ')
pwdb[username] = pwhash(password) pwdb[username] = pwhash(password)
return pwdb return pwdb