Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

i-encrypt

skpapam3MIT1.0.1

Encryption / Decryption made simple

encrypt, decrypt, security, crypto, hmac

readme

i-encrypt

Encryption / Decryption made simple

Installation

    npm install i-encrypt -save

API

Require

    var ie = require('i-encrypt')(options);

Options can be

    {
        //The encryption key by default is set to a random generated key
        key:"A secure secret string", 

        //Debug mode switcher by default is false
        debug:true
    }
  • ie.encrypt(data) Will encrypt the given data. The data bust be any object or string or number. Will return the encrypted text or null on fail.

  • ie.decrypt(text) Will decrypt the given text. Will return an object, a string, a number or null on fail.

  • ie.sign(data, format) Will generate an hmac signature for the given data. The data must be any object or string or number. The format is the format of the generated signature by default is 'base64'. Will return the signature or null on fail.

  • ie.validate(data, signature, format) Validate data's signature. Will return boolean.

LICENSE

MIT

Copyright (c) 2016 Skevos Papamichail <contact@skevosp.me> (www.skevosp.me)