JSPM

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

Encrypting and decrypting your data in chains made easy!

Package Exports

  • cipher-chain

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

Readme

cipher-chain

HitCount Package quality Build Status Coverage Status Licensing Repo size Downloads per week Node version Help us and star this project

Encrypting and decrypting your data in chains made easy!
cipher-chain use nodejs her own crypto library to ensure security and stability across the board

Installation

npm install cipher-chain --save

Usage

const Cipher = require('cipher-chain')

// First create the object with a chosen secret
const cipherChain = new Cipher('uber secret')
// Or
const cipherChain = new cipherChain({
  secret: 'uber secret',
  kdf: 'pbkdf2', // or argon2 (but not supported yet!)
  options: { // options for the kdf function
    rounds: 40000, // Default 20000
    hash: 'sha512'
  }

// You can choose to encrypt and decrypt with just one cipher
let encrypted = await ciphering.encrypt('secret data', 'aes-256-gcm')
let decrypted = await ciphering.decrypt(encrypted) // returns: secret data

// You can also encrypt objects/arrays instead of strings
let encrypted = await ciphering.encrypt({ secretdata: true }, 'aes-256-gcm')
let decrypted = await ciphering.decrypt(encrypted) // returns: { secretdata: true }

// Or chain encrypt/decrypt, here doing a three-pass encryption starting from aes-256-gcm to aes-128-ctr and lastly to bf-cbc
let encrypted = await ciphering.encrypt('secret data', ['aes-256-gcm', 'aes-128-ctr', 'bf-cbc'])
let decrypted = await ciphering.decrypt(encrypted) // returns: secret data

Ciphers

To get a list of available ciphers use:

const Cipher = require('cipher-chain')

// First create the object with a chosen secret
const cipherChain = new Cipher('uber secret')

console.log(cipherChain.ciphers)

License

Copyright (c) 2019 by GiveMeAllYourCats. Some rights reserved.
cipher-chain is licensed under the MIT License as stated in the LICENSE file.