Skip to content

Commit

Permalink
Decode hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Mottram committed May 25, 2021
1 parent 63d5524 commit 269a025
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miniircd
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,7 @@ def main() -> None:
pwdhash = hashlib.pbkdf2_hmac('sha512',
password.encode('utf-8'),
salt.encode('utf-8'), 100000)
pwdhash = binascii.hexlify(pwdhash)
pwdhash = binascii.hexlify(pwdhash).decode('utf-8')
line = nickname + ' ' + salt + ' ' + pwdhash
filename = os.path.join(args.state_dir, 'passwords')
if os.path.isfile(filename):
Expand Down Expand Up @@ -2159,7 +2159,7 @@ def main() -> None:
pwdhash = hashlib.pbkdf2_hmac('sha512',
password.encode('utf-8'),
salt.encode('utf-8'), 100000)
pwdhash = binascii.hexlify(pwdhash)
pwdhash = binascii.hexlify(pwdhash).decode('utf-8')
new_line = nickname + ' ' + salt + ' ' + pwdhash
if line.endswith(' oper\n'):
new_line += ' oper'
Expand Down

0 comments on commit 269a025

Please sign in to comment.