This package is being tested against the following NodeJS versions;
All functions return promises to make it easy to automatically use webworkers or WebCrypto API in browsers that support it!
// iterations is optional and defaults to 35k iterationsjustencryptKeyDerivation;
The result of
encrypt is encoded as
iter || saltLen8 || salt || iv || tag || ct,
when this is fed into
decrypt it will be able decode the salt and iterations used.
// iterations is optional and defaults to 35k iterationsjustencryptEncryption;justencryptEncryption;
To make the result of
encrypt human readable (so it is easier to write down) it's possible to encode it as an mnemonic.
justencrypt-mnemonic package for this!
The default iterations is
justencrypt.KeyDerivation.defaultIterations and is set to 35000,
this is a number that should remain secure enough for a while when using a password.
If you don't pass in the
iterations argument it will default to this.
If you're encrypting with a random byte string used as password then you can use the same code,
except in that case setting the iterations to 1 is secure as there's no need to stretch the password.
You can use
justencrypt.KeyDerivation.subkeyIterations in that case to make it clear what your intentions are.
You should have
grunt-cli installed globally, if not run
npm install -g mocha instanbul grunt-cli.
Also recommended to have
phantomjs >= 1.9.8 on
$PATH to speed up the
asmcrypto.js build; https//github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Unit Tests are created with Mocha and can be ran with
npm test (or
We also run jshint and jscs, these are automatically ran by travis-ci for every commit and pull request.
jshint main.js lib/ test/ && jscs main.js lib/ test/
npm run-script lint
['Buffer', 'sha512_asm', 'asm']
JustEncrypt is released under the terms of the MIT license. See LICENCE.md for more information or see http://opensource.org/licenses/MIT.