Socket
Socket
Sign inDemoInstall

scryptsy

Package Overview
Dependencies
0
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scryptsy

Pure JavaScript implementation of the scrypt key deriviation function that is fully compatible with Node.js and the browser.


Version published
Maintainers
2
Install size
10.3 kB
Created

Readme

Source

scryptsy

build status Coverage Status Version

scryptsy is a pure Javascript implementation of the scrypt key derivation function that is fully compatible with Node.js and the browser (via Browserify).

Why?

Scrypt is an integral part of many crypto currencies. It's a part of the BIP38 standard for encrypting private Bitcoin keys. It also serves as the proof-of-work system for many crypto currencies, most notably: Litecoin and Dogecoin.

Installation

npm install --save scryptsy

Example

var scrypt = require('scryptsy')

var key = "pleaseletmein"
var salt = "SodiumChloride"
var data = scrypt(key, salt, 16384, 8, 1, 64)
console.log(data.toString('hex'))
// => 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887

API

scrypt(key, salt, N, r, p, keyLenBytes, [progressCallback])

  • key: The key. Either Buffer or string.
  • salt: The salt. Either Buffer or string.
  • N: The number of iterations. number (integer)
  • r: Memory factor. number (integer)
  • p: Parallelization factor. number (integer)
  • keyLenBytes: The number of bytes to return. number (integer)
  • progressCallback: Call callback on every 1000 ops. Passes in {current, total, percent} as first parameter to progressCallback().

Returns Buffer.

Resources

License

MIT

Keywords

FAQs

Last updated on 27 May 2016

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