node-phpass | Node implementation of the portable PHP password hashing | Hashing library
kandi X-RAY | node-phpass Summary
kandi X-RAY | node-phpass Summary
A pure node.js JavaScript port of the portable PHP password hashing framework. The goal is to support existing password hashes created with the phpass library and to generate new hashes that can be used with phpass.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-phpass
node-phpass Key Features
node-phpass Examples and Code Snippets
Community Discussions
Trending Discussions on node-phpass
QUESTION
I want to authenticate WP users using my own authentication service written in Node. I have users saved in the wp_users
table. Their passwords are hashed using Phpass method by WordPress. When a user is trying to log into his account, WP is using CheckPassword()
method and returns boolean true
/false
if the password matches or not.
Now I want to use Node to compare user password to the WP hash. I found node-phpass module on NPM, which is supposed to provide the Phpass algorithm for password hashing.
It's all fine until I use international characters. Here's an example:
In WP, I set the password like this, and get a hash:
P: alamakota
H: $P$BSrncAWIY2KU7waUGLzayaon6v3gKU1
When I try to log in, WP says "All fine, come in, man"
Now, I take the hash and try to validate it using node-phpass module:
...ANSWER
Answered 2019-Jun-21 at 15:08So it turned out that the PHP's md5()
function returns different hash than JS'es crypto.createHash('md5')
because of character encoding. I've used utf8 before comparing the password against the hash and everything works as expected:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-phpass
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page