All Projects → dchest → Scrypt Async Js

dchest / Scrypt Async Js

Licence: bsd-2-clause
Fast "async" scrypt implementation in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Scrypt Async Js

Pick
A secure and easy-to-use CLI password manager for macOS and Linux
Stars: ✭ 359 (+167.91%)
Mutual labels:  crypto, scrypt
Demo Twilio Backend Nodejs
A sample backend that demonstrates how to generate a Virgil JWT and Twilio token used for authentication with the Virgil and Twilio services
Stars: ✭ 128 (-4.48%)
Mutual labels:  crypto
Chain Main
Crypto.org Chain⛓: Croeseid Testnet and beyond development
Stars: ✭ 109 (-18.66%)
Mutual labels:  crypto
Certstrap
Tools to bootstrap CAs, certificate requests, and signed certificates.
Stars: ✭ 1,689 (+1160.45%)
Mutual labels:  crypto
Charm
A really tiny crypto library.
Stars: ✭ 116 (-13.43%)
Mutual labels:  crypto
Noise
.NET Standard 1.3 implementation of the Noise Protocol Framework (revision 33 of the spec)
Stars: ✭ 124 (-7.46%)
Mutual labels:  crypto
Nanocurrency Js
🔗 A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.
Stars: ✭ 113 (-15.67%)
Mutual labels:  crypto
Octavo
Highly modular & configurable hash & crypto library
Stars: ✭ 131 (-2.24%)
Mutual labels:  crypto
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-4.48%)
Mutual labels:  crypto
Gnome Feeder
Profit Trailer Feeder Full Build with Settings
Stars: ✭ 122 (-8.96%)
Mutual labels:  crypto
React Native Aes
Native module for AES encryption
Stars: ✭ 120 (-10.45%)
Mutual labels:  crypto
Keepass4web
An application that serves KeePass database entries on a web frontend
Stars: ✭ 115 (-14.18%)
Mutual labels:  crypto
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (-7.46%)
Mutual labels:  scrypt
Cag
Crypto Audit Guidelines
Stars: ✭ 115 (-14.18%)
Mutual labels:  crypto
Libchaos
Advanced library for randomization, hashing and statistical analysis (devoted to chaos machines). 🔬
Stars: ✭ 1,619 (+1108.21%)
Mutual labels:  crypto
Php Mpos
MPOS stands for Mining Portal Open Source. Issue tracker is now closed since it's not maintained anymore.
Stars: ✭ 1,501 (+1020.15%)
Mutual labels:  scrypt
Coinmon
💰 The cryptocurrency price tool on CLI. 🖥
Stars: ✭ 1,581 (+1079.85%)
Mutual labels:  crypto
Merkle
Node.js module implementing Merkle tree algorithm
Stars: ✭ 123 (-8.21%)
Mutual labels:  crypto
Cryptocurrency Portfolio
Google Sheets automatic creation with Google Apps Script (GAS) for managing a cryptocurrency tracking spreadsheet with multi exchanges
Stars: ✭ 134 (+0%)
Mutual labels:  crypto
Botan
Cryptography Toolkit
Stars: ✭ 1,798 (+1241.79%)
Mutual labels:  crypto

scrypt-async

Build Status Coverage Status

Saucelabs Test Status

Fast "async" scrypt implementation in JavaScript.

Works in browsers without throwing "kill slow script" warnings due to configurable interruptStep, which yields from calculation. Compatible even with old versions of IE. Also works with Node.js (but you should really use the C implementation for that).

Installation

You can install it via a package manager:

NPM:

$ npm install scrypt-async

Yarn:

$ yarn add scrypt-async

or download source code.

To improve performance with small interruptStep values, use setImmediate shim, such as https://github.com/YuzuJS/setImmediate.

Usage

Modern API

scrypt(password, salt, options, callback)

Derives a key from password and salt and calls callback with derived key as the only argument.

If interruptStep is set, calculations are interrupted with setImmediate (or zero setTimeout) at the given interruptSteps to avoid freezing the browser. If it's not set or set to zero, the callback is called immediately after the calculation, avoiding setImmediate.

Arguments:

  • password — password (string or Array of bytes or Uint8Array)
  • salt — salt (string or Array of bytes or Uint8Array)
  • options — object with key derivation options
  • callback — callback function receiving result (function (Array|Uint8Array|string))
Options:
  • N — CPU/memory cost parameter (must be power of two; alternatively, you can specify logN where N = 2^logN).
  • r — block size parameter
  • p — parallelization parameter (default is 1)
  • dkLen — derived key length (default is 32)
  • interruptStep — (optional) the amount of loop cycles to execute before the next setImmediate/setTimeout (defaults to 0)
  • encoding — (optional) result encoding 'base64' or 'hex' (result will be a string), 'binary' (result will be a Uint8Array) or undefined (result will be an Array of bytes).

Example:

scrypt('mypassword', 'saltysalt', {
    N: 16384,
    r: 8,
    p: 1,
    dkLen: 16,
    encoding: 'hex'
}, function(derivedKey) {
    console.log(derivedKey); // "5012b74fca8ec8a4a0a62ffdeeee959d"
});

Legacy API (deprecated)

scrypt(password, salt, logN, r, dkLen, [interruptStep], callback, [encoding])

Legacy API doesn't support parallelization parameter greater than 1.

Arguments:
  • password — password (string or Array of bytes or Uint8Array)
  • salt — salt (string or Array of bytes or Uint8Array)
  • logN — CPU/memory cost parameter (1 to 31)
  • r — block size parameter
  • dkLen — length of derived key
  • interruptStep — (optional) the amount of loop cycles to execute before the next setImmediate/setTimeout (defaults to 1000)
  • callback — callback function receiving result (function (Array|Uint8Array|string))
  • encoding — (optional) result encoding ('base64', 'hex', 'binary' or undefined).

When encoding is not set, the result is an Array of bytes.

License

BSD-like, see LICENSE file or MIT license at your choice.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].