keybase / triplesec

Triple Security for the browser and Node.js

Home Page:https://keybase.io/triplesec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scrypt results are not deterministic across different installation methods

wrboyce opened this issue · comments

I switched from including this repo as a submodule and including browser/triplesec.js to using browserify in my project and things stopped working.

Upon further investigation it seems the output of to_utf8 differs across both installations, despite both claiming to be v3.0.15

> var git, npm;
> triplesec.scrypt({
            key: triplesec.WordArray.from_utf8('password'),
            salt: triplesec.WordArray.from_utf8('salt'),
            dkLen: 1024}, (k) => git=k);
> triplesec_npm.scrypt({
            key: triplesec_npm.WordArray.from_utf8('password'),
            salt: triplesec_npm.WordArray.from_utf8('salt'),
            dkLen: 1024}, (k) => npm=k);
> git.to_hex() == npm.to_hex()
true
> git.to_utf8() == npm.to_utf8()
false