{"id":16330442,"url":"https://github.com/robertoachar/node-password-storage","last_synced_at":"2026-04-25T23:32:18.449Z","repository":{"id":110400144,"uuid":"91125968","full_name":"robertoachar/node-password-storage","owner":"robertoachar","description":":lock: The best way to protect passwords is to employ salted password hashing.","archived":false,"fork":false,"pushed_at":"2018-01-15T00:29:52.000Z","size":63,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T10:21:46.074Z","etag":null,"topics":["hash","node","password","salt"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-password-storage","language":"JavaScript","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/robertoachar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-05-12T20:06:51.000Z","updated_at":"2022-02-10T20:42:55.000Z","dependencies_parsed_at":"2023-05-22T19:30:20.348Z","dependency_job_id":null,"html_url":"https://github.com/robertoachar/node-password-storage","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"be1e9f364cc97c9d97156bf5abe4777c4e471b6d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-password-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-password-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-password-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-password-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertoachar","download_url":"https://codeload.github.com/robertoachar/node-password-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254314477,"owners_count":22050246,"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":["hash","node","password","salt"],"created_at":"2024-10-10T23:19:14.842Z","updated_at":"2026-04-25T23:32:18.424Z","avatar_url":"https://github.com/robertoachar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Password Storage\n\nGenerated by [OSS Project Generator](http://bit.ly/generator-oss-project).\n\n[![Travis Status][travis-badge]][travis-url]\n[![AppVeyor Status][appveyor-badge]][appveyor-url]\n[![CircleCI Status][circleci-badge]][circleci-url]\n[![Coveralls Status][coveralls-badge]][coveralls-url]\n[![NPM Version][npm-badge]][npm-url]\n[![License][license-badge]][license-url]\n\n\u003e The best way to protect passwords is to employ salted password hashing.\n\n# Installation\n\n## Prerequsites\n\n* Install [Node.js](https://nodejs.org)\n* Install [npm](https://www.npmjs.com/)\n\nInstall package:\n\n```bash\n$ npm install --save node-password-storage\n```\n\n# Usage\n\n* Generate a salt\n\n```javascript\nconst lib = require('node-password-storage');\n\nconst salt_size = 32;\n\nlib.generateSalt(salt_size, (err, salt) =\u003e {\n  if (err) return console.error(err);\n\n  console.log(`SALT: ${salt.toString('hex')}\\n`);\n});\n```\n\n* Generate a hash\n\n```javascript\nconst lib = require('node-password-storage');\n\nconst password = 'password';\nconst salt = 'salt';\n\nlib.generateHash(password, salt, (err, hash) =\u003e {\n  if (err) return console.error(err);\n\n  console.log(`HASH: ${hash.toString('hex')}\\n`);\n});\n```\n\n* To generate and compare a storage\n\n```javascript\nconst lib = require('node-password-storage');\n\nconst password = 'password';\n\nlib.generateStorage(password, (err, storage) =\u003e {\n  if (err) return console.error(err.message);\n\n  const params = storage.split(':');\n  console.log(`SALT =\u003e ${params[0]}`);\n  console.log(`HASH =\u003e ${params[1]}`);\n\n  lib.verifyStorage(password, storage, (err, success) =\u003e {\n    if (err) return console.error(err);\n\n    console.log(`MATCH: ${success}`);\n  });\n});\n```\n\n# Development\n\n* Clone the repo\n\n```bash\n$ git clone https://github.com/robertoachar/node-password-storage.git\n```\n\n* Install dependencies\n\n```bash\n$ npm install\n```\n\n| Action                                   | Usage               |\n| ---------------------------------------- | ------------------- |\n| Starting development mode                | `npm start`         |\n| Linting code                             | `npm run lint`      |\n| Running unit tests                       | `npm run jest`      |\n| Running code coverage                    | `npm run coverage`  |\n| Running lint + tests                     | `npm test`          |\n| Sending coverage results to Coveralls.io | `npm run coveralls` |\n\n# Author\n\n[Roberto Achar](https://twitter.com/RobertoAchar)\n\n# License\n\n[MIT](https://github.com/robertoachar/node-password-storage/blob/master/LICENSE)\n\n[travis-badge]: https://travis-ci.org/robertoachar/node-password-storage.svg?branch=master\n[travis-url]: https://travis-ci.org/robertoachar/node-password-storage\n[appveyor-badge]: https://ci.appveyor.com/api/projects/status/github/robertoachar/node-password-storage?branch=master\u0026svg=true\n[appveyor-url]: https://ci.appveyor.com/project/robertoachar/node-password-storage\n[circleci-badge]: https://circleci.com/gh/robertoachar/node-password-storage/tree/master.svg?style=shield\n[circleci-url]: https://circleci.com/gh/robertoachar/node-password-storage\n[coveralls-badge]: https://coveralls.io/repos/github/robertoachar/node-password-storage/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/robertoachar/node-password-storage?branch=master\n[npm-badge]: https://img.shields.io/npm/v/node-password-storage.svg\n[npm-url]: https://www.npmjs.com/package/node-password-storage\n[license-badge]: https://img.shields.io/github/license/robertoachar/node-password-storage.svg\n[license-url]: https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertoachar%2Fnode-password-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertoachar%2Fnode-password-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertoachar%2Fnode-password-storage/lists"}