New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ezhash

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ezhash

Utility for simple and secure password encryption and verification

latest
npmnpm
Version
1.1.0
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

EZHash

EZHash is a simple to use module that allows you to encrypt and verify passwords using hashing function PBKDF2 and Node built-in module crypto. EZHash provides both sync and async option for hashing and verification.

Installation

$ npm i ezhash

Usage

EZHash module is imported into your project like this:

const EZHash = require('ezhash')();

You can also pass in optional setting values like this:

const EZHash = require('ezhash')({
  // (Values listed below are the default ones)  
  hashLength: 64, // Determines length of the hash in bytes
  saltLength: 16, // Determines length of the salt in bytes
  iterations: 100000, // Determines how many times the password will be hashed
  algo: 'sha512' // Determines which hashing algorithm will be used
});

After importing the module you can utilise these functions:

EZHash.hashPass('password'); // Returns a Promise that resolves with a derived key produced by PBKDF2
EZHash.verifyPass('password', derivedKey); // Returns a Promise that resolves with a boolean which determines whether the password matches the key
EZHash.hashPassSync('password'); // Returns a derived key produced by PBKDF2
EZHash.verifyPassSync('password', derivedKey); // Returns a boolean that determines whether the password matches the key

License

MIT

Keywords

easyhash

FAQs

Package last updated on 21 Apr 2020

Did you know?

Socket

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