# password-encrypter

> Utilises node.js's crypto module to encrypt passwords with a salt.

Latest version **0.0.2** (published 2016-02-28) · 0 weekly downloads

## Install

```sh
npm install password-encrypter
pnpm add password-encrypter
yarn add password-encrypter
bun add password-encrypter
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-02-28 |
| First published | 2016-02-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dolanmiu |

## Links

- npm: https://www.npmjs.com/package/password-encrypter
- npm.io page: https://npm.io/package/password-encrypter

## Recent versions

- 0.0.2 (latest) — 2016-02-28
- 0.0.1 — 2016-02-28

## README

# Crypto Password
Utilises node.js's  crypto module to encrypt passwords with a salt.

> Very simple to use and helps creates salts and password hashes to be entered into the database, for security. Because you know, storing passwords in raw form, or even without a salt is very bad practice.

## Usage:

```js
var passwordEncrypter = require('password-encrypter');

passwordEncrypter.encrypt("password123!", function (salt, hashedPassword) {
  // do whatever you want with the salt and hashedPassword;
});
```

There is no real way to decrypt the password, so the only way is to encrypt and check. To check if encrypted password is correct:

```js
passwordEncrypter.checkMatch("password123!", "HASHED_PASSWORD", "MY_SALT", function (err, isMatch) {
  if (isMatch) {
    // success! the passwords are correct! Assign sessions/cookies to user and authenticate
  } else {
    // Boo! Wrong password.
  }
});
```
## License

MIT: [http://rem.mit-license.org](http://rem.mit-license.org)

---
_Source: https://npm.io/package/password-encrypter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
