@agarcian/passwordhash
Salted password hashing with PBKDF2. (Adapted from http://crackstation.net/hashing-security.htm)
Last updated 3 years ago by agarcian .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @agarcian/passwordhash 
SYNC missed versions from official npm registry.

Password Hash

A node.js module to hash passwords based on this article: https://crackstation.net/hashing-security.htm

This produces a password in the following format:

<hashing algorithm>:<number of iterations>:<hashed password>:<unique seed>

For example, the following is a hash for the password Florence123:

sha1:20000:p5GwEABDCx/HwW9p2gMXoyUAMXkWNPU4:dRUwYNvT0iapWk3l+OaiFPzb6z/ii20r

##Benefits

The article describes the algorithm to produce a secure hash for a password. Some of the main benefits is that each entry contains its own secure seed, so every record in the database should have a different seed for every password.

Installation

npm install @agarcian/passwordhash

Usage

var passwordhash = require('@agarcian/passwordhash');

var pwd  = 'my password';
var hash = passwordhash.createHash(pwd, function(err, hash) {
    passwordhash.validatePassword(pwd, hash, function(err, success) {
        console.log('The password hash was validated successfully:' + success ? 'yes' : 'no');
    });
});

Output should be yes

Tests

npm test

Current Tags

  • 1.0.3                                ...           latest (3 years ago)

4 Versions

  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 5
Last Month 14
Dependencies (3)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |