# pbkdf2

> This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from crypto.getHashes()

Latest version **3.1.6** (published 2026-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install pbkdf2
pnpm add pbkdf2
yarn add pbkdf2
bun add pbkdf2
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.1.6 |
| Published | 2026-05-26 |
| First published | 2014-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 203 |
| Author | Daniel Cousens |
| Maintainers | ljharb, dcousens, fundon, cwmma, indutny, jprichardson |
| Keywords | pbkdf2, kdf, salt, hash |

## Links

- npm: https://www.npmjs.com/package/pbkdf2
- Repository: https://github.com/browserify/pbkdf2
- Issues: https://github.com/browserify/pbkdf2/issues
- npm.io page: https://npm.io/package/pbkdf2

## Dependencies (6)

- [sha.js](https://npm.io/package/sha.js.md) ^2.4.12
- [ripemd160](https://npm.io/package/ripemd160.md) ^2.0.3
- [to-buffer](https://npm.io/package/to-buffer.md) ^1.2.2
- [create-hash](https://npm.io/package/create-hash.md) ^1.2.0
- [create-hmac](https://npm.io/package/create-hmac.md) ^1.1.7
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.2.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 3.1.6 (latest) — 2026-05-26
- 3.1.5 — 2025-09-24
- 3.1.4 — 2025-09-23
- 3.1.3 — 2025-06-20
- 3.1.2 — 2021-04-09
- 3.1.1 — 2020-06-04
- 3.1.0 — 2020-06-03
- 3.0.17 — 2018-09-25
- 3.0.16 — 2018-04-20
- 3.0.14 — 2017-09-08
- 3.0.13 — 2017-08-02
- 3.0.12 — 2017-05-11
- 3.0.11 — 2017-05-11
- 3.0.10 — 2017-05-11
- 3.0.9 — 2016-10-05
- … 11 more at https://npm.io/package/pbkdf2/versions

## README

# pbkdf2 <sup>[![Version Badge][2]][1]</sup>

This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from `crypto.getHashes()`

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

## Usage

```js
var pbkdf2 = require('pbkdf2')
var derivedKey = pbkdf2.pbkdf2Sync('password', 'salt', 1, 32, 'sha512')

...
```

For more information on the API, please see the relevant [Node documentation](https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback).

For high performance, use the `async` variant (`pbkdf2.pbkdf2`), not `pbkdf2.pbkdf2Sync`; this variant has the oppurtunity to use `window.crypto.subtle` when browserified.


## Credits

This module is a derivative of [cryptocoinjs/pbkdf2-sha256](https://github.com/cryptocoinjs/pbkdf2-sha256/), so thanks to [JP Richardson](https://github.com/jprichardson/) for laying the ground work.

Thank you to [FangDun Cai](https://github.com/fundon) for donating the package name on npm, if you're looking for his previous module it is located at [fundon/pbkdf2](https://github.com/fundon/pbkdf2).

[1]: https://npmjs.org/package/pbkdf2
[2]: https://versionbadg.es/browserify/pbkdf2.svg
[5]: https://david-dm.org/browserify/pbkdf2.svg
[6]: https://david-dm.org/browserify/pbkdf2
[7]: https://david-dm.org/browserify/pbkdf2/dev-status.svg
[8]: https://david-dm.org/browserify/pbkdf2#info=devDependencies
[11]: https://nodei.co/npm/pbkdf2.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/pbkdf2.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/pbkdf2.svg
[downloads-url]: https://npm-stat.com/charts.html?package=pbkdf2
[codecov-image]: https://codecov.io/gh/browserify/pbkdf2/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/browserify/pbkdf2/
[actions-image]: https://img.shields.io/github/check-runs/browserify/pbkdf2/master
[actions-url]: https://github.com/browserify/pbkdf2/actions

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