JSPM

  • Created
  • Published
  • Downloads 186771
  • Score
    100M100P100Q201025F
  • License MIT

crypto; from kruptein to hide or conceal

Package Exports

  • kruptein

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 (kruptein) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

kruptein

crypto; from kruptein to hide or conceal

npm Downloads Dependencies Known Vulnerabilities Build Status codecov

install

To install npm install kruptein

methods

  • get Create ciphertext from plaintext
  • set Create plaintext from ciphertext

options

  • secret (Required) Ciphertext passphrase
  • algorithm (Optional) Cipher algorithm from crypto.getCiphers(). Default: aes-256-gcm.
  • hashing (Optional) Hash algorithm from crypto.getHashes(). Default: sha512.
  • encodeas (Optional) Output encoding. Currently only supports binary.
  • key_size (Optional) Key size bytes (should match block size of algorithm). Default: 32
  • iv_size (Optional) IV size bytes. Default: 16.
  • at_size (Optional) Authentication tag size. Applicable to ccm, gcm & ocb cipher modes. Default: 128.

tests

To test npm test

usage

See below for usage.

set

To create new ciphertext; .set(plaintext, [additional authentication data]

const kruptein = require('kruptein');

const options = {
  secret: 'squirrel'
}

let ciphertext = kruptein.set('Operation mincemeat was an example of deception');

get

To retrieve plaintext; .get(ciphertext, [{at: authentication tag, aad: additional authentication data}]

const kruptein = require('kruptein');

const options = {
  secret: 'squirrel'
}

let plaintext = kruptein.get(ciphertext);

contributing

Contributions are welcome & appreciated!

Refer to the contributing document to help facilitate pull requests.

license

This software is licensed under the MIT License.

Copyright Jason Gerfen, 2019.