Skip to content
A simple toolkit for generate, analyse and hash passwords with Node.js.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Password toolkit

Password toolkit is a simple library that will help you handling passwords with Node.js without any dependencies. You can use this library to generate suggested passwords, analyse user provided passwords in order to get a strength score and create a hash that can be stored within the database.

Password analysis

Simple analysis:


Complete analysis (async with Promise support):


Note that the complete analysis require a dictionary containing a list of weak passwords, passwords in this list must be separated by a break line (\n). You can download dictionaries here. Both methods will return an object containing informations about chars count, keywords and the score.

Password generation

Random password:


Human readable password generation (async with Promise support):


Note that in order to generate human readable passwords you need a dictionary, words in the dictionary must be separated by a break line (\n). If you are looking for an English word list, give a look here.

Password hashing

Simple hash generation:


More complex hash generation:


The first method will return the hash as a string, the second one will return an object with the hash and its parameters (salts, algorithm, loop number). If you need to compare a given password and a hash generated with the first method you can use this method:

passwordToolBox.hash.compareSimpleHash(password, hash);

While if you used the second method you can do this:

passwordToolBox.hash.compareHash(password, hash);

Are you looking for the PHP version? Give a look here.

You can’t perform that action at this time.