Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adorsys/encrypt-down

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adorsys/encrypt-down

Encryption layer for level-db

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66
decreased by-47.62%
Maintainers
1
Weekly downloads
 
Created
Source

:closed_lock_with_key: encrypt-down :closed_lock_with_key:

leveldb Travis Coveralls npm npm Conventional Commits JavaScript Style Guide styled with prettier NpmLicense

encrypt-down is an encryption layer for LevelDB.

For LevelDB exist several persistence bindings. Amongst others bindings for IndexedDB.

So lots (several MB) of sensitive user data can be stored securely (encrypted) in the browser across user sessions.

Installation

npm install @adorsys/encrypt-down

Usage

We need a JSON Web Key (JWK) or JSON Web Key Set (JWKS) as specified by RFC 7517.

const memdown = require('memdown')
const encryptdown = require('./src')
const levelup = require('levelup')
const jwk = {
  kty: 'oct',
  alg: 'A256GCM',
  use: 'enc',
  k: '123456789abcdefghijklmnopqrstuvwxyz12345678'
}
const memdb = memdown()
const db = levelup(encryptdown(memdb, { jwk }))

db.put('key', { awesome: true }, function (err) {
  memdb._get('key', { asBuffer: false }, function (err, value) {
        value
        console.log(value)
        // eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIiwia2lkIjoialpESEVqN0ZhR3N5OHNUSUZLRWlnejB4TjFEVWlBZWp0S1ZNcEl2Z3dqOCJ9..LLeRPtRCpn-Zie6-.zZc0LQ_vvHCppRAaC5fxw4yJ0041l6mGOSgLDVnaPagSv_3Khp8a8lyAo9utHQKpVX6RNVaVPBQQxJpkw_Zyljeg7L-O_Nc3N2Hi_904qE6_zwORqQRc.R0JhfgTHIcD_93kXzZ8BrA
  })
  db.get('key', { asBuffer: false }, function (err, value) {
    console.log(value) 
    // { awesome: true }
  })
})

API

const db = require('@adorsys/encrypt-down')(db[, options])

  • db must be an abstract-leveldown compliant store
  • options:
    • jwk: a JSON Web Key (JWK) or JSON Web Key Set (JWKS) as specified by RFC 7517

Credits

Made with :heart: by radzom and all these wonderful contributors (emoji key):


Vincent Weevers
:speech_balloon:

Francis Pouatcha
🤔

This project follows the all-contributors specification. Contributions of any kind are welcome!

Keywords

FAQs

Package last updated on 19 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