Decoding hash for login script

Asked by xyz_User

So basically doing an authentication for the compiled script using JSON file that contains a username and password. Everything is working just fine until I get to this function:

It seems to fail right on the thrid line: hsh = hashlib.pbkdf2_hmac('sha512'.....

import hashlib
import binascii

def _verify_pw(str_pw, prv_pw):
    salt = str_pw[:64]
    str_pw = str_pw[64:]
    hsh = hashlib.pbkdf2_hmac('sha512',
                                  prv_pw.encode('utf-8'),
                                  salt.encode('ascii'),
                                  100000)
    hsh = binascii.hexlify(hsh).decode('ascii')
    return hsh == str_pw

any suggestions?

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.