
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
password-hash-and-salt
Advanced tools
Simple, safe and straight-forward password hashing / salting for node.js
This module provides straight-forward password hashing for node.js applications using default settings considered to be safe.
First, install the module:
$ npm install password-hash-and-salt --save
Afterwards, usage is as simple as shown in the following example:
var password = require('password-hash-and-salt');
var myuser = [];
// Creating hash and salt
password('mysecret').hash(function(error, hash) {
if(error)
throw new Error('Something went wrong!');
// Store hash (incl. algorithm, iterations, and salt)
myuser.hash = hash;
// Verifying a hash
password('hack').verifyAgainst(myuser.hash, function(error, verified) {
if(error)
throw new Error('Something went wrong!');
if(!verified) {
console.log("Don't try! We got you!");
} else {
console.log("The secret is...");
}
});
})
password-hash-and-salt uses node.js' internal crypto module. Hashes are generated with pbkdf2 using 10,000 iterations.
The created hash is of 270 characters length and is of the following format:
pbkdf2$10000$hash$salt
This allows for future upgrades of the algorithm and/or increased number of iterations in future version. It also simplifies storage as no dedicated database field for the salt is required.
express-sslify is licensed under the MIT license. If you'd like to be informed about new projects follow @TheSumOfAll.
Copyright (c) 2013-2014 Florian Heinemann
FAQs
Simple, safe and straight-forward password hashing / salting for node.js
The npm package password-hash-and-salt receives a total of 4,665 weekly downloads. As such, password-hash-and-salt popularity was classified as popular.
We found that password-hash-and-salt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.