Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

node bindings for crypto_scrypt

branch: master
.gitignore first commit
.license first commit
.travis.yml node 0.11 and 0.8 compatibility first commit
bench.js use openssl/sha.h
binding.gyp use node's openssl
crypto_scrypt-sse.c node 0.11 and 0.8 compatibility
crypto_scrypt.h first commit
index.js first commit node 0.11 and 0.8 compatibility
package.json use node's openssl
test.js first commit


node bindings for crypto_scrypt from scrypt

Build Status


var scrypt = require('scrypt-hash')

var password = Buffer('aprettybadpassword')
var salt = Buffer('adashofsalt')
var N = 1024 * 64
var r = 8
var p = 1
var len = 32

scrypt(password, salt, N, r, p, len, function (err, hash) {
    if (err) {
        return console.error(err)
    console.assert(hash.length === len)
    console.log('The hashed password is', hash.toString('hex'))

scrypt(data, salt, N, r, p, len, callback)


  • data - Buffer - the value you want to hash
  • salt - Buffer
  • N - Number - must be 32bit integer and a power of 2
  • r - Number
  • p - Number
  • len - Number - length of the returned hash
  • callback - function (err, hash)
    • err - Error
    • hash - Buffer

For info on what N, r, p do see


Major and Minor version numbers follow the scrypt C source. The Patch number of this library may differ from the upstream version as changes to either will increment this one.


BSD 2-Clause, Copyright 2013 Danny Coates

scrypt licensed under BSD 2-Clause, Copyright 2009 Colin Percival

Something went wrong with that request. Please try again.