Skip to content

In-browser key management with IndexedDB and the Web Crypto API

License

Notifications You must be signed in to change notification settings

banyancomputer/banyan-keystore-js

 
 

Repository files navigation

Banyan KeyStore Js

props to Fission for the original implementation

What

In-browser key management with IndexedDB and the Web Crypto API.

Securely store and use keys for encryption, decryption, and signatures. IndexedDB and Web Crypto keep keys safe from malicious javascript.

Supports only Elliptic Curves (P-384) for Asymmetric for Encryption and Decryption, Signing and Verification.

Implements escrowing Assymetric keys with passphrases.

Symmetric Encryption and Decryption is supported with AES-GCM.

Symmetric Key Wrapping is supported with AES-KW.

Install

Currently published under banyan-webcrypto-experiment@1.0.2

Example Usage

import * as Keystore from 'banyan-keystore-js/keystore/index'

async function run() {
  const ks = await Keystore.init()

  const msg = "Incididunt id ullamco et do."

  // TODO

  await Keystore.clear()
}

run()

Development

# install dependencies
yarn

# run development server
yarn start

# build
yarn build

# test
# Note: use nodeV16 when running tests
# Note: unit tests are non-deterministic for some reason (prolly why it was all mocks to begin with)
yarn test

# test w/ reloading
yarn test:watch

About

In-browser key management with IndexedDB and the Web Crypto API

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.9%
  • JavaScript 3.1%