encrypted
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

MIT license

Encrypted, just some client side encryption helpers

npm install encrypted --save
import { encrypted, decrypted } from "encrypted";

const encryptedObject = encrypted({my: ['secret', 'object']}, {'password': 'my pass'});
console.log(encryptedObject); // store this in some database
//{
//    encryption: {
//      type: 'secretbox',
//      salt: '1Ng96y/+JIHW+PiDM+sxk9bnyBWt0aoV',
//      nonce: 'cwudxtH26BhEhGlvT2lcUGz74uBBeVzY',
//      scrypt: { N: 16384, r: 8, p: 1, dkLen: 32, interruptStep: 0 }
//    },
//    data: 'cwudxtH26BhEhGlvT2lcUGz74uBBeVzYUylw9jxZUZSuvksfeGvp1rHCJetE4UxA/X/Y0rhSlg=='
//}
const decryptedObject = decrypted(encryptedObject, {'password': 'my pass'});
console.log(decryptedObject);
// {my: ['secret', 'object']}

A convenience wrapper around:

Inspired by:

Readme

Keywords

Package Sidebar

Install

npm i encrypted

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

31 kB

Total Files

7

Last publish

Collaborators

  • michi88