Giter Club home page Giter Club logo

node-argon2's Introduction

node-argon2

Financial contributors on Open Collective Build status NPM package

Bindings to the reference Argon2 implementation.

Want to use it on the command line? Instead check node-argon2-cli.

Usage

It's possible to hash using either Argon2i, Argon2d or Argon2id (default), and verify if a password matches a hash.

To hash a password:

const argon2 = require('argon2');

try {
  const hash = await argon2.hash("password");
} catch (err) {
  //...
}

To see how you can modify the output (hash length, encoding) and parameters (time cost, memory cost and parallelism), read the wiki

To verify a password:

try {
  if (await argon2.verify("<big long hash>", "password")) {
    // password match
  } else {
    // password did not match
  }
} catch (err) {
  // internal failure
}

Migrating from another hash function

See this article on the wiki for steps on how to migrate your existing code to Argon2. It's easy!

TypeScript usage

A TypeScript type declaration file is published with this module. If you are using TypeScript 2.0.0 or later, that means you do not need to install any additional typings in order to get access to the strongly typed interface. Simply use the library as mentioned above.

import * as argon2 from "argon2";

const hash = await argon2.hash(..);

Prebuilt binaries

node-argon2 provides prebuilt binaries from v0.26.0 onwards. They are built every release using GitHub Actions.

The current prebuilt binaries are built and tested with the following systems:

  • Ubuntu 20.04 (x86-64; ARM64 from v0.28.2)
  • MacOS 11 (x86-64)
  • MacOS 12 (ARM64 from v0.29.0)
  • Windows Server 2019 (x86-64)
  • Alpine Linux 3.18 (x86-64 from v0.28.1; ARM64 from v0.28.2)
  • FreeBSD 14 (x86-64 from v0.29.1)

Binaries should also work for any version more recent than the ones listed above. For example, the binary for Ubuntu 20.04 also works on Ubuntu 22.04, or any other Linux system that ships a newer version of glibc; the binary for MacOS 11 also works on MacOS 12. If your platform is below the above requirements, you can follow the Before installing section below to manually compile from source. It is also always recommended to build from source to ensure consistency of the compiled module.

Before installing

You can skip this section if the prebuilt binaries work for you.

You MUST have a node-gyp global install before proceeding with the install, along with GCC >= 5 / Clang >= 3.3. On Windows, you must compile under Visual Studio 2015 or newer.

node-argon2 works only and is tested against Node >=18.0.0.

OSX

To install GCC >= 5 on OSX, use homebrew:

$ brew install gcc

Once you've got GCC installed and ready to run, you then need to install node-gyp, you must do this globally:

$ npm install -g node-gyp

Finally, once node-gyp is installed and ready to go, you can install this library, specifying the GCC or Clang binary to use:

$ CXX=g++-12 npm install argon2

NOTE: If your GCC or Clang binary is named something different than g++-12, you'll need to specify that in the command.

FAQ

How do I manually rebuild the binaries?
$ npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2

Run @mapbox/node-pre-gyp instead of node-gyp because node-argon2's binding.gyp file relies on variables from @mapbox/node-pre-gyp.

You can omit npx @mapbox and use just node-pre-gyp if you have a global installation of @mapbox/node-pre-gyp, otherwise prefixing npx will use the local one in ./node_modules/.bin

How do I skip installing prebuilt binaries and manually compile from source?

You can do either of the two methods below:

  1. Force build from source on install.
$ npm install argon2 --build-from-source
  1. Ignore node-argon2 install script and build manually.
$ npm install argon2 --ignore-scripts
$ npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2
I installed Node as a snap, and I can't install node-argon2.

This seems to be an issue related to snap (see #345 (comment)). Installing Node with another package manager, such as asdf or nvm, is a possible workaround.

Differences from node-argon2-ffi

The interface of both are very similar, notably, node-argon2-ffi splits the argon2i and argon2d function set, but this module also has the argon2id option, which node-argon2-ffi does not support. Also, while node-argon2-ffi suggests you promisify crypto.randomBytes, node-argon2 library does that internally.

node-argon2 is much lighter than node-argon2-ffi, at 184 KB for [email protected] against 2.56 MB for [email protected]. Performance-wise, the libraries are equal. You can run the same benchmark suite if you are curious, but both can perform around 130 hashes/second on an Intel Core i5-4460 @ 3.2GHz with default options.

This library is implemented natively, meaning it is an extension to the node engine. Thus, half of the code is C++ bindings, the other half is Javascript functions. node-argon2-ffi uses ffi, a mechanism to call functions from one language in another, and handles the type bindings (e.g. JS Number -> C++ int).

Contributors

Code contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

Work licensed under the MIT License. Please check P-H-C/phc-winner-argon2 for license over Argon2 and the reference implementation.

node-argon2's People

Contributors

aron123 avatar bluwy avatar boogerlad avatar cgmb avatar dependabot[bot] avatar emmanouilspitaliorakis avatar felipeochoa avatar gadzy avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hoangvvo avatar igi2k avatar jdforsythe avatar khng300 avatar librehat avatar mannatera avatar markpeterfejes avatar monkeywithacupcake avatar notgull avatar ranisalt avatar ravelloh avatar rdegges avatar ricobrase avatar romainlanz avatar romansavchenko avatar sekarpdkt avatar simonepri avatar snyk-bot avatar titouanco avatar voltra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-argon2's Issues

Installation issue

Hello!

I'm currently trying to install Node-Argon2 in a debian7 server and I have been struggling for a few hours now without any luck.

I'm always getting the same error:

g++: error: unrecognized command line option ‘-Wpedantic’

I have install
Node 4.3
Npm 2.14
Python 2.7
Make 3.81

Weird behaviour of verify() with setTimeout()

The promise returned by verify() does not resolve before the first timer is up.

Steps to reproduce

// Without this line, verify() takes about 50ms to complete, with it, it takes 1 second.
setTimeout(function () {}, 1e3)

console.time('verify()')

require('argon2').verify('$argon2i$m=4096,t=3,p=1$tbagT6b1YH33niCo9lVzuA$htv/k+OqWk1V9zD9k5DOBi2kcfcZ6Xu3tWmwEPV3/nc', 'password')
  .then(function () {
    console.timeEnd('verify()')
  })

Environment

Operating system: Debian Stretch
Node version: 4.3.0

v0.17 bug - stopping getting correct results on a Unix VPS

Hi Ranieri,

We really love your repository, node-argon2, and at WebDollar we use it. The v0.16.2 from October is very stable and it worked on multiple machines, Unix and Windows. As, I have reported before, we had to adapt the v0.16.2 to avoid generating random salts.

The new update, v0.17.0 works like a charm on my Gnome-Ubuntu PC solving my issue with the random salts, but somehow, there is a problem on my VPS ( it uses Debian ). I install it, and it starts generating correct Argon2d hashes, but somehow after a few (random number but relatively small, like after 3-6-7 correct hashes), it starts generating bad argon2 hashes. The particularity of these bad hashes have, is that they have a lot of zeros in the hash. My guess is that maybe my VPS has little RAM and maybe this is the problem. But, again, the v0.16.2 works like a charm also on my VPS (but I have to manually fix that salt problem). Any ideas?

Here is an example of wrong hashes

data

001296448d71d672cdcf84e38bf76ed255bb6999943c285b6ba8f4f3fc10ac410000006b0001026ea8794036ab9b22f2c13a4de08ddfc05623750fc3ddc94f6f8d937c4af2e30002e702a59ad71e346e283fe4cf07c5c0b6a6ded95393f8f10d27cc57fe9b4d4dddb768143fe57382dc04ceef328ee87f98630ab727b6071dfb259a19b46484fa659ddc5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c945675d7682c8b5955557b2ef33654f31512b9b3edd17f74b5bf422ccabbd7537e1a006B

001296448d71d672cdcf84e38bf76ed255bb6999943c285b6ba8f4f3fc10ac41 real output

0000000000000000682b438c677f000020000000000000002100000000000000 argon2d v0.17 wrong output

Params

consts.HASH_ARGON2_PARAMS = {salt: 'WebDollar_make_$',time: 2, memPower:10, memBytes: 1024, parallelism: 2, type: 0, hashLen: 32  }

Any Ideas? Thanks

I can confirm again that 0.16.2 works on my VPS again. Here is an output from my VPS, hopefully it can help you out

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.2 (stretch)
Release:	9.2
Codename:	stretch

node-gyp >= 4.0.0?

Steps to reproduce

  1. Install latest stable release of node-gyp from npm (3.3.0).
  2. This is NOT >= 4.0.0
  3. Try to install this library via npm -- it will not work.

Expected behaviour

Ideally, this should build against 3.3.0 of node-gyp or greater (for future releases), but not depend on unreleased versions of node-gyp.

Actual behaviour

Things don't work :(

Environment

Operating system: OSX.

Node version: 5.5.0

Compiler version:

unable to install on windows

error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pa
ges or by right-clicking the solution and selecting "Retarget solution"

npm install requires nan to be installed first

When I try npm install argon2 I'm getting:

Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:327:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at [eval]:1:1
    at Object.exports.runInThisContext (vm.js:55:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:399:26)
    at node.js:592:27
    at nextTickCallbackWith0Args (node.js:433:9)
gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp

However if I npm install nan first it works fine.

Install fails on ARM (Raspberry Pi)

Steps to reproduce

  1. Install the latest version of node-gyp globally.
  2. Use Node 4.0.0+
  3. Attempt to install this module via npm: npm install argon2 --save in a project.

Actual behaviour

gyp verb command build []
gyp verb build type Release
gyp verb architecture arm
gyp verb node dev dir /home/pi/.node-gyp/4.2.1
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/pi/node-test/node_modules/argon2/build'
  cc '-DNODE_GYP_MODULE_NAME=libargon2' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' -I/home/pi/.node-gyp/4.2.1/include/node -I/home/pi/.node-gyp/4.2.1/src -I/home/pi/.node-gyp/4.2.1/deps/uv/include -I/home/pi/.node-gyp/4.2.1/deps/v8/include -I../argon2/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -march=native -pthread -Wno-type-limits -fvisibility=hidden -msse -msse2 -O3 -ffunction-sections -fdata-sections -fno-omit-frame-pointer  -MMD -MF ./Release/.deps/Release/obj.target/libargon2/argon2/src/argon2.o.d.raw  -c -o Release/obj.target/libargon2/argon2/src/argon2.o ../argon2/src/argon2.c
cc: error: unrecognized command line option ‘-msse’
cc: error: unrecognized command line option ‘-msse2’
libargon2.target.mk:103: recipe for target 'Release/obj.target/libargon2/argon2/src/argon2.o' failed
make: *** [Release/obj.target/libargon2/argon2/src/argon2.o] Error 1
make: Leaving directory '/home/pi/node-test/node_modules/argon2/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.9+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/node-test/node_modules/argon2
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

Environment

Operating system:
Raspbian GNU/Linux 8 (jessie) (Linux 4.4.9)
Node version:
v.4.2.1
Compiler version:
gcc version 4.9.2 (Raspbian 4.9.2-10)

Building argon2 itself without node-gyp works just fine, but I can't seem to get the library-file linked with the node-module. Maybe changing the bindings and build parameters for ARM (leaving out the msse and msse2 parameters) would solve this?

argon2.hash() method terminates the program

Before creating an issue, please be sure to:

  • Checkout to the latest version, including submodules
  • Try to find an isolated way to reproduce the behavior
  • Fill in all the blanks in the most specific way you can

Steps to reproduce

  1. Install argon2
  2. use argon2.hash(password); method with async await

Eg.

try {
    const hash1 = await argon2.hash(undefined);
} catch (e) {
    console.log(e);
}

Expected behavior

The error should be caught and application should not terminate

Actual behaviour

The error is not caught by catch(e) { } block and instead terminates the whole application with following output -

buffer.js:161
  throw new TypeError(kFromErrorMsg);
  ^

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at Function.Buffer.from (buffer.js:161:9)
    at RandomBytes.crypto.randomBytes [as ondone] (/home/agauniyal/projects/gsoc/crossroads/node_modules/argon2/index.js:45:30)

Environment

Operating system:
Arch Linux
Node version:
8.1.0
Compiler version:
gcc (GCC) 7.1.1 20170516

npm install argon2 fails

Facing an error while trying to execute an npm install argon2.

The installation ends with a build error stating ..\argon2\src\core.c(24): fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory

Detailed npm-debug.log as well as the error as displayed on the console are attached in npm-debug.zip.

Please help.

Failed at the [email protected] install script 'node-gyp rebuild'.

Hi! Trying to build jfurrow/flood on my rpi, and it consistently dies on this step. Only Argon2 seems to be a problem. node-gyp was installed globally successfully prior to this install.

Steps to reproduce

1.sudo npm install --unsafe-perm -g --verbose argon2
2.
3.

Expected behaviour

Build successful.

Actual behaviour

Verbose output below.

Environment

Raspbian Jessie
Node version: 7.10.1
Compiler version: 4.9.2

npm verb stack Error: [email protected] install: node-gyp rebuild
npm verb stack Exit status 1
npm verb stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
npm verb stack at emitTwo (events.js:106:13)
npm verb stack at EventEmitter.emit (events.js:194:7)
npm verb stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack at emitTwo (events.js:106:13)
npm verb stack at ChildProcess.emit (events.js:194:7)
npm verb stack at maybeClose (internal/child_process.js:899:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm verb pkgid [email protected]
npm verb cwd /opt/flood
npm ERR! Linux 4.9.35-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm" "-g" "--verbose" "argon2"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs argon2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls argon2
npm ERR! There is likely additional logging output above.
npm verb exit [ 1, true ]

npm ERR! Please include the following file with any support request:
npm ERR! /root/.npm/_logs/2017-11-27T15_02_34_772Z-debug.log

can't install argon2

Hello,
this error appear when installing node-argon2

../src/argon2_node.cpp:51:13: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
plain.c_str(), plain.size(), salt.c_str(), salt.size(), nullptr,
^
../src/argon2_node.cpp:11:7: error: expected nested-name-specifier before ‘uint’
using uint = unsigned int;
^
../src/argon2_node.cpp:11:12: error: expected ‘;’ before ‘=’ token
using uint = unsigned int;
^
../src/argon2_node.cpp:11:12: error: expected unqualified-id before ‘=’ token
../src/argon2_node.cpp:13:7: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
const auto ENCODED_LEN = 108u;
^
../src/argon2_node.cpp:13:12: error: ‘ENCODED_LEN’ does not name a type
const auto ENCODED_LEN = 108u;
^
../src/argon2_node.cpp:14:7: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
const auto HASH_LEN = 32u;
^
../src/argon2_node.cpp:14:12: error: ‘HASH_LEN’ does not name a type
const auto HASH_LEN = 32u;
^
../src/argon2_node.cpp:15:7: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
const auto SALT_LEN = 16u;
^
../src/argon2_node.cpp:15:12: error: ‘SALT_LEN’ does not name a type
const auto SALT_LEN = 16u;
^

attached full log :
log.txt
using ubuntu 14.0.4 and gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

Please help....
thank you

Travis fails to build argon2 in my project

I get the error cc1plus: error: unrecognized command line option ‘-Wpedantic’, I am surely missing something but I could not figure what.

Here is the build, note that because it is an optional dependency, the error is hidden and you have to expand the npm install line.

How does password verification works without using the salt?

More a question rather then an issue on this package.

How does password verification works if we doesn't pass the salt to the verification function?
Every password has a random salt, and as I understand, hash function works like this: hash(password + salt).

But verification function takes only password as an argument, so as I understand it can't generate the same hash as original, because hash(password) and hash(password + salt) will differ. So how does verification function know what salt it should use to verify every specific password?

support for node 0.10?

wanna try putting this into an AWS Lambda when i have time. just wondering if you'd consider supporting node v0.10. totally okay if you don't - i don't support 0.10 in any of my modules. i don't know how much work it requires.

fatal error: 'cstdint' file not found

Looks like problem with Clang/GCC?

wao@astrid~/P/s/lab> g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.0.0
Thread model: posix

wao@astrid~/P/s/lab> npm install argon2

> [email protected] install /Users/wao/node_modules/argon2
> node-gyp rebuild

  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
../src/argon2_node.cpp:4:10: fatal error: 'cstdint' file not found
#include <cstdint>
         ^
1 error generated.
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/wao/node_modules/argon2
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN ENOENT ENOENT: no such file or directory, open '/Users/wao/package.json'
npm WARN EPACKAGEJSON wao No description
npm WARN EPACKAGEJSON wao No repository field.
npm WARN EPACKAGEJSON wao No README data
npm WARN EPACKAGEJSON wao No license field.
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "argon2"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/wao/Projects/saferpass/lab/npm-debug.log

Not working on Windows

Steps to reproduce

Install the package with npm install argon2 --save.

Expected behaviour

It compiles and installs.

Actual behaviour

It exits with the following npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '--save',
1 verbose cli   'argon2' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData argon2
8 silly fetchNamedPackageData argon2
9 silly mapToRegistry name argon2
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/argon2
13 verbose request uri https://registry.npmjs.org/argon2
14 verbose request no auth needed
15 info attempt registry request try #1 at 15:12:41
16 verbose request id da9fc61169908448
17 verbose etag "4S7HL70KUUHWAVH4AH9O2AGP0"
18 http request GET https://registry.npmjs.org/argon2
19 http 304 https://registry.npmjs.org/argon2
20 verbose headers { date: 'Fri, 04 Mar 2016 14:12:42 GMT',
20 verbose headers   via: '1.1 varnish',
20 verbose headers   'cache-control': 'max-age=300',
20 verbose headers   etag: '"4S7HL70KUUHWAVH4AH9O2AGP0"',
20 verbose headers   age: '0',
20 verbose headers   connection: 'keep-alive',
20 verbose headers   'x-served-by': 'cache-ams4148-AMS',
20 verbose headers   'x-cache': 'HIT',
20 verbose headers   'x-cache-hits': '1',
20 verbose headers   'x-timer': 'S1457100762.190014,VS0,VE707',
20 verbose headers   vary: 'Accept' }
21 silly get cb [ 304,
21 silly get   { date: 'Fri, 04 Mar 2016 14:12:42 GMT',
21 silly get     via: '1.1 varnish',
21 silly get     'cache-control': 'max-age=300',
21 silly get     etag: '"4S7HL70KUUHWAVH4AH9O2AGP0"',
21 silly get     age: '0',
21 silly get     connection: 'keep-alive',
21 silly get     'x-served-by': 'cache-ams4148-AMS',
21 silly get     'x-cache': 'HIT',
21 silly get     'x-cache-hits': '1',
21 silly get     'x-timer': 'S1457100762.190014,VS0,VE707',
21 silly get     vary: 'Accept' } ]
22 verbose etag https://registry.npmjs.org/argon2 from cache
23 verbose get saving argon2 to C:\Users\Wout\AppData\Roaming\npm-cache\registry.npmjs.org\argon2\.cache.json
24 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
25 silly install normalizeTree
26 silly loadCurrentTree Finishing
27 silly loadIdealTree Starting
28 silly install loadIdealTree
29 silly cloneCurrentTree Starting
30 silly install cloneCurrentTreeToIdealTree
31 silly cloneCurrentTree Finishing
32 silly loadShrinkwrap Starting
33 silly install loadShrinkwrap
34 silly loadShrinkwrap Finishing
35 silly loadAllDepsIntoIdealTree Starting
36 silly install loadAllDepsIntoIdealTree
37 silly resolveWithNewModule [email protected] checking installable status
38 silly cache add args [ 'argon2', null ]
39 verbose cache add spec argon2
40 silly cache add parsed spec Result {
40 silly cache add   raw: 'argon2',
40 silly cache add   scope: null,
40 silly cache add   name: 'argon2',
40 silly cache add   rawSpec: '',
40 silly cache add   spec: 'latest',
40 silly cache add   type: 'tag' }
41 silly addNamed argon2@latest
42 verbose addNamed "latest" is being treated as a dist-tag for argon2
43 info addNameTag [ 'argon2', 'latest' ]
44 silly mapToRegistry name argon2
45 silly mapToRegistry using default registry
46 silly mapToRegistry registry https://registry.npmjs.org/
47 silly mapToRegistry uri https://registry.npmjs.org/argon2
48 verbose addNameTag registry:https://registry.npmjs.org/argon2 not in flight; fetching
49 verbose get https://registry.npmjs.org/argon2 not expired, no request
50 silly addNameTag next cb for argon2 with tag latest
51 silly addNamed [email protected]
52 verbose addNamed "0.9.0" is a plain semver version for argon2
53 silly cache afterAdd [email protected]
54 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\argon2\0.9.0\package\package.json not in flight; writing
55 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
56 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\argon2\0.9.0\package\package.json written
57 silly fetchNamedPackageData bindings
58 silly mapToRegistry name bindings
59 silly mapToRegistry using default registry
60 silly mapToRegistry registry https://registry.npmjs.org/
61 silly mapToRegistry uri https://registry.npmjs.org/bindings
62 silly fetchNamedPackageData nan
63 silly mapToRegistry name nan
64 silly mapToRegistry using default registry
65 silly mapToRegistry registry https://registry.npmjs.org/
66 silly mapToRegistry uri https://registry.npmjs.org/nan
67 verbose request uri https://registry.npmjs.org/bindings
68 verbose request no auth needed
69 info attempt registry request try #1 at 15:12:43
70 verbose etag "1LLBF9OH58DLBEL4629U6032D"
71 http request GET https://registry.npmjs.org/bindings
72 verbose request uri https://registry.npmjs.org/nan
73 verbose request no auth needed
74 info attempt registry request try #1 at 15:12:43
75 verbose etag "BAVERG4EG5W3XHF012VJBMBOB"
76 http request GET https://registry.npmjs.org/nan
77 http 304 https://registry.npmjs.org/bindings
78 verbose headers { date: 'Fri, 04 Mar 2016 14:12:43 GMT',
78 verbose headers   via: '1.1 varnish',
78 verbose headers   'cache-control': 'max-age=300',
78 verbose headers   etag: '"1LLBF9OH58DLBEL4629U6032D"',
78 verbose headers   age: '100',
78 verbose headers   connection: 'keep-alive',
78 verbose headers   'x-served-by': 'cache-ams4141-AMS',
78 verbose headers   'x-cache': 'HIT',
78 verbose headers   'x-cache-hits': '1',
78 verbose headers   'x-timer': 'S1457100763.450744,VS0,VE0',
78 verbose headers   vary: 'Accept' }
79 silly get cb [ 304,
79 silly get   { date: 'Fri, 04 Mar 2016 14:12:43 GMT',
79 silly get     via: '1.1 varnish',
79 silly get     'cache-control': 'max-age=300',
79 silly get     etag: '"1LLBF9OH58DLBEL4629U6032D"',
79 silly get     age: '100',
79 silly get     connection: 'keep-alive',
79 silly get     'x-served-by': 'cache-ams4141-AMS',
79 silly get     'x-cache': 'HIT',
79 silly get     'x-cache-hits': '1',
79 silly get     'x-timer': 'S1457100763.450744,VS0,VE0',
79 silly get     vary: 'Accept' } ]
80 verbose etag https://registry.npmjs.org/bindings from cache
81 verbose get saving bindings to C:\Users\Wout\AppData\Roaming\npm-cache\registry.npmjs.org\bindings\.cache.json
82 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
83 http 304 https://registry.npmjs.org/nan
84 verbose headers { date: 'Fri, 04 Mar 2016 14:12:43 GMT',
84 verbose headers   via: '1.1 varnish',
84 verbose headers   'cache-control': 'max-age=300',
84 verbose headers   etag: '"BAVERG4EG5W3XHF012VJBMBOB"',
84 verbose headers   age: '248',
84 verbose headers   connection: 'keep-alive',
84 verbose headers   'x-served-by': 'cache-ams4146-AMS',
84 verbose headers   'x-cache': 'HIT',
84 verbose headers   'x-cache-hits': '8',
84 verbose headers   'x-timer': 'S1457100763.457746,VS0,VE0',
84 verbose headers   vary: 'Accept' }
85 silly get cb [ 304,
85 silly get   { date: 'Fri, 04 Mar 2016 14:12:43 GMT',
85 silly get     via: '1.1 varnish',
85 silly get     'cache-control': 'max-age=300',
85 silly get     etag: '"BAVERG4EG5W3XHF012VJBMBOB"',
85 silly get     age: '248',
85 silly get     connection: 'keep-alive',
85 silly get     'x-served-by': 'cache-ams4146-AMS',
85 silly get     'x-cache': 'HIT',
85 silly get     'x-cache-hits': '8',
85 silly get     'x-timer': 'S1457100763.457746,VS0,VE0',
85 silly get     vary: 'Accept' } ]
86 verbose etag https://registry.npmjs.org/nan from cache
87 verbose get saving nan to C:\Users\Wout\AppData\Roaming\npm-cache\registry.npmjs.org\nan\.cache.json
88 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
89 silly resolveWithNewModule [email protected] checking installable status
90 silly cache add args [ 'nan@^2.2.0', null ]
91 verbose cache add spec nan@^2.2.0
92 silly cache add parsed spec Result {
92 silly cache add   raw: 'nan@^2.2.0',
92 silly cache add   scope: null,
92 silly cache add   name: 'nan',
92 silly cache add   rawSpec: '^2.2.0',
92 silly cache add   spec: '>=2.2.0 <3.0.0',
92 silly cache add   type: 'range' }
93 silly addNamed nan@>=2.2.0 <3.0.0
94 verbose addNamed ">=2.2.0 <3.0.0" is a valid semver range for nan
95 silly addNameRange { name: 'nan', range: '>=2.2.0 <3.0.0', hasData: false }
96 silly mapToRegistry name nan
97 silly mapToRegistry using default registry
98 silly mapToRegistry registry https://registry.npmjs.org/
99 silly mapToRegistry uri https://registry.npmjs.org/nan
100 verbose addNameRange registry:https://registry.npmjs.org/nan not in flight; fetching
101 silly resolveWithNewModule [email protected] checking installable status
102 silly cache add args [ 'bindings@^1.2.1', null ]
103 verbose cache add spec bindings@^1.2.1
104 silly cache add parsed spec Result {
104 silly cache add   raw: 'bindings@^1.2.1',
104 silly cache add   scope: null,
104 silly cache add   name: 'bindings',
104 silly cache add   rawSpec: '^1.2.1',
104 silly cache add   spec: '>=1.2.1 <2.0.0',
104 silly cache add   type: 'range' }
105 silly addNamed bindings@>=1.2.1 <2.0.0
106 verbose addNamed ">=1.2.1 <2.0.0" is a valid semver range for bindings
107 silly addNameRange { name: 'bindings', range: '>=1.2.1 <2.0.0', hasData: false }
108 silly mapToRegistry name bindings
109 silly mapToRegistry using default registry
110 silly mapToRegistry registry https://registry.npmjs.org/
111 silly mapToRegistry uri https://registry.npmjs.org/bindings
112 verbose addNameRange registry:https://registry.npmjs.org/bindings not in flight; fetching
113 verbose get https://registry.npmjs.org/nan not expired, no request
114 silly addNameRange number 2 { name: 'nan', range: '>=2.2.0 <3.0.0', hasData: true }
115 silly addNameRange versions [ 'nan',
115 silly addNameRange   [ '0.3.0-wip',
115 silly addNameRange     '0.3.0-wip2',
115 silly addNameRange     '0.3.0',
115 silly addNameRange     '0.3.1',
115 silly addNameRange     '0.3.2',
115 silly addNameRange     '0.4.0',
115 silly addNameRange     '0.4.1',
115 silly addNameRange     '0.4.2',
115 silly addNameRange     '0.4.3',
115 silly addNameRange     '0.4.4',
115 silly addNameRange     '0.5.0',
115 silly addNameRange     '0.5.1',
115 silly addNameRange     '0.5.2',
115 silly addNameRange     '0.6.0',
115 silly addNameRange     '0.7.0',
115 silly addNameRange     '0.7.1',
115 silly addNameRange     '0.8.0',
115 silly addNameRange     '1.0.0',
115 silly addNameRange     '1.1.0',
115 silly addNameRange     '1.1.1',
115 silly addNameRange     '1.1.2',
115 silly addNameRange     '1.2.0',
115 silly addNameRange     '1.3.0',
115 silly addNameRange     '1.4.0',
115 silly addNameRange     '1.4.1',
115 silly addNameRange     '1.5.0',
115 silly addNameRange     '1.4.2',
115 silly addNameRange     '1.4.3',
115 silly addNameRange     '1.5.1',
115 silly addNameRange     '1.5.2',
115 silly addNameRange     '1.6.0',
115 silly addNameRange     '1.5.3',
115 silly addNameRange     '1.6.1',
115 silly addNameRange     '1.6.2',
115 silly addNameRange     '1.7.0',
115 silly addNameRange     '1.8.0',
115 silly addNameRange     '1.8.1',
115 silly addNameRange     '1.8.2',
115 silly addNameRange     '1.8.3',
115 silly addNameRange     '1.8.4',
115 silly addNameRange     '1.9.0',
115 silly addNameRange     '2.0.0',
115 silly addNameRange     '2.0.1',
115 silly addNameRange     '2.0.2',
115 silly addNameRange     '2.0.3',
115 silly addNameRange     '2.0.4',
115 silly addNameRange     '2.0.5',
115 silly addNameRange     '2.0.6',
115 silly addNameRange     '2.0.7',
115 silly addNameRange     '2.0.8',
115 silly addNameRange     '2.0.9',
115 silly addNameRange     '2.1.0',
115 silly addNameRange     '2.2.0' ] ]
116 silly addNamed [email protected]
117 verbose addNamed "2.2.0" is a plain semver version for nan
118 verbose get https://registry.npmjs.org/bindings not expired, no request
119 silly addNameRange number 2 { name: 'bindings', range: '>=1.2.1 <2.0.0', hasData: true }
120 silly addNameRange versions [ 'bindings',
120 silly addNameRange   [ '0.0.1',
120 silly addNameRange     '0.1.0',
120 silly addNameRange     '0.1.1',
120 silly addNameRange     '0.2.0',
120 silly addNameRange     '0.2.1',
120 silly addNameRange     '0.2.2',
120 silly addNameRange     '0.2.3',
120 silly addNameRange     '0.2.4',
120 silly addNameRange     '0.3.0',
120 silly addNameRange     '0.4.0',
120 silly addNameRange     '1.0.0',
120 silly addNameRange     '1.1.0',
120 silly addNameRange     '1.1.1',
120 silly addNameRange     '1.2.0',
120 silly addNameRange     '1.2.1' ] ]
121 silly addNamed [email protected]
122 verbose addNamed "1.2.1" is a plain semver version for bindings
123 silly cache afterAdd [email protected]
124 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\bindings\1.2.1\package\package.json not in flight; writing
125 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
126 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\bindings\1.2.1\package\package.json written
127 silly cache afterAdd [email protected]
128 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\nan\2.2.0\package\package.json not in flight; writing
129 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
130 verbose afterAdd C:\Users\Wout\AppData\Roaming\npm-cache\nan\2.2.0\package\package.json written
131 silly loadAllDepsIntoIdealTree Finishing
132 silly idealTree:prePrune [email protected]
132 silly idealTree:prePrune +-- [email protected]
132 silly idealTree:prePrune +-- [email protected]
132 silly idealTree:prePrune `-- [email protected]
133 silly loadIdealTree Finishing
134 silly currentTree [email protected]
135 silly idealTree [email protected]
135 silly idealTree +-- [email protected]
135 silly idealTree +-- [email protected]
135 silly idealTree `-- [email protected]
136 silly generateActionsToTake Starting
137 silly install generateActionsToTake
138 silly generateActionsToTake Finishing
139 silly diffTrees action count 3
140 silly diffTrees add [email protected]
141 silly diffTrees add [email protected]
142 silly diffTrees add [email protected]
143 silly decomposeActions action count 24
144 silly decomposeActions fetch [email protected]
145 silly decomposeActions extract [email protected]
146 silly decomposeActions test [email protected]
147 silly decomposeActions preinstall [email protected]
148 silly decomposeActions build [email protected]
149 silly decomposeActions install [email protected]
150 silly decomposeActions postinstall [email protected]
151 silly decomposeActions finalize [email protected]
152 silly decomposeActions fetch [email protected]
153 silly decomposeActions extract [email protected]
154 silly decomposeActions test [email protected]
155 silly decomposeActions preinstall [email protected]
156 silly decomposeActions build [email protected]
157 silly decomposeActions install [email protected]
158 silly decomposeActions postinstall [email protected]
159 silly decomposeActions finalize [email protected]
160 silly decomposeActions fetch [email protected]
161 silly decomposeActions extract [email protected]
162 silly decomposeActions test [email protected]
163 silly decomposeActions preinstall [email protected]
164 silly decomposeActions build [email protected]
165 silly decomposeActions install [email protected]
166 silly decomposeActions postinstall [email protected]
167 silly decomposeActions finalize [email protected]
168 silly executeActions Starting
169 silly install executeActions
170 silly doSerial global-install 0
171 silly doParallel fetch 3
172 verbose correctMkdir C:\Users\Wout\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
173 verbose lock using C:\Users\Wout\AppData\Roaming\npm-cache\_locks\staging-bc5831b1337acf3b.lock for C:\Users\Wout\projects\test\node_modules\.staging
174 silly doParallel extract 3
175 silly extract [email protected]
176 silly extract [email protected]
177 silly extract [email protected]
178 verbose unbuild node_modules\.staging\bindings-974f9c0a
179 verbose unbuild node_modules\.staging\nan-0bb46a6d
180 verbose unbuild node_modules\.staging\argon2-1ed338ea
181 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a is being purged from base C:\Users\Wout\projects\test
182 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a
183 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d is being purged from base C:\Users\Wout\projects\test
184 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d
185 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea is being purged from base C:\Users\Wout\projects\test
186 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea
187 verbose tar unpack C:\Users\Wout\AppData\Roaming\npm-cache\bindings\1.2.1\package.tgz
188 verbose tar unpacking to C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a
189 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a is being purged
190 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a
191 verbose tar unpack C:\Users\Wout\AppData\Roaming\npm-cache\nan\2.2.0\package.tgz
192 verbose tar unpacking to C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d
193 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d is being purged
194 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d
195 verbose tar unpack C:\Users\Wout\AppData\Roaming\npm-cache\argon2\0.9.0\package.tgz
196 verbose tar unpacking to C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea
197 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea is being purged
198 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea
199 silly gunzTarPerm modes [ '777', '666' ]
200 silly gunzTarPerm modes [ '777', '666' ]
201 silly gunzTarPerm modes [ '777', '666' ]
202 silly gunzTarPerm extractEntry package.json
203 silly gunzTarPerm modified mode [ 'package.json', 420, 438 ]
204 silly gunzTarPerm extractEntry package.json
205 silly gunzTarPerm modified mode [ 'package.json', 436, 438 ]
206 silly gunzTarPerm extractEntry package.json
207 silly gunzTarPerm modified mode [ 'package.json', 420, 438 ]
208 silly gunzTarPerm extractEntry README.md
209 silly gunzTarPerm modified mode [ 'README.md', 420, 438 ]
210 silly gunzTarPerm extractEntry bindings.js
211 silly gunzTarPerm modified mode [ 'bindings.js', 420, 438 ]
212 silly gunzTarPerm extractEntry .npmignore
213 silly gunzTarPerm modified mode [ '.npmignore', 420, 438 ]
214 silly gunzTarPerm extractEntry README.md
215 silly gunzTarPerm modified mode [ 'README.md', 420, 438 ]
216 silly gunzTarPerm extractEntry README.md
217 silly gunzTarPerm modified mode [ 'README.md', 436, 438 ]
218 silly gunzTarPerm extractEntry include_dirs.js
219 silly gunzTarPerm modified mode [ 'include_dirs.js', 436, 438 ]
220 silly gunzTarPerm extractEntry index.js
221 silly gunzTarPerm modified mode [ 'index.js', 420, 438 ]
222 silly gunzTarPerm extractEntry test.spec.js
223 silly gunzTarPerm modified mode [ 'test.spec.js', 420, 438 ]
224 silly gunzTarPerm extractEntry nan_converters.h
225 silly gunzTarPerm modified mode [ 'nan_converters.h', 436, 438 ]
226 silly gunzTarPerm extractEntry LICENSE.md
227 silly gunzTarPerm modified mode [ 'LICENSE.md', 436, 438 ]
228 silly gunzTarPerm extractEntry .dntrc
229 silly gunzTarPerm modified mode [ '.dntrc', 436, 438 ]
230 silly gunzTarPerm extractEntry appveyor.yml
231 silly gunzTarPerm modified mode [ 'appveyor.yml', 436, 438 ]
232 silly gunzTarPerm extractEntry doc/new.md
233 silly gunzTarPerm modified mode [ 'doc/new.md', 436, 438 ]
234 silly gunzTarPerm extractEntry doc/.build.sh
235 silly gunzTarPerm modified mode [ 'doc/.build.sh', 509, 511 ]
236 silly gunzTarPerm extractEntry binding.gyp
237 silly gunzTarPerm modified mode [ 'binding.gyp', 420, 438 ]
238 silly gunzTarPerm extractEntry doc/buffers.md
239 silly gunzTarPerm modified mode [ 'doc/buffers.md', 436, 438 ]
240 silly gunzTarPerm extractEntry doc/callback.md
241 silly gunzTarPerm modified mode [ 'doc/callback.md', 436, 438 ]
242 silly gunzTarPerm extractEntry argon2/README.md
243 silly gunzTarPerm modified mode [ 'argon2/README.md', 420, 438 ]
244 silly gunzTarPerm extractEntry argon2/LICENSE
245 silly gunzTarPerm modified mode [ 'argon2/LICENSE', 420, 438 ]
246 silly gunzTarPerm extractEntry doc/converters.md
247 silly gunzTarPerm modified mode [ 'doc/converters.md', 436, 438 ]
248 silly gunzTarPerm extractEntry doc/errors.md
249 silly gunzTarPerm modified mode [ 'doc/errors.md', 436, 438 ]
250 silly gunzTarPerm extractEntry argon2/CHANGELOG.md
251 silly gunzTarPerm modified mode [ 'argon2/CHANGELOG.md', 420, 438 ]
252 silly gunzTarPerm extractEntry argon2/include/argon2.h
253 silly gunzTarPerm modified mode [ 'argon2/include/argon2.h', 420, 438 ]
254 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a\node_modules is being purged
255 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a\node_modules
256 silly gunzTarPerm extractEntry doc/maybe_types.md
257 silly gunzTarPerm modified mode [ 'doc/maybe_types.md', 436, 438 ]
258 silly gunzTarPerm extractEntry doc/methods.md
259 silly gunzTarPerm modified mode [ 'doc/methods.md', 436, 438 ]
260 silly gunzTarPerm extractEntry argon2/src/opt.c
261 silly gunzTarPerm modified mode [ 'argon2/src/opt.c', 420, 438 ]
262 silly gunzTarPerm extractEntry argon2/src/argon2.c
263 silly gunzTarPerm modified mode [ 'argon2/src/argon2.c', 420, 438 ]
264 silly gunzTarPerm extractEntry argon2/src/core.c
265 silly gunzTarPerm modified mode [ 'argon2/src/core.c', 420, 438 ]
266 silly gunzTarPerm extractEntry argon2/src/core.h
267 silly gunzTarPerm modified mode [ 'argon2/src/core.h', 420, 438 ]
268 silly gunzTarPerm extractEntry doc/asyncworker.md
269 silly gunzTarPerm modified mode [ 'doc/asyncworker.md', 436, 438 ]
270 silly gunzTarPerm extractEntry doc/node_misc.md
271 silly gunzTarPerm modified mode [ 'doc/node_misc.md', 436, 438 ]
272 silly gunzTarPerm extractEntry argon2/src/encoding.c
273 silly gunzTarPerm modified mode [ 'argon2/src/encoding.c', 420, 438 ]
274 silly gunzTarPerm extractEntry argon2/src/encoding.h
275 silly gunzTarPerm modified mode [ 'argon2/src/encoding.h', 420, 438 ]
276 silly gunzTarPerm extractEntry doc/object_wrappers.md
277 silly gunzTarPerm modified mode [ 'doc/object_wrappers.md', 436, 438 ]
278 silly gunzTarPerm extractEntry doc/persistent.md
279 silly gunzTarPerm modified mode [ 'doc/persistent.md', 436, 438 ]
280 silly gunzTarPerm extractEntry argon2/src/blake2/blake2-impl.h
281 silly gunzTarPerm modified mode [ 'argon2/src/blake2/blake2-impl.h', 420, 438 ]
282 silly gunzTarPerm extractEntry argon2/src/blake2/blake2.h
283 silly gunzTarPerm modified mode [ 'argon2/src/blake2/blake2.h', 420, 438 ]
284 silly gunzTarPerm extractEntry doc/scopes.md
285 silly gunzTarPerm modified mode [ 'doc/scopes.md', 436, 438 ]
286 silly gunzTarPerm extractEntry doc/script.md
287 silly gunzTarPerm modified mode [ 'doc/script.md', 436, 438 ]
288 silly gunzTarPerm extractEntry argon2/src/blake2/blake2b.c
289 silly gunzTarPerm modified mode [ 'argon2/src/blake2/blake2b.c', 420, 438 ]
290 silly gunzTarPerm extractEntry argon2/src/blake2/blamka-round-opt.h
291 silly gunzTarPerm modified mode [ 'argon2/src/blake2/blamka-round-opt.h', 420, 438 ]
292 silly gunzTarPerm extractEntry doc/string_bytes.md
293 silly gunzTarPerm modified mode [ 'doc/string_bytes.md', 436, 438 ]
294 silly gunzTarPerm extractEntry doc/v8_internals.md
295 silly gunzTarPerm modified mode [ 'doc/v8_internals.md', 436, 438 ]
296 silly gunzTarPerm extractEntry argon2/src/blake2/blamka-round-ref.h
297 silly gunzTarPerm modified mode [ 'argon2/src/blake2/blamka-round-ref.h', 420, 438 ]
298 silly gunzTarPerm extractEntry argon2/src/opt.h
299 silly gunzTarPerm modified mode [ 'argon2/src/opt.h', 420, 438 ]
300 silly gunzTarPerm extractEntry doc/v8_misc.md
301 silly gunzTarPerm modified mode [ 'doc/v8_misc.md', 436, 438 ]
302 silly gunzTarPerm extractEntry nan.h
303 silly gunzTarPerm modified mode [ 'nan.h', 436, 438 ]
304 silly gunzTarPerm extractEntry argon2/src/ref.c
305 silly gunzTarPerm modified mode [ 'argon2/src/ref.c', 420, 438 ]
306 silly gunzTarPerm extractEntry argon2/src/ref.h
307 silly gunzTarPerm modified mode [ 'argon2/src/ref.h', 420, 438 ]
308 silly gunzTarPerm extractEntry nan_callbacks.h
309 silly gunzTarPerm modified mode [ 'nan_callbacks.h', 436, 438 ]
310 silly gunzTarPerm extractEntry argon2/src/thread.c
311 silly gunzTarPerm modified mode [ 'argon2/src/thread.c', 420, 438 ]
312 silly gunzTarPerm extractEntry argon2/src/thread.h
313 silly gunzTarPerm modified mode [ 'argon2/src/thread.h', 420, 438 ]
314 silly gunzTarPerm extractEntry src/argon2_node.cpp
315 silly gunzTarPerm modified mode [ 'src/argon2_node.cpp', 420, 438 ]
316 silly gunzTarPerm extractEntry src/argon2_node.h
317 silly gunzTarPerm modified mode [ 'src/argon2_node.h', 420, 438 ]
318 silly gunzTarPerm extractEntry nan_callbacks_12_inl.h
319 silly gunzTarPerm modified mode [ 'nan_callbacks_12_inl.h', 436, 438 ]
320 silly gunzTarPerm extractEntry nan_callbacks_pre_12_inl.h
321 silly gunzTarPerm modified mode [ 'nan_callbacks_pre_12_inl.h', 436, 438 ]
322 silly gunzTarPerm extractEntry nan_converters_43_inl.h
323 silly gunzTarPerm modified mode [ 'nan_converters_43_inl.h', 436, 438 ]
324 silly gunzTarPerm extractEntry nan_converters_pre_43_inl.h
325 silly gunzTarPerm modified mode [ 'nan_converters_pre_43_inl.h', 436, 438 ]
326 silly gunzTarPerm extractEntry nan_implementation_12_inl.h
327 silly gunzTarPerm modified mode [ 'nan_implementation_12_inl.h', 436, 438 ]
328 silly gunzTarPerm extractEntry nan_implementation_pre_12_inl.h
329 silly gunzTarPerm modified mode [ 'nan_implementation_pre_12_inl.h', 436, 438 ]
330 silly gunzTarPerm extractEntry nan_maybe_43_inl.h
331 silly gunzTarPerm modified mode [ 'nan_maybe_43_inl.h', 436, 438 ]
332 silly gunzTarPerm extractEntry nan_maybe_pre_43_inl.h
333 silly gunzTarPerm modified mode [ 'nan_maybe_pre_43_inl.h', 436, 438 ]
334 silly gunzTarPerm extractEntry nan_new.h
335 silly gunzTarPerm modified mode [ 'nan_new.h', 436, 438 ]
336 silly gunzTarPerm extractEntry nan_object_wrap.h
337 silly gunzTarPerm modified mode [ 'nan_object_wrap.h', 436, 438 ]
338 silly gunzTarPerm extractEntry nan_persistent_12_inl.h
339 silly gunzTarPerm modified mode [ 'nan_persistent_12_inl.h', 436, 438 ]
340 silly gunzTarPerm extractEntry nan_persistent_pre_12_inl.h
341 silly gunzTarPerm modified mode [ 'nan_persistent_pre_12_inl.h', 436, 438 ]
342 silly gunzTarPerm extractEntry nan_string_bytes.h
343 silly gunzTarPerm modified mode [ 'nan_string_bytes.h', 436, 438 ]
344 silly gunzTarPerm extractEntry nan_typedarray_contents.h
345 silly gunzTarPerm modified mode [ 'nan_typedarray_contents.h', 436, 438 ]
346 silly gunzTarPerm extractEntry nan_weak.h
347 silly gunzTarPerm modified mode [ 'nan_weak.h', 436, 438 ]
348 silly gunzTarPerm extractEntry CHANGELOG.md
349 silly gunzTarPerm modified mode [ 'CHANGELOG.md', 436, 438 ]
350 silly gunzTarPerm extractEntry tools/package.json
351 silly gunzTarPerm modified mode [ 'tools/package.json', 436, 438 ]
352 silly gunzTarPerm extractEntry tools/README.md
353 silly gunzTarPerm modified mode [ 'tools/README.md', 436, 438 ]
354 silly gunzTarPerm extractEntry tools/1to2.js
355 silly gunzTarPerm modified mode [ 'tools/1to2.js', 509, 511 ]
356 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea\node_modules is being purged
357 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea\node_modules
358 silly gentlyRm C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d\node_modules is being purged
359 verbose gentlyRm don't care about contents; nuking C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d\node_modules
360 silly doParallel preinstall 3
361 silly preinstall [email protected] C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a
362 info lifecycle [email protected]~preinstall: [email protected]
363 silly preinstall [email protected] C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d
364 info lifecycle [email protected]~preinstall: [email protected]
365 silly preinstall [email protected] C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea
366 info lifecycle [email protected]~preinstall: [email protected]
367 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
368 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
369 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
370 silly doReverseSerial remove 0
371 silly doSerial move 0
372 silly doSerial finalize 3
373 silly finalize C:\Users\Wout\projects\test\node_modules\bindings
374 silly finalize C:\Users\Wout\projects\test\node_modules\nan
375 silly finalize C:\Users\Wout\projects\test\node_modules\argon2
376 silly doSerial build 3
377 silly build [email protected]
378 info linkStuff [email protected]
379 silly linkStuff [email protected] has C:\Users\Wout\projects\test\node_modules as its parent node_modules
380 verbose linkBins [email protected]
381 verbose linkMans [email protected]
382 silly build [email protected]
383 info linkStuff [email protected]
384 silly linkStuff [email protected] has C:\Users\Wout\projects\test\node_modules as its parent node_modules
385 verbose linkBins [email protected]
386 verbose linkMans [email protected]
387 silly build [email protected]
388 info linkStuff [email protected]
389 silly linkStuff [email protected] has C:\Users\Wout\projects\test\node_modules as its parent node_modules
390 verbose linkBins [email protected]
391 verbose linkMans [email protected]
392 silly doSerial global-link 0
393 silly doParallel update-linked 0
394 silly doSerial install 3
395 silly install [email protected] C:\Users\Wout\projects\test\node_modules\.staging\bindings-974f9c0a
396 info lifecycle [email protected]~install: [email protected]
397 silly lifecycle [email protected]~install: no script for install, continuing
398 silly install [email protected] C:\Users\Wout\projects\test\node_modules\.staging\nan-0bb46a6d
399 info lifecycle [email protected]~install: [email protected]
400 silly lifecycle [email protected]~install: no script for install, continuing
401 silly install [email protected] C:\Users\Wout\projects\test\node_modules\.staging\argon2-1ed338ea
402 info lifecycle [email protected]~install: [email protected]
403 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
404 verbose lifecycle [email protected]~install: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\Wout\projects\test\node_modules\argon2\node_modules\.bin;C:\Users\Wout\projects\test\node_modules\.bin;C:\Program Files (x86)\Intel\OpenCL SDK\bin\x64;C:\Program Files (x86)\Intel\OpenCL SDK\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\bin\Pin;C:\Program Files (x86)\Intel\OpenCL SDK\bin\GTPin;C:\Program Files\ImageMagick-6.9.2-Q16;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.8.0_60\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Gow\bin;C:\Program Files (x86)\NSIS\Unicode;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\GIMP 2\bin;C:\NVPACK\android-ndk-r10e;C:\Program Files (x86)\WinAnt\bin;C:\Users\Wout\AppData\Roaming\npm;C:\Program Files\Redis\;C:\Program Files (x86)\CMake\bin;C:\Anaconda2;C:\Anaconda2\Scripts;C:\Anaconda2\Library\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Nightly;C:\Users\Wout\usr\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Users\Wout\AppData\Roaming\npm
405 verbose lifecycle [email protected]~install: CWD: C:\Users\Wout\projects\test\node_modules\argon2
406 silly lifecycle [email protected]~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
407 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
408 info lifecycle [email protected]~install: Failed to exec install script
409 verbose unlock done using C:\Users\Wout\AppData\Roaming\npm-cache\_locks\staging-bc5831b1337acf3b.lock for C:\Users\Wout\projects\test\node_modules\.staging
410 silly rollbackFailedOptional Starting
411 silly rollbackFailedOptional Finishing
412 silly runTopLevelLifecycles Starting
413 silly runTopLevelLifecycles Finishing
414 silly install printInstalled
415 warn [email protected] No description
416 warn [email protected] No repository field.
417 verbose stack Error: [email protected] install: `node-gyp rebuild`
417 verbose stack Exit status 1
417 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:232:16)
417 verbose stack     at emitTwo (events.js:100:13)
417 verbose stack     at EventEmitter.emit (events.js:185:7)
417 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
417 verbose stack     at emitTwo (events.js:100:13)
417 verbose stack     at ChildProcess.emit (events.js:185:7)
417 verbose stack     at maybeClose (internal/child_process.js:827:16)
417 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
418 verbose pkgid [email protected]
419 verbose cwd C:\Users\Wout\projects\test
420 error Windows_NT 10.0.10586
421 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "argon2"
422 error node v5.7.0
423 error npm  v3.6.0
424 error code ELIFECYCLE
425 error [email protected] install: `node-gyp rebuild`
425 error Exit status 1
426 error Failed at the [email protected] install script 'node-gyp rebuild'.
426 error Make sure you have the latest version of node.js and npm installed.
426 error If you do, this is most likely a problem with the argon2 package,
426 error not with npm itself.
426 error Tell the author that this fails on your system:
426 error     node-gyp rebuild
426 error You can get information on how to open an issue for this project with:
426 error     npm bugs argon2
426 error Or if that isn't available, you can get their info via:
426 error     npm owner ls argon2
426 error There is likely additional logging output above.
427 verbose exit [ 1, true ]

The following stdout:

> [email protected] install C:\Users\Wout\projects\test\node_modules\argon2
> node-gyp rebuild


C:\Users\Wout\projects\test\node_modules\argon2>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  argon2.c
  core.c
..\argon2\src\argon2.c(300): warning C4267: 'initializing' : conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Users\Wout\projects\test\node_modules\argon2\build\libargon2.vcxproj]
  blake2b.c
  thread.c
  encoding.c
  opt.c
  win_delay_load_hook.c
  libargon2.vcxproj -> C:\Users\Wout\projects\test\node_modules\argon2\build\Release\\libargon2.lib
  argon2_node.cpp
..\src\argon2_node.cpp(15): error C2146: syntax error : missing ';' before identifier 'uint32_t' [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(20): error C2146: syntax error : missing ';' before identifier 'size_type' [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(20): error C2086: 'int NodeArgon2::constexpr' : redefinition [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
          ..\src\argon2_node.cpp(15) : see declaration of 'NodeArgon2::constexpr'
..\src\argon2_node.cpp(48): error C2797: 'NodeArgon2::HashAsyncWorker::plain': list initialization inside member initializer list or non-static data member initializer is not implemented [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(48): error C2797: 'NodeArgon2::HashAsyncWorker::salt': list initialization inside member initializer list or non-static data member initializer is not implemented [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(161): error C2797: 'NodeArgon2::VerifyAsyncWorker::hash': list initialization inside member initializer list or non-static data member initializer is not implemented [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]
..\src\argon2_node.cpp(161): error C2797: 'NodeArgon2::VerifyAsyncWorker::plain': list initialization inside member initializer list or non-static data member initializer is not implemented [C:\Users\Wout\projects\test\node_modules\argon2\build\argon2.vcxproj]

And the following stderr:

gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Wout\projects\test\node_modules\argon2
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "argon2" "--save"
npm ERR! node v5.7.0
npm ERR! npm  v3.6.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs argon2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Wout\projects\test\npm-debug.log

Environment

Operating system: Windows 10
Node version: v5.7.0
Compiler version: Visual Studio 2013

How to link the argon2 library statically?

Sorry for asking this question here in the issues but I hope it will be useful for other people, especially for "serverless"/FaaS apps.

I've tried modifying the cflags and ldflags in binding.gyp, but it won't compile argon2.node as a statically linked library including libstdc++ and everything.

Is there any way to achieve this?

Major problems in handling of salt

I've discovered what I believe to be a pair of serious errors in the handling of the salt.

There is, at present, a 1/256 chance that an empty string will be used as the salt when following the example code in the README. From testing, it appears that ~0.6% of all passwords will have a salt that is 1 character or fewer, ~1% of all passwords will have a salt that is 4 characters or fewer, and ~2% of passwords will have a salt that is 8 characters or fewer. This is due to the interpretation of the salt as a null-terminated string, rather than as a buffer of random bytes.

The second error is just as concerning. The salts are generated in a binary representation as a 16 byte buffer with an equal probability of each bit being a 1 or a 0. However, they are then converted to string, interpreting the random bytes as UTF-8. This is simply wrong, as a random byte sequence might not be a valid UTF-8 string. The bytes of this string are later interpreted as binary for the use as the salt.

The end result of this process is that the 16-byte random buffer is turned into string that's probably somewhere between 19 and 42 bytes long. This is bad because it has at most 16 bytes of entropy spread across that longer length. Then the string gets silently truncated to 16 bytes, losing a significant amount of entropy.

I believe this bug affects all hashes that were ever generated in node-argon2. I am not a security expert, nor an expert on the argon2 algorithm, so I don't know how bad this is, but I presume that at the very least, the 0.4% of passwords without any salt at all are extremely vulnerable to attacks using rainbow tables, and that the general reduction in salt entropy leaves many others vulnerable as well.

My expectation is that breaking changes will be required to fix this in node-argon2, and it may be necessary for all library users to rehash their passwords.

Grow beyond password hashing, Specifically: Raw Hash

I see there is a strong commitment to keep this plugin, the major and only node.js port only for password hashing, however Argon2 is bigger than that

My request is:

  1. Raw/String Hash Option
  2. Custom Salt Option

I'm personally switching to CLI usage, from syntax to functionality, this plugin disappointed me at every turn, I've lost a good 1.5 hours of my life :(

Can't Install Latest Version?

Steps to reproduce

  1. Install the latest version of node-gyp globally.
  2. Use Node 4.0.0+
  3. Attempt to install this module via npm: npm install argon2 --save in a project.

Expected behaviour

The module should be installed without issue.

Actual behaviour

The module fails to build with node-gyp:

npm install argon2 --save

> [email protected] install /Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2
> node-gyp rebuild

  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
In file included from ../src/argon2_node.cpp:8:
../src/argon2_node.h:28:10: error: no type named 'unique_ptr' in namespace 'std'
    std::unique_ptr<char[]> output;
    ~~~~~^
../src/argon2_node.h:28:20: error: expected member name or ';' after declaration specifiers
    std::unique_ptr<char[]> output;
    ~~~~~~~~~~~~~~~^
../src/argon2_node.cpp:22:16: error: no member named 'ceil' in namespace 'std'
    using std::ceil;
          ~~~~~^
../src/argon2_node.cpp:24:35: error: use of undeclared identifier 'ceil'
    return static_cast<size_type>(ceil(length / 3.0)) * 4;
                                  ^
../src/argon2_node.cpp:20:21: error: no return statement in constexpr function
constexpr size_type base64Length(size_type length)
                    ^
../src/argon2_node.cpp:30:16: error: no member named 'to_string' in namespace 'std'
    using std::to_string;
          ~~~~~^
../src/argon2_node.cpp:34:32: error: use of undeclared identifier 'to_string'
            memoryCostLength = to_string(log(ARGON2_MAX_MEMORY)).size(),
                               ^
../src/argon2_node.cpp:35:30: error: use of undeclared identifier 'to_string'
            timeCostLength = to_string(ARGON2_MAX_TIME).size(),
                             ^
../src/argon2_node.cpp:36:33: error: use of undeclared identifier 'to_string'
            parallelismLength = to_string(ARGON2_MAX_LANES).size();
                                ^
../src/argon2_node.cpp:47:69: error: member initializer 'output' does not name a non-static data member or base class
    memory_cost{memory_cost}, parallelism{parallelism}, type{type}, output{}
                                                                    ^~~~~~~~
../src/argon2_node.cpp:53:5: error: use of undeclared identifier 'output'
    output.reset(new char[ENCODED_LEN]);
    ^
../src/argon2_node.cpp:57:23: error: use of undeclared identifier 'output'
            HASH_LEN, output.get(), ENCODED_LEN, type);
                      ^
../src/argon2_node.cpp:74:34: error: use of undeclared identifier 'output'
    promise->Resolve(Nan::Encode(output.get(), strlen(output.get())));
                                 ^
../src/argon2_node.cpp:74:55: error: use of undeclared identifier 'output'
    promise->Resolve(Nan::Encode(output.get(), strlen(output.get())));
                                                      ^
../src/argon2_node.cpp:141:24: error: no member named 'unique_ptr' in namespace 'std'
    auto output = std::unique_ptr<char[]>{new char[ENCODED_LEN]};
                  ~~~~~^
../src/argon2_node.cpp:141:39: error: expected '(' for function-style cast or type construction
    auto output = std::unique_ptr<char[]>{new char[ENCODED_LEN]};
                                  ~~~~^
../src/argon2_node.cpp:251:34: warning: implicit conversion from 'unsigned long long' to 'uint32_t' (aka 'unsigned int') changes value from 4294967296 to 0 [-Wconstant-conversion]
            Nan::New<Number>(log(ARGON2_MAX_MEMORY)));
                             ~~~ ^~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:58:50: note: expanded from macro 'ARGON2_MAX_MEMORY'
    ARGON2_MIN(UINT32_C(0xFFFFFFFF), UINT64_C(1) << ARGON2_MAX_MEMORY_BITS)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:53:46: note: expanded from macro 'ARGON2_MIN'
#define ARGON2_MIN(a, b) ((a) < (b) ? (a) : (b))
                                             ^
1 warning and 16 errors generated.
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/rdegges/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/node" "/Users/rdegges/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN EPACKAGEJSON [email protected] No description
npm WARN EPACKAGEJSON [email protected] No repository field.
npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/node" "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/npm" "install" "argon2" "--save"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rdegges/Dropbox/Code/testing/argon/npm-debug.log

Environment

Operating system: OSX

Node version: 5.5.0

Compiler version:

while http server is running argon cannot perform verify and after the request timesout catch blog of promise says decoding failed

Welcome to the issues section if it's your first time!

Before creating an issue, please be sure to:

  • [ x] Checkout to the latest version, including submodules
  • Try to find an isolated way to reproduce the behavior
  • [x ] Fill in all the blanks in the most specific way you can

Steps to reproduce

1.create a http server
2.on data get the post value
3.on end connect to database(mongodb) and after results come back verify the password sent with http post against hash in db

Expected behaviour

should end the response with fail or success whether pass is right or wrong

Actual behaviour

then block or catch block never runs while http socket is opened and when user times out or cancels the request it gives the message "decoding failed"

Environment

Operating system:
ubuntu 15.10 kernel 4.3
Node version:
4x
Compiler version:
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)

Improve README/docs understanding

First of all, appreciate the library. I think it's a great start and recommend filling some gaps in the README to aid understanding. As a feature request I'm not providing environment/reproducibility, but let me know if you need it.

  • Include a minimum-viable reasonably-secure implementation. Because most people, myself included, are not in the security space. Below is my attempt using old-ES from what I understand of the README. Feel free to let me know if there's any security issues since I'll actually be using it.
var argon2 = require('argon2');

var getPasswordHash = function(password) {
  // Assumes that 16 bytes is good enough for now
  return argon2.generateSalt().then(function(salt) {
    // Assumes defaults don't change (specifically using Argon2i by default)
    return argon2.hash(password, salt);
  });
};

var verifyPassword = function(passwordHash, password) {
  return argon2.verify(passwordHash, password);
};
  • Improved options documentation. Many libraries will create a table with info like "option name", "option data type", "option default", and "option description". For example, from the README I can't tell what timeCost means. Is it number of seconds it will run before returning something, number of iterations (2^n)? If I need to read Argon2 papers to understand this, preferably link to the excerpt that describes it.

argon2.verify directly a hash byte Buffer instead of a MCF string hash

Hi. I really love Argon2, but I have an issue that I can't solve it. I started using Argon2 today, and I was able to return both types of hashes (Buffer bytes and String).

Buffer bytes hash

<Buffer e2 ab 80 d2 89 67 3e 66 82 00 06 74 cd 39 54 44 6e fa fd f3 5a 37 d3 5e d6 d4 ad 4d 33 5d f0 5c>
String hash

$argon2i$v=19$m=4096,t=3,p=1$qlRSRgw72QD+Cw54MA18fQ$NW+po4QNXi1msPTkiYtElpJoIX6PhQk5PsF6PY7B4Vg

I can see that the String hash contains more parameters used in the hashing algorithm, but I believe that all my nodes will use the same hashing options, so it is very pointless for me to send the entire string in the network and not just the Buffer bytes (which are more optimal). Moreover, I believe I don't need salt for Proof of Work blocks. Right?

When I call the function verify directly with the Buffer bytes, Argon2 returns me the regex error, because I can not provide the options directly to the verify function. Error: Invalid hash, must be in MCF, generated by Argon2."

How can I solve this problem by proving the options directly alongside with the Buffer to verify my Buffer byte hash, and not a string

feature request: expose "Secret value K" option

Page 5 of the Argon2 paper specifies a secondary input:

Secret value K (serves as key if necessary, but we do not assume any key use by default) may have any
length from 0 to 32 bytes.

I would like to use Argon2 to combine a user-supplied passphrase with a randomly-generated 32 byte key (not the salt). Please allow me to pass in a value for K.

Cant be installed on Azure

When referencing this library on azure the node_gyp rebuild fails.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  opt.c
  argon2.c
  core.c
..\argon2\src\core.c(28): fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory [D:\home\site\wwwroot\node_modules\argon2\build\libargon2.vcxproj]```

Destructuring assignment not compatible with node 4

First of all, sorry for ignoring your ISSUE_TEMPLATE, but this issue doesn't need it.

According to the es6 compat table, Node v4 does not support destructuring assignment.

However, it is used at line 20 of index.js and therefore I run into a syntax error (full error see below).

When we really want to use the latest stuff, maybe we can introduce a postinstall script where babel transpiles the code for Node 4 compatibility. However, if this is the only line, it might not be worth it.

Thanks for your effort. 🌷

Environment

Operating system: Linux

Node version: 4.5.0

Error stack trace:

const {max, min} = limits[key]

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

release new version with predefined salt by parameter

Hello,

We use your library node-argon2 and everything works excellent, but the problem is that we need to change every time we install the library on a different machine your npmjs package to accept predfined salts sent a parameter and not randomly generated salts like in your current npmjs package version. Please kindly, if it s possible to update your release

Install from within Vagrant VM fails when /vagrant is a subdirectory of git repo

This is similar to issue #4, but different enough that I'm guessing the fix will be different, so I'll open a different issue.

I am trying to install argon2 within a Vagrant Linux VM. The Vagrantfile is in a sub-directory of my git repo, so when I vagrant up, vagrant ssh, and cd /vagrant, I'm in a directory that is mirrored to a sub-directory of my git repo. I then execute npm install argon2 and I get this error:

> git submodule update --init

fatal: Not a git repository (or any parent up to mount point /vagrant)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Git complains because it's looking for the .git subdirectory, but it's not accessible from the Linux VM because /vagrant is mirrored to a sub-directory of my repo.

I tried to exporting that environment variable, set to 1, but then I just get this error:

> git submodule update --init

fatal: Not a git repository (or any of the parent directories): .git

Not surprising since the Linux VM can't get to the root of my git repository.

Do you really need to add a git sub-module to the current repo in order to install? The bcrypt module doesn't seem to require that, and it installs perfectly in this configuration.

Strange issue when using alongside with koa

Hi,

Sorry for linking but I really don't want to copy-paste it here too, so please follow my link to the koa issue I've just created koajs/koa#670 - koa works strange with node-argon2. I don't know why it happens but there is a strange timeout in the hash function if I use argon with koa. Examples in the linked issue. I've set up some easy examples to show the "bug".

Environment

Operating system: Mac OS X Yosemite 10.10.5

Node version: v5.2.0

Argon version: 0.9 (latest)

Cheers

New Year's update

Hey Ranieri!

First, Happy New Year to everyone!
@ranisalt Can you please do an npm version major and an npm publish please? :)

Thank you very much,
Mark

Use promises instead of callbacks

I'm thinking on changing the API to use Promises instead of callback arguments. Promises are now fully supported on Node and they are future-proof as in a future where ES6+ is ubiquitous, the following code will work:

let hash = await argon2.hash('password', salt);

And no more Sync functions need to exist. Also, people are very much used to Promises (or any thenables) nowadays, so there is no confusion.

Anyone using this package has an opinion on that? It is possible to implement Promises without breaking compatibility, and although I'm against maintaining the deprecated code, I am willing to maintain it at least until the next major release (1.x).

Error: Invalid hash, must be in MCF, generated by Argon2.

Welcome to the issues section if it's your first time!

Before creating an issue, please be sure to:

  • Checkout to the latest version, including submodules
  • Try to find an isolated way to reproduce the behavior
  • Fill in all the blanks in the most specific way you can

Steps to reproduce

Not reproducible yet

I'm using argon2 with type argon2id and sometimes it throws error - Error: Invalid hash, must be in MCF, generated by Argon2. and I'm not sure how to reproduce it. If I could get any pointers where to start looking for this problem, it would be very helpful.

Error: Invalid hash, must be in MCF, generated by Argon2.
    at Object.verify (/...node_modules/argon2/index.js:52:29)

Environment

Operating system: Linux

Node version:
v7.10.0
Compiler version:
gcc (GCC) 7.1.1 20170516

Change to gyp build process breaks install

I installed version 0.4.1 a little over a week ago, but unfortunately I cannot update or install 0.4.2 or later. I believe this is caused by changes to the gyp build instructions in 2ec40a1.

I noticed that you also switched from the reference implementation of argon2 to the optimized implementation in the process of changing the build. That's fine by me, and I can compile either version from P-H-C/phc-winner-argon2 without error when I do it myself. It's not entirely clear to me what gyp is doing differently.

In the future, please bump the minor version number when you make significant changes to the build system. IMO, patch releases should contain only extremely conservative changes. While I understand that you might look at it as a patch release because there are no API changes, as a library user what I really care about is that my code doesn't break in a patch update.

Here is the error I'm encountering:

vagrant@machine:~/ws/myapp$ npm update --save argon2
npm WARN install Couldn't install optional dependency: Unsupported

> [email protected] preinstall /home/vagrant/ws/myapp/node_modules/.staging/argon2-8e1864def6601eebe8a65bded53fa406
> git submodule update --init


> [email protected] postinstall /home/vagrant/ws/myapp/node_modules/argon2
> npm run build


> [email protected] build /home/vagrant/ws/myapp/node_modules/argon2
> node-gyp configure rebuild

make: Entering directory '/home/vagrant/ws/myapp/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
../argon2/src/core.c: In function ‘validate_inputs’:
../argon2/src/core.c:364:35: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if (ARGON2_MIN_PWD_LENGTH > context->pwdlen) {
                                   ^
../argon2/src/core.c:394:31: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if (ARGON2_MIN_SECRET > context->secretlen) {
                               ^
../argon2/src/core.c:409:34: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if (ARGON2_MIN_AD_LENGTH > context->adlen) {
                                  ^
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
In file included from ../argon2/src/opt.c:23:0:
../argon2/src/blake2/blamka-round-opt.h: In function ‘fBlaMka’:
../argon2/src/blake2/blamka-round-opt.h:40:1: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
 static BLAKE2_INLINE __m128i fBlaMka(__m128i x, __m128i y) {
 ^
In file included from ../argon2/src/opt.h:18:0,
                 from ../argon2/src/opt.c:20:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:1029:1: error: inlining failed in call to always_inline ‘_mm_add_epi64’: target specific option mismatch
 _mm_add_epi64 (__m128i __A, __m128i __B)
 ^
In file included from ../argon2/src/opt.c:23:0:
../argon2/src/blake2/blamka-round-opt.h:42:12: error: called from here
     return _mm_add_epi64(_mm_add_epi64(x, y), _mm_add_epi64(z, z));
            ^
In file included from ../argon2/src/opt.h:18:0,
                 from ../argon2/src/opt.c:20:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:1029:1: error: inlining failed in call to always_inline ‘_mm_add_epi64’: target specific option mismatch
 _mm_add_epi64 (__m128i __A, __m128i __B)
 ^
In file included from ../argon2/src/opt.c:23:0:
../argon2/src/blake2/blamka-round-opt.h:42:12: error: called from here
     return _mm_add_epi64(_mm_add_epi64(x, y), _mm_add_epi64(z, z));
            ^
In file included from ../argon2/src/opt.h:18:0,
                 from ../argon2/src/opt.c:20:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:1029:1: error: inlining failed in call to always_inline ‘_mm_add_epi64’: target specific option mismatch
 _mm_add_epi64 (__m128i __A, __m128i __B)
 ^
In file included from ../argon2/src/opt.c:23:0:
../argon2/src/blake2/blamka-round-opt.h:42:12: error: called from here
     return _mm_add_epi64(_mm_add_epi64(x, y), _mm_add_epi64(z, z));
            ^
In file included from ../argon2/src/opt.h:18:0,
                 from ../argon2/src/opt.c:20:
/usr/lib/gcc/i686-linux-gnu/5/include/emmintrin.h:1131:1: error: inlining failed in call to always_inline ‘_mm_mul_epu32’: target specific option mismatch
 _mm_mul_epu32 (__m128i __A, __m128i __B)
 ^
In file included from ../argon2/src/opt.c:23:0:
../argon2/src/blake2/blamka-round-opt.h:41:19: error: called from here
     const __m128i z = _mm_mul_epu32(x, y);
                   ^
libargon2.target.mk:89: recipe for target 'Release/obj.target/libargon2/argon2/src/opt.o' failed
make: *** [Release/obj.target/libargon2/argon2/src/opt.o] Error 1
make: Leaving directory '/home/vagrant/ws/myapp/node_modules/argon2/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.2.0-16-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "rebuild"
gyp ERR! cwd /home/vagrant/ws/myapp/node_modules/argon2
gyp ERR! node -v v5.4.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `node-gyp configure rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script 'node-gyp configure rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/ws/myapp/node_modules/argon2/npm-debug.log
npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "update" "--save" "argon2"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the argon2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build
npm ERR! You can get their info via:
npm ERR!     npm owner ls argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/ws/myapp/npm-debug.log

My system: Ubuntu 15.10, 32-bit

C++11 issues with clang at install time

Steps to reproduce

  1. Followed the basic instructions for node-argon2 v0.12.0 and tried to install with: CXX=clang++ npm install argon2 --save

Expected behaviour

The module should install without error.

Actual behaviour

The module failed to install with the following error:

../src/argon2_node.cpp:6:10: fatal error: 'tuple' file not found
#include <tuple>
         ^

This led me to believe the C++11 stdlib wasn't being loaded.

I confirmed by adding the following to the installation command line:

CXX='clang++ -std=c++11 -stdlib=libc++' npm install argon2 --save

This workaround was successful. But, it seems there is an issue with the targets in the gyp configuration. I found an interesting SO on how to setup the targets in the gyp config. http://stackoverflow.com/questions/25645057/node-gyp-cannot-compile-a-nodejs-extension-fatal-error-thread-file-not-found

Environment

OSX 10.11.5

Node version:
6.3.0

Compiler version:
node-gyp=3.4.0
clang++=Apple LLVM version 7.3.0 (clang-703.0.31)

Enhancement: Promises

I was just wondering if it would be a possibility to add an option for using Bluebird promises? Currently, the native promises are causing me headaches when in combination with Bluebird's filtered catches.

I tried to fork the library, and simply make my own changes, but I could not for the life of me get it to compile. It just kept giving me node-gyp errors.

Npm uses older version of argon2_node.cpp, where enum OBJECTS contains THIS instead of THIS_OBJ causing clash with #define THIS void in combaseapi.h (windows default header)

Welcome to the issues section if it's your first time!

Operating system: Windows 8.1

Node version: 6.2.1

Compiler version: 3.10.8

using npm install argon2 , I get an msbuild error 'unexpected 'void' ' at line 23 in argon2_node.cpp, which is where OBJECTS::THIS is declared.

I cleaned the npm cache and tried reinstallin argon2, then went into the npm-cache folder, extracted the argon2 tarball and looked through the source - indeed it was THIS. The version in package.js was also 0.13.0, which matches the latest release here on github.

THIS is defined in combaseapi.h, which is (apparently?) included by default when building and is defined as void, which is the culprit for the error. Interestingly enough, the latest version of argon2_node.cpp here on github seems fixed, because it's "THIS_OBJ" instead of "THIS".

So in other words, this issue is practically already fixed, but not yet published.

Documentation: npm readme out of date

It looks like the docs on npm aren't synced with the readme in master. Specifically, the verify method's match parameter explanation (which could lead to some serious security holes if followed as per the docs on npm). This seems to have been fixed in master around the same time as the last NPM release, so maybe something went wrong while pushing to npm?

macOS installation problem

I am receiving the following error message upon trying to install the library:

rockchalkwushock in argon2-test $ CXX=g++-6 npm install --save argon2

> [email protected] install /Users/rockchalkwushock/Desktop/argon2-test/node_modules/argon2
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
make: g++-6: No such file or directory
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/rockchalkwushock/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/Users/rockchalkwushock/.nvm/versions/node/v8.2.1/bin/node" "/Users/rockchalkwushock/.nvm/versions/node/v8.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rockchalkwushock/Desktop/argon2-test/node_modules/argon2
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/rockchalkwushock/.npm/_logs/2017-08-26T13_57_35_993Z-debug.log

I followed the instructions in the README & went and checked on the node-gyp installation as well. I'm seeing three things that don't add up, but am unsure how to handle them:

  1. xcodebuild:
which xcodebuild # /usr/bin/xcodebuild

2.'/Library/Developer/CommandLineTools' doesn't exist in file structure

  1. gcc:

I don't believe the brew install gcc is taking precedence over the native gcc on the Mac. I say this because anything installed with brew should be located at /usr/local/bin/<formula> and I receive back /usr/bin/gcc which holds all the native binaries the Mac comes with.

rockchalkwushock in argon2-test $ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Environment

Tech Version
macOS 10.12.6
node 8.2.1
yarn 0.27.5
npm 5.3.0
node-gyp 3.6.2.
python 2.7.10
xcode-select 2347

Any chance for custom salt to re-appear?

Greetings,

These nodejs bindings are really easy to use, however, recently a very crucial functionality was removed and that custom salt. In our project, we would like to hash and salt IDs but also be able to check whether the ID matches the one in the DB. That would require us to have the same salt so we can actually check the final product. With the current random salt generated on each run, it is impossible to (or at least I don't see any way of doing it).

Any chance to re-instantiate custom salt?

documentation on ES7 Verify example is wrong/misleading

the documentation on ES7 verify function states that promise is rejected if passwords do not match. but instead the catch block is only called if an error occurs during the verify call itself, e.g. wrong parameters:

async function verify () {
  try {
    await argon2.verify('<big long hash>', 'password');
    // password match
    return true // should only be called if passwords match
  } catch (err) {
    // password did not match
    return false // should be returned for password mismatch or error during verify call
  }
}

Instead with above setup 'true' is always returned, regardless if password match or not. The correct way would be to return the result of argon2.verify().

Environment

Operating system:
OS X 10.11.4
Node version:
5.10.1
Compiler version:
g++5

raw: true isn't working

I'm using it like this:
const options = { raw: true, timeCost: 2, memoryCost: 16, parallelism: 1, hashLength: 32 };
const uidBuffer = new Buffer(uid);
return argon2.hash(password, uidBuffer, options);
but it produces the encoded hash.. any way to get the raw hash as a buffer?

[feature request] Return unencoded hash

It would be great to allow grabbing the hash as a raw buffer instead of the crypt-encoded string. Right now I'm using a regex to parse the crypt format and then decode the base64 key, but it would be better (and faster) if node-argon2 just had argon2 generate the raw key instead of the encoded one.

const cryptRegex = /\$([^$]+)$/;
argon2.hash(password, salt)
  .then(encodedKey => {
    const key = Buffer.from(cryptRegex.exec(encodedKey)[1], 'base64');
})

verify sometimes fails

argon2 = require('argon2');
argon2.hash("password")
    .then(hash => argon2.verify(hash, "password"))
    .then(console.log);

Running this in a loop I see false ~7% of the time.

Environment

Operating system:
Tested on FreeBSD 11.1 and macOS 10.13.2

Node version:
v9.3.0 and v9.4.0

Compiler version:
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Apple LLVM version 9.0.0 (clang-900.0.39.2)

'make' fails during 'npm install' in project

Hey, I would like to contribute to your project.
Unfortunately, I get an error when executing npm install within the node-argon2 repository.

Being curious, I tried to install your argon2 package into some other project (npm install argon2) and that works fine.
It seems that some target in the Makefile can't be resolved correctly (see log beneath).
Do you have any idea to fix this?

Thanks for your effort. 🌹

Some specs about my system:

Here is the output produced by npm install:
[email protected] install /home/jan/Github/node-argon2

node-gyp rebuild

make: Entering directory »/home/jan/Github/node-argon2/build«
make: *** No rule to make target »Release/obj.target/libargon2/argon2/src/argon2.o«,
needed by »Release/obj.target/argon2.a«. End.
make: Leaving directory »/home/jan/Github/node-argon2/build«
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/jan/npm-global/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.13.0-77-generic
gyp ERR! command "/usr/bin/nodejs" "/home/jan/npm-global/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jan/Github/node-argon2
gyp ERR! node -v v4.3.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

npm ERR! Linux 3.13.0-77-generic
npm ERR! argv "/usr/bin/nodejs" "/home/jan/npm-global/bin/npm" "install"
npm ERR! node v4.3.0
npm ERR! npm v2.14.18
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1

Cannot Use argon2.defaults When Using .hash()

The following code errors out, when it should be working according to the docs:

'use strict';

var argon = require('argon2');

var password = 'xxx!';

argon.generateSalt((err, salt) => {
  if (err) {
    throw err;
  }

  // the argon.defaults param is what breaks the code
  argon.hash(password, salt, argon.defaults, (err, hash) => {
    if (err) {
      throw err;
    }

    console.log('Successfully created Argon2 hash:', hash);
  });
});

It errors with:

  Object.assign(options, Object.assign({}, defaults, options));
         ^

TypeError: Cannot assign to read only property 'timeCost' of #<Object>
    at Function.assign (native)
    at validate (/Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2/index.js:29:10)
    at Object.exports.hash (/Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2/index.js:64:7)
    at /Users/rdegges/Dropbox/Code/testing/argon/test.js:12:9
    at InternalFieldObject.ondone (/Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2/index.js:85:5)

It works if I remove the argon.defaults call, but I'm assuming that should work =)

Why Use Buffer?

What would be some use cases for outputting as a buffer using option {raw:true} instead of just a string?

Failed to install [windows 10]

At first npm installing just hanged on. I restarted it again and then it just failed with the error below.

Before creating an issue, please be sure to:

  • Checkout to the latest version, including submodules
  • Try to find an isolated way to reproduce the behavior (installed for the first time)
  • Fill in all the blanks in the most specific way you can

Steps to reproduce

  1. run npm i -S argon2
  2. .... if hangs on => kill the process, run second command again
  3. get the error

Expected behaviour

It is expected to install properly.

Actual behaviour

Throwing error:

error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Long:

Project "E:\pr\realty\node_modules\argon2\build\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
Project "E:\pr\realty\node_modules\argon2\build\binding.sln" (1) is building "E:\pr\realty\node_modules\argon2\build\argon2.vcxproj.metap roj" (2) on node 1 (default targets).
Project "E:\pr\realty\node_modules\argon2\build\argon2.vcxproj.metaproj" (2) is building "E:\pr\realty\node_modules\argon2\build\libargon 2.vcxproj" (3) on node 1 (default targets).
E:\pr\realty\node_modules\argon2\build\libargon2.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the  declaration is correct, and that the file exists on disk.
Done Building Project "E:\pr\realty\node_modules\argon2\build\libargon2.vcxproj" (default targets) -- FAILED.

Done Building Project "E:\pr\realty\node_modules\argon2\build\argon2.vcxproj.metaproj" (default targets) -- FAILED.

Done Building Project "E:\pr\realty\node_modules\argon2\build\binding.sln" (default targets) -- FAILED.

Build FAILED.

"E:\pr\realty\node_modules\argon2\build\binding.sln" (default target) (1) ->
"E:\pr\realty\node_modules\argon2\build\argon2.vcxproj.metaproj" (default target) (2) ->
"E:\pr\realty\node_modules\argon2\build\libargon2.vcxproj" (default target) (3) ->
E:\pr\realty\node_modules\argon2\build\libargon2.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" wa s not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.92

Environment

Operating system: Windows 10 Pro
Node version: v9.4.0
Compiler version: Microsoft (R) Build Engine version 14.0.23107.0

Error when installing on remote servers

Hi, by any chance do you know how to solve this:
I can't seem to get it to work

remote:        npm ERR! [email protected] preinstall: `git submodule update --init`
remote:        npm ERR! Exit status 128
remote:        npm ERR!
remote:        npm ERR! Failed at the [email protected] preinstall script 'git submodule update --init'.
remote:        npm ERR! Make sure you have the latest version of node.js and npm installed.
remote:        npm ERR! If you do, this is most likely a problem with the argon2 package,
remote:        npm ERR! not with npm itself.
remote:        npm ERR! Tell the author that this fails on your system:
remote:        npm ERR!     git submodule update --init
remote:        npm ERR! You can get their info via:
remote:        npm ERR!     npm owner ls argon2
remote:        npm ERR! There is likely additional logging output above.
remote:        

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.