https://github.com/alvaropaco/pbkdf2js
This project is a lite implementation of PBKDF2 hash crypt algorithm.
https://github.com/alvaropaco/pbkdf2js
Last synced: 2 months ago
JSON representation
This project is a lite implementation of PBKDF2 hash crypt algorithm.
- Host: GitHub
- URL: https://github.com/alvaropaco/pbkdf2js
- Owner: alvaropaco
- Created: 2016-04-13T15:48:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-28T21:53:17.000Z (about 9 years ago)
- Last Synced: 2024-04-26T20:48:58.274Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PBKDF2Js [](https://badge.fury.io/js/pbkdf2-js)
This project is a lite implementation of PBKDF2 hash crypt algorithm.# Usage Cases
Below you can fin some cases to use this library.
- Encrypt a plain password.
- Decrypt a hash password from AspNet data storage.
- Check a plain password with a hash.### Version
1.0.0### Installation
You need the Crypto.js extension installed:
```sh
$ npm i -g pbkdf2-js
```#### Creating a Hash from a plain String
```js
var crypt = require("./lib/pbkdf2.min");var passPlain = "testMyPass";
var hashed = crypt.hashPassword(passPlain, function (nullable, hashed) {
console.log(hashed);
});
```#### Checking validate of a plain pass with a hashed
```js
var crypt = require("./lib/pbkdf2.min");var isValid = crypt.verifyPassword(passPlain, hashed, function (nullable, result) {
console.log("Is same? " + result);
});
```