{"id":15365921,"url":"https://github.com/andywer/key-store","last_synced_at":"2025-07-05T18:35:27.355Z","repository":{"id":37706368,"uuid":"108539355","full_name":"andywer/key-store","owner":"andywer","description":"🔐 Isomorphic encrypted key store written in TypeScript.","archived":false,"fork":false,"pushed_at":"2023-02-11T17:17:29.000Z","size":228,"stargazers_count":19,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T11:14:08.014Z","etag":null,"topics":["aes-256","key","nodejs","password","store","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andywer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-27T11:44:49.000Z","updated_at":"2024-06-15T16:36:44.000Z","dependencies_parsed_at":"2023-02-19T00:15:45.152Z","dependency_job_id":null,"html_url":"https://github.com/andywer/key-store","commit_stats":{"total_commits":59,"total_committers":8,"mean_commits":7.375,"dds":0.6610169491525424,"last_synced_commit":"db76fa3e8233ac3f3fd4b4bd6cdb60894b568e4e"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/andywer/key-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkey-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkey-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkey-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkey-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andywer","download_url":"https://codeload.github.com/andywer/key-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywer%2Fkey-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261279911,"owners_count":23134895,"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":["aes-256","key","nodejs","password","store","typescript"],"created_at":"2024-10-01T13:16:42.379Z","updated_at":"2025-07-05T18:35:27.315Z","avatar_url":"https://github.com/andywer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# key-store\n\n[![Build Status](https://travis-ci.org/andywer/key-store.svg?branch=master)](https://travis-ci.org/andywer/key-store)\n[![NPM Version](https://img.shields.io/npm/v/key-store.svg)](https://www.npmjs.com/package/key-store)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nIsomorphic encrypted key store. Works in node and in the browser.\n\n#### Features\n\n🔒 Strong encryption to securily store sensible data\u003cbr /\u003e\n🔑 Supports distinct passwords for each key\u003cbr /\u003e\n🔍 Can store unencrypted data alongside each key\n\n**Attention: The data is stored in a truly secure way. If you lose your password you will not be able to recover the wallet data! So please make sure to store a backup of the private data in a safe place.**\n\n\n## Installation\n\n```sh\n$ npm install --save key-store\n```\n\nUsing yarn:\n\n```sh\n$ yarn add key-store\n```\n\n\n## Example\n\n```js\nimport { createStore } from 'key-store'\n\nconst store = createStore(saveFile, initialData)\n\nawait store.saveKey('test-key', 'arbitrary password', { privateKey: 'super secret private key' })\n\nconst { privateKey } = store.getPrivateKeyData('test-key', 'arbitrary password')\n\nconsole.log(`Stored private key: ${privateKey}`)\nconsole.log(`All stored keys' IDs: ${store.getKeyIDs().join(', ')}`)\n```\n\nWriting and reading keys to a file in node is easy:\n\n```js\nimport * as fs from 'fs'\nimport * as util from 'util'\nimport { createStore } from 'key-store'\n\nconst readFile = util.promisify(fs.readFile)\nconst writeFile = util.promisify(fs.writeFile)\n\nasync function createFileStore (filePath) {\n  const saveKeys = data =\u003e writeFile(filePath, JSON.stringify(data), 'utf8')\n  const readKeys = async () =\u003e JSON.parse(await readFile(filePath, 'utf8'))\n\n  return createStore(saveKeys, await readKeys())\n}\n```\n\n\n## Encryption details\n\nAll data private data is encrypted using tweetnacl's `xsalsa20-poly1305` implementation. The encryption key is derived from the password using PBKDF2/SHA256. The iteration count for the PBKDF2 invocation is configurable and defaults to 10,000 rounds.\n\n\n## API\n\nCheck out the [declaration file](./lib/index.d.ts).\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fkey-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandywer%2Fkey-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywer%2Fkey-store/lists"}