Socket
Socket
Sign inDemoInstall

@iteam/encrypt

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iteam/encrypt

Some (hopefully) sensible defaults for encrypting in node


Version published
Weekly downloads
1
Maintainers
5
Weekly downloads
 
Created
Source

encrypt

Some (hopefully) sensible defaults for encrypting in node

The data is serialized using msgpack5. This allows for any valid js structure to be encrypted/decrypted

Install

npm install --save @iteam/encrypt

Use

Super simple

const {encrypt, decrypt} = require('@iteam/encrypt').init('my super secret password')

const encrypted = encrypt('some text')  // returns a Buffer
const decrypted = decrypt(encrypted)    // returns 'some text'

With options

const {encrypt, decrypt} = require('@iteam/encrypt')
  .init({
    algorithm: 'aes-256-gcm',   // Default is 'aes-256-cbc',
    authTag: true,              // Only works with gcm
    encoding: 'base64',         // Default is null - ie Buffer
    iv: Buffer.alloc(16),       // Not recommended. Sets iv to zeros only. Other, not recommended value is false which removes iv all together
    password: 'some password'
  })

const encrypted = encrypt('some text')  // returns a base64 encoded string
const decrypted = decrypt(encrypted)    // returns 'some text'

FAQs

Package last updated on 09 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc