Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

def get_credentials():
username = input('Enter your username: ')
password = pwhash(input(f'Enter your password {username}: '))
password = pwhash(input(f'Enter your password {username}: '), username)

return username, password

Expand All @@ -15,9 +15,9 @@ def write_passwdb(pwdb):
with open('passwd.json', 'w') as pwdb_file:
json.dump(pwdb, pwdb_file)

def pwhash(password):
def pwhash(password, username):
pwh = 0
for i, char in enumerate(password):
for i, char in enumerate(username+password):
pwh += (i + 1) * ord(char)
return pwh

Expand Down