Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scryptsy

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scryptsy - npm Package Compare versions

Comparing version 1.2.1 to 2.0.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

2.0.0 / 2016-05-26
------------------
- **breaking** Node v0.10 not supported anymore.
1.2.1 / 2015-03-01

@@ -2,0 +6,0 @@ ------------------

63

lib/scrypt.js

@@ -1,2 +0,3 @@

var pbkdf2Sync = require('pbkdf2').pbkdf2Sync
var crypto = require('crypto')
/* eslint-disable camelcase */

@@ -21,3 +22,3 @@ var MAX_VALUE = 0x7fffffff

// pseudo global
var B = pbkdf2Sync(key, salt, 1, p * 128 * r, 'sha256')
var B = crypto.pbkdf2Sync(key, salt, 1, p * 128 * r, 'sha256')

@@ -47,3 +48,3 @@ var tickCallback

return pbkdf2Sync(key, B, 1, dkLen, 'sha256')
return crypto.pbkdf2Sync(key, B, 1, dkLen, 'sha256')

@@ -117,30 +118,30 @@ // all of these functions are actually moved to the top

for (i = 8; i > 0; i -= 2) {
x[ 4] ^= R(x[ 0] + x[12], 7)
x[ 8] ^= R(x[ 4] + x[ 0], 9)
x[12] ^= R(x[ 8] + x[ 4], 13)
x[ 0] ^= R(x[12] + x[ 8], 18)
x[ 9] ^= R(x[ 5] + x[ 1], 7)
x[13] ^= R(x[ 9] + x[ 5], 9)
x[ 1] ^= R(x[13] + x[ 9], 13)
x[ 5] ^= R(x[ 1] + x[13], 18)
x[14] ^= R(x[10] + x[ 6], 7)
x[ 2] ^= R(x[14] + x[10], 9)
x[ 6] ^= R(x[ 2] + x[14], 13)
x[10] ^= R(x[ 6] + x[ 2], 18)
x[ 3] ^= R(x[15] + x[11], 7)
x[ 7] ^= R(x[ 3] + x[15], 9)
x[11] ^= R(x[ 7] + x[ 3], 13)
x[15] ^= R(x[11] + x[ 7], 18)
x[ 1] ^= R(x[ 0] + x[ 3], 7)
x[ 2] ^= R(x[ 1] + x[ 0], 9)
x[ 3] ^= R(x[ 2] + x[ 1], 13)
x[ 0] ^= R(x[ 3] + x[ 2], 18)
x[ 6] ^= R(x[ 5] + x[ 4], 7)
x[ 7] ^= R(x[ 6] + x[ 5], 9)
x[ 4] ^= R(x[ 7] + x[ 6], 13)
x[ 5] ^= R(x[ 4] + x[ 7], 18)
x[11] ^= R(x[10] + x[ 9], 7)
x[ 8] ^= R(x[11] + x[10], 9)
x[ 9] ^= R(x[ 8] + x[11], 13)
x[10] ^= R(x[ 9] + x[ 8], 18)
x[4] ^= R(x[0] + x[12], 7)
x[8] ^= R(x[4] + x[0], 9)
x[12] ^= R(x[8] + x[4], 13)
x[0] ^= R(x[12] + x[8], 18)
x[9] ^= R(x[5] + x[1], 7)
x[13] ^= R(x[9] + x[5], 9)
x[1] ^= R(x[13] + x[9], 13)
x[5] ^= R(x[1] + x[13], 18)
x[14] ^= R(x[10] + x[6], 7)
x[2] ^= R(x[14] + x[10], 9)
x[6] ^= R(x[2] + x[14], 13)
x[10] ^= R(x[6] + x[2], 18)
x[3] ^= R(x[15] + x[11], 7)
x[7] ^= R(x[3] + x[15], 9)
x[11] ^= R(x[7] + x[3], 13)
x[15] ^= R(x[11] + x[7], 18)
x[1] ^= R(x[0] + x[3], 7)
x[2] ^= R(x[1] + x[0], 9)
x[3] ^= R(x[2] + x[1], 13)
x[0] ^= R(x[3] + x[2], 18)
x[6] ^= R(x[5] + x[4], 7)
x[7] ^= R(x[6] + x[5], 9)
x[4] ^= R(x[7] + x[6], 13)
x[5] ^= R(x[4] + x[7], 18)
x[11] ^= R(x[10] + x[9], 7)
x[8] ^= R(x[11] + x[10], 9)
x[9] ^= R(x[8] + x[11], 13)
x[10] ^= R(x[9] + x[8], 18)
x[12] ^= R(x[15] + x[14], 7)

@@ -147,0 +148,0 @@ x[13] ^= R(x[12] + x[15], 9)

{
"name": "scryptsy",
"version": "1.2.1",
"version": "2.0.0",
"description": "Pure JavaScript implementation of the scrypt key deriviation function that is fully compatible with Node.js and the browser.",

@@ -13,7 +13,5 @@ "main": "lib/scrypt.js",

"mochify": "^2.1.0",
"standard": "^3.2.0"
"standard": "^7.1.1"
},
"dependencies": {
"pbkdf2": "^3.0.3"
},
"dependencies": {},
"repository": {

@@ -39,4 +37,4 @@ "url": "git@github.com:cryptocoinjs/scryptsy.git",

"browser-test": "./node_modules/.bin/mochify --wd -R spec",
"standard": "standard"
"lint": "standard"
}
}
scryptsy
========
[![build status](https://secure.travis-ci.org/cryptocoinjs/scryptsy.png)](http://travis-ci.org/cryptocoinjs/scryptsy)
[![build status](https://secure.travis-ci.org/cryptocoinjs/scryptsy.svg)](http://travis-ci.org/cryptocoinjs/scryptsy)
[![Coverage Status](https://img.shields.io/coveralls/cryptocoinjs/scryptsy.svg)](https://coveralls.io/r/cryptocoinjs/scryptsy)
[![Version](http://img.shields.io/npm/v/scryptsy.svg)](https://www.npmjs.org/package/scryptsy)
`scryptsy` is a pure JavaScript implementation of the [scrypt][wiki] key deriviation function that is fully compatible with Node.js and the browser (via Browserify).
`scryptsy` is a pure Javascript implementation of the [scrypt][wiki] key derivation function that is fully compatible with Node.js and the browser (via Browserify).
### Official documentation:
http://cryptocoinjs.com/modules/crypto/scryptsy/
Why?
----
`Scrypt` is an integral part of many crypto currencies. It's a part of the [BIP38](https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki) standard for encrypting private Bitcoin keys. It also serves as the [proof-of-work system](http://en.wikipedia.org/wiki/Proof-of-work_system) for many crypto currencies, most notably: Litecoin and Dogecoin.
Installation
------------
npm install --save scryptsy
Example
-------
```js
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
---------
- [Tarsnap Blurb on Scrypt][tarsnap]
- [Scrypt Whitepaper](http://www.tarsnap.com/scrypt/scrypt.pdf)
- [IETF Scrypt](https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-00) (Test vector params are [incorrect](https://twitter.com/dchest/status/247734446881640448).)
License
-------
MIT
[wiki]: http://en.wikipedia.org/wiki/Scrypt
[tarsnap]: http://www.tarsnap.com/scrypt.html

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc