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
install
To install npm install kruptein
methods
get
Create ciphertext from plaintextset
Create plaintext from ciphertext
options
secret
(Required) Ciphertext passphrasealgorithm
(Optional) Cipher algorithm fromcrypto.getCiphers()
. Default:aes-256-gcm
.hashing
(Optional) Hash algorithm fromcrypto.getHashes()
. Default:sha512
.encodeas
(Optional) Output encoding. Currently only supportsbinary
.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 toccm
,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.