{"id":15361540,"url":"https://github.com/jonathanong/passwords","last_synced_at":"2025-04-15T08:41:14.951Z","repository":{"id":38308778,"uuid":"256695272","full_name":"jonathanong/passwords","owner":"jonathanong","description":"Password creation and management with native scrypt and haveibeenpwned","archived":false,"fork":false,"pushed_at":"2023-01-24T13:02:32.000Z","size":616,"stargazers_count":4,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T18:11:54.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jonathanong.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}},"created_at":"2020-04-18T07:33:37.000Z","updated_at":"2023-06-05T03:54:41.000Z","dependencies_parsed_at":"2023-02-13T21:31:26.740Z","dependency_job_id":null,"html_url":"https://github.com/jonathanong/passwords","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fpasswords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fpasswords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fpasswords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fpasswords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanong","download_url":"https://codeload.github.com/jonathanong/passwords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249038887,"owners_count":21202803,"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":[],"created_at":"2024-10-01T12:55:33.818Z","updated_at":"2025-04-15T08:41:14.933Z","avatar_url":"https://github.com/jonathanong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Passwords\n\n[![Node.js CI](https://github.com/jonathanong/passwords/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/jonathanong/passwords/actions?query=workflow%3A%22Node.js+CI%22+branch%3Amaster)\n[![codecov](https://codecov.io/gh/jonathanong/passwords/branch/master/graph/badge.svg?token=4me2xcwg7f)](https://codecov.io/gh/jonathanong/passwords)\n\nPersonal library for managing passwords.\n\nFeatures:\n\n- Hash and verify passwords with node.js-native scrypt\n- Checks passwords against the [haveibeenpwned](https://haveibeenpwned.com/API/v3#PwnedPasswords) database and disallow pwned passwords\n  - Provides a configurable timeout for hitting HIBP\n  - Does not handle HIBP retries. Because its APIs are served by CloudFlare, retries are probably unnecessary.\n- Configurable minimum password length with a default of 8 characters\n- HTTP client-friendly errors with [http-errors](https://www.npmjs.com/package/http-errors)\n\n## API\n\n```js\nconst Passwords = require('@jongleberry/passwords')\n\nconst passwords = new Passwords({\n  // options\n})\n\nconst [key, salt] = await passwords.createPassword('some password')\n\nconst isValidPassword = await passwords.comparePassword('some password', key, salt)\n```\n\n### Options\n\n- `hibpTimeout = 1000` - timeout to [hibp](https://haveibeenpwned.com/API/v3#PwnedPasswords) in milliseconds. If for some reason hibp takes longer than this timeout, the password will be assumed to be valid.\n- `minimumPasswordLength = 8` - minimum password character length\n- `saltLength = 16` - salt length in bytes\n- `keyLength = 64` - derived key length in bytes\n- `scryptOptions = {}` - options passed directly to [scrypt](https://nodejs.org/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback)\n\nNOTE: changing `scryptOptions` will change the derived key, so keep it consistent in your app or store it along with your password.\n\n### [key, salt, scryptOptions] = await createPassword(password)\n\nCreate a derived key and salt from a password.\n\n### isValidPassword = await comparePassword(password, key, salt [, scryptOptions])\n\nValidate the password with the derived key and salt. `scryptOptions` is only necessary if it's different than the currently set options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fpasswords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanong%2Fpasswords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fpasswords/lists"}