{"id":23364484,"url":"https://github.com/fission-codes/keystore-idb","last_synced_at":"2025-07-03T18:08:56.359Z","repository":{"id":42630276,"uuid":"241537205","full_name":"fission-codes/keystore-idb","owner":"fission-codes","description":"In-browser key management with IndexedDB and the Web Crypto API","archived":false,"fork":false,"pushed_at":"2023-07-14T17:28:53.000Z","size":1078,"stargazers_count":60,"open_issues_count":14,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-09T06:50:25.440Z","etag":null,"topics":["crypto","cryptography","ecc","elliptic-curves","indexeddb","keys-in-browser","rsa"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fission-codes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-19T05:03:30.000Z","updated_at":"2025-05-03T10:39:44.000Z","dependencies_parsed_at":"2024-03-08T04:46:39.332Z","dependency_job_id":null,"html_url":"https://github.com/fission-codes/keystore-idb","commit_stats":null,"previous_names":["fission-suite/keystore-idb"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fission-codes/keystore-idb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fkeystore-idb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fkeystore-idb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fkeystore-idb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fkeystore-idb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fission-codes","download_url":"https://codeload.github.com/fission-codes/keystore-idb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fission-codes%2Fkeystore-idb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259925015,"owners_count":22932835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","ecc","elliptic-curves","indexeddb","keys-in-browser","rsa"],"created_at":"2024-12-21T13:16:28.046Z","updated_at":"2025-07-03T18:08:56.318Z","avatar_url":"https://github.com/fission-codes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IndexedDB KeyStore\n\n[![NPM](https://img.shields.io/npm/v/keystore-idb)](https://www.npmjs.com/package/keystore-idb)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/fission-suite/blob/master/LICENSE)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b0fabd7e80c6bd2c0c7b/maintainability)](https://codeclimate.com/github/fission-suite/keystore-idb/maintainability)\n[![Built by FISSION](https://img.shields.io/badge/⌘-Built_by_FISSION-purple.svg)](https://fission.codes)\n[![Discord](https://img.shields.io/discord/478735028319158273.svg)](https://discord.gg/zAQBDEq)\n[![Discourse](https://img.shields.io/discourse/https/talk.fission.codes/topics)](https://talk.fission.codes)\n\nIn-browser key management with IndexedDB and the Web Crypto API.\n\nSecurely store and use keys for encryption, decryption, and signatures. IndexedDB and Web Crypto keep keys safe from malicious javascript.\n\nSupports both RSA (RSASSA-PKCS1-v1_5 \u0026 RSA-OAEP) and Elliptic Curves (P-256, P-381 \u0026 P-521).\n\nECC (Elliptic Curve Cryptography) is only available on Chrome. Firefox and Safari do not support ECC and must use RSA.\n_Specifically, this is an issue with storing ECC keys in IndexedDB_\n\n\n\n## Config\n\nBelow is the default config and all possible values\n_Note: these are given as primitives, but in Typescript you can use the included enums_\n\n```typescript\nconst defaultConfig = {\n  type: 'ecc', // 'ecc' | 'rsa'\n  curve: 'P-256', // 'P-256' | 'P-384' | 'P-521'\n  rsaSize: 2048, // 1024 | 2048 | 4096\n  symmAlg: 'AES-CTR', // 'AES-CTR' | 'AES-GCM' | 'AES-CBC'\n  symmLen: 128, // 128 | 192 | 256\n  hashAlg: 'SHA-256', // 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512'\n  charSize: 16, // 8 | 16\n  storeName: 'keystore', // any string\n  exchangeKeyName: 'exchange-key', // any string\n  writeKeyName: 'write-key', // any string\n}\n```\n_Note: if you don't include a crypto \"type\" (`'ecc' | 'rsa'`), the library will check if your browser supports ECC. If so (Chrome), it will use ECC, if not (Firefox, Safari) it will fall back to RSA._\n\n\n\n## Example Usage\n\n```typescript\nimport keystore from 'keystore-idb'\n\nasync function run() {\n  await keystore.clear()\n\n  const ks1 = await keystore.init({ storeName: 'keystore' })\n  const ks2 = await keystore.init({ storeName: 'keystore2' })\n\n  const msg = \"Incididunt id ullamco et do.\"\n\n  // exchange keys and write keys are separate because of the Web Crypto API\n  const exchangeKey1 = await ks1.publicExchangeKey()\n  const writeKey1 = await ks1.publicWriteKey()\n  const exchangeKey2 = await ks2.publicExchangeKey()\n\n  // these keys get exported as strings\n  console.log('exchangeKey1: ', exchangeKey1)\n  console.log('writeKey1: ', writeKey1)\n  console.log('exchangeKey2: ', exchangeKey2)\n\n  const sig = await ks1.sign(msg)\n  const valid = await ks2.verify(msg, sig, writeKey1)\n  console.log('sig: ', sig)\n  console.log('valid: ', valid)\n\n  const cipher = await ks1.encrypt(msg, exchangeKey2)\n  const decipher = await ks2.decrypt(cipher, exchangeKey1)\n  console.log('cipher: ', cipher)\n  console.log('decipher: ', decipher)\n}\n\nrun()\n```\n\n\n\n## Development\n\n```shell\n# install dependencies\nyarn\n\n# run development server\nyarn start\n\n# build\nyarn build\n\n# test\nyarn test\n\n# test w/ reloading\nyarn test:watch\n\n# publish (run this script instead of npm publish!)\n./publish.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffission-codes%2Fkeystore-idb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffission-codes%2Fkeystore-idb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffission-codes%2Fkeystore-idb/lists"}