Socket
Socket
Sign inDemoInstall

@ctrlpanel/pbkdf2

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ctrlpanel/pbkdf2

Small package exporting a PBKDF2 function that works both in Node.js and in browsers.


Version published
Weekly downloads
653
increased by55.48%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

PBKDF2 for Node.js and Browsers

Small package exporting a PBKDF2 function that works both in Node.js and in browsers.

Installation

npm install --save @ctrlpanel/pbkdf2

Usage

const pbkdf2 = require('@ctrlpanel/pbkdf2')

const password = Buffer.from('super secret')
const salt = Buffer.from('salt')

pbkdf2(password, salt, 500000, 32, 'SHA-512').then((result) => {
  console.log(result)
  //=> ArrayBuffer { byteLength: 32 }
})

API

pbkdf2(password, salt, iterations, keylen, digest) => ArrayBuffer

  • password: ArrayBuffer | Uint8Array | Buffer - The password to base the derivation on
  • salt: ArrayBuffer | Uint8Array | Buffer - The salt used when deriving
  • iterations: number - Number of iterations
  • keylen: number - Byte length of output key
  • digest: 'SHA-256' | 'SHA-384' | 'SHA-512' - Hash algorithm to use

Derive a key from password, and return it as an ArrayBuffer.

Keywords

FAQs

Last updated on 18 Dec 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc