Skip to content

library for storing passwords in database securely

Notifications You must be signed in to change notification settings

vaibhavahuja/secura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secura

Build Status

Storing passwords in plain text can be very dangerous, even using a simple hashing algorithm is prone to attacks.

Hashing securely and comparing passwords the asynchronous way. This module returns a promise with the hashed password and also compares it.

Usage

Install the module :

npm install secura

Usage is very simple and straightforward. One need not be a cryptographic expert in order to hash the passwords in the database.

const secura = require('secura');

Generate Password

This converts the user password to a secure hash.

secura.generatePassword(password)
      .then(hash=>{
          //store the hash in the database
      });

Verify Password

This verifies if the password entered by the user matches the hashed password stored in the database.

secura.validatePassword(password, hash)
      .then(isMatch=>{
          //returns true if password matches and false otherwise
      })

Features

  • Simple and straightforward to use. No knowledge of cryptography required to hash passwords and compare.
  • Every hashed password is 61 digits long.
  • Protection from Brute Force & Dictionary Attacks.
  • Protection from Rainbow Table Attacks.
  • Randomly generated salt for every password.
  • Extra field is not required for storing salt in the database.
  • Uses PBKDF2 to compute hash.

Contributing

  • Clone this repository
  • Make changes/additions
  • Write Unit Tests
  • Send a pull request

About

library for storing passwords in database securely

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published