hashstr = str(e) + '$' + str(r)
In the above line, str(r)
will give you: "b'ZogTXTk8T72jy01H9G6Y0L7mjHHR7IG0VKMcWZUbVqQ='"
.
You need to use r.decode()
to get "ZogTXTk8T72jy01H9G6Y0L7mjHHR7IG0VKMcWZUbVqQ="
.
hashstr = str(e) + '$' + r.decode()
UPDATE 1
Arugments to hmac.new
should be fixed:
hmac1 = hmac.new(hashstr.encode(), challenge.encode(), 'sha1')
UPDATE 2
According to OP's comment, OP doesn't need to do the following.
Another thing is that, crypto.pbkdf2Sync
seems does not respect digest
argument. It seems always use sha1
digest (At least in my system, NodeJS 0.10.25). So you need to specify sha1
in python side:
res = hashlib.pbkdf2_hmac('sha1', password.encode(), e.encode(), 10000, 32)
I am trying to create a Partial View that is a submission form for creating a a new ProductionGoal model. It uses ProductionLineViewModel to create that. My main question is how to pass that data ...
I am trying to create a Partial View that is a submission form for creating a a new ProductionGoal model. It uses ProductionLineViewModel to create that. My main question is how to pass that data ...
My task: I have a file that contains many items and each item is related to an array of URLs of images which I need to download. I want to download all of the links, I'm using this library for the ...
My task: I have a file that contains many items and each item is related to an array of URLs of images which I need to download. I want to download all of the links, I'm using this library for the ...
How the variable 'str2' is available inside the callback method passed to display method? str2 should be visible only inside function 'name'. a = { display: function (n){ console.log("I ...
How the variable 'str2' is available inside the callback method passed to display method? str2 should be visible only inside function 'name'. a = { display: function (n){ console.log("I ...
Whenever I hover over #Rock div I want it to apply a style to both .RockToScissors & .RockToLizard at the same. A the moment I have: <div onmouseover="overRock()" onmouseout="outRock()"> ...
Whenever I hover over #Rock div I want it to apply a style to both .RockToScissors & .RockToLizard at the same. A the moment I have: <div onmouseover="overRock()" onmouseout="outRock()"> ...