davidpaulhunt / siphr

Quickly encrypt values or object keys and values with AES256.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

siphr

Simple interface to encrypt/decrypt a single value or the keys and values of a plain object.

Siphr uses the secret you provide to encrypt (AES256) values as base64 strings.

Possible use cases:

  • passwords
  • web tokens
  • application level encryption before persisting to database
Add-ons

You can use jstrong to send complete json objects with both its keys and values encrypted.

Installation

Using npm:

$ npm install --save siphr

Usage

const siphr = require('siphr')(MY_SECRET_KEY);

const str = siphr.mask('some private information'); // => sFHg6oX9AMI7ejBsw==

const cleanStr = siphr.unmask(str); // => 'some private information'

Tests

$ npm test

About

Quickly encrypt values or object keys and values with AES256.


Languages

Language:JavaScript 100.0%