JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 776
  • Score
    100M100P100Q101540F
  • License MIT

Textual encryption library

Package Exports

  • iocane

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iocane) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

iocane

NodeJS textual encryption library

Buttercup Build Status

About

Encrypting things is difficult, but it doesn't have to be. iocane encrypts text (not binary data) and outputs packed, encrypted text which can be decrypted by iocane. iocane uses strong, current-day encryption techniques to encrypt text, and doesn't reinvent anything. iocane uses PBKDF2 for key derivation, HMAC (SHA-256) for authentication and AES-256-CBC for encryption.

iocane was extracted from Buttercup's encryption process, and retains ties to the archiving process. Changes to iocane are subject to compatibility restraints with regards to the Buttercup suite of applications. This includes performance aspects of the browser-based versions.

Features

  • AES 256 bit CBC encryption
  • SHA-256 HMAC
  • 6-8k PBKDF2 round derived keys (SHA-256)

Node compatibility

iocane makes use of ES6 features available in NodeJS 4.2 and onwards.

Usage

Encrypting text is simple:

var crypto = require("iocane").crypto;

var encryptedText = crypto.encryptWithPassword("some random text", "passw0rd");

Encrypted content can then be easily decrypted later:

var crypto = require("iocane").crypto;

var decryptedText = crypto.decryptWithPassword(encryptedText, "passw0rd");

There are a variety of other useful methods, like key derivation etc., available on the iocane base object.

Overriding the built-in PBKDF2 function

You can override the built in key derivation method like so:

var iocane = require("iocane");
iocane.components.setPBKDF2(function(password, salt, rounds, bits, algorithm) {
    // do something
    // return Promise.<Buffer>
})

This is useful when using iocane in other environments, like the browser.