Socket
Socket
Sign inDemoInstall

node-pbkdf2

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-pbkdf2

Wrapper around pbkdf2 to securely and hash and check passwords in a future-proof manner, abstracting the API change between node v0.8 and v0.10


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-pbkdf2

Wrapper to hash and check password with Node's crypto module's built-in pbkdf2.

It abstracts the API change between Node v0.8 and v0.10, you can begin using this module with one of the versions and it will also work on the other.

It is future-proof, meaning that you can change the parameters to arbitrarily increase the strength of new password encryption and it will still be able to check against passwords encrypted with the old method.

// Install it
npm install node-pbkdf2

// Run tests (dev dependencies need to be installed)
make test

// Create a new password hasher with standard strength parameters
var NodePbkdf2 = require('node-pbkdf2')
  , hasher = new NodePbkdf2({ iterations: 10000, saltLength: 12, derivedKeyLength: 30 });

// Hash a password
hasher('supersecret', function (err, encryptedPassword) {
  // encryptedPassword is a string
});

// Check a given password against an encrypted one
hasher('supersecret', encryptedPassword, function (err, passwordIsCorrect) {
  // passwordIsCorrect is true
});

License

MIT, do whatever you want with the code, just leave this message here
(c) 2013 Louis Chatriot (louis@tldr.io)

Keywords

FAQs

Last updated on 15 May 2013

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc