{"id":15798416,"url":"https://github.com/chanced/p4ssw0rd","last_synced_at":"2026-07-03T14:33:13.001Z","repository":{"id":57571043,"uuid":"347175275","full_name":"chanced/p4ssw0rd","owner":"chanced","description":"Go password strength validation utilizing the haveibeenpwned API","archived":false,"fork":false,"pushed_at":"2021-05-27T17:54:26.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-30T17:06:16.443Z","etag":null,"topics":["go","golang","password","pwned-passwords","validation"],"latest_commit_sha":null,"homepage":"","language":"Go","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/chanced.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":"2021-03-12T19:24:48.000Z","updated_at":"2022-12-21T15:52:14.000Z","dependencies_parsed_at":"2022-09-17T15:42:53.523Z","dependency_job_id":null,"html_url":"https://github.com/chanced/p4ssw0rd","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/chanced/p4ssw0rd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fp4ssw0rd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fp4ssw0rd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fp4ssw0rd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fp4ssw0rd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chanced","download_url":"https://codeload.github.com/chanced/p4ssw0rd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanced%2Fp4ssw0rd/sbom","scorecard":{"id":273409,"data":{"date":"2025-08-11","repo":{"name":"github.com/chanced/p4ssw0rd","commit":"8abaf95a224ed7de7a85061c253a13e3d9ce1316"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T13:54:54.470Z","repository_id":57571043,"created_at":"2025-08-17T13:54:54.470Z","updated_at":"2025-08-17T13:54:54.470Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35090435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","password","pwned-passwords","validation"],"created_at":"2024-10-05T00:41:24.889Z","updated_at":"2026-07-03T14:33:12.970Z","avatar_url":"https://github.com/chanced.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p4ssw0rd\n\nGo password strength validation utilizing the [have i been pwned?](https://haveibeenpwned.com/API/v3#SearchingPwnedPasswordsByRange) API. Make sure you read and abide by their [license](https://haveibeenpwned.com/API/v3#License)\n\n## Usage\n\n```bash\ngo get github.com/chanced/p4ssw0rd\n```\n\n```go\npackage main\n\nimport(\n    \"context\"\n    \"errors\"\n\n    \"github.com/chanced/p4ssw0rd\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    pw, err := p4ssw0rd.New(p4ssw0rd.Config{\n        UserAgent:               \"your site\", // required\n        MinPasswordLength:       6,           // default: 6\n        BreachLimit:             10,          // default: 10\n        MaxPwnedRequestAttempts: 3,           // default: 3\n        AddPadding:              false,       // default: false\n    })\n    if err != nil {\n        // The only reason this would happen is if you didn't provide a user agent.\n        // see https://haveibeenpwned.com/API/v3#UserAgent\n        panic(err)\n    }\n\n    eval, err := pw.Evaluate(ctx, \"password\")\n    if err != nil {\n        // this shouldn't error unless something goes wrong with connecting to haveibeenpwned because\n        // \"password\" satisfies the min length requirement\n        panic(err)\n    }\n    _ = eval.Allowed // false because the count of breaches this value has been involved in exceeds BreachLimit\n    _ = eval.BreachCount // 3861493 as of running this\n    _ = eval.Notes // \"\"; it will remain blank for now. Add your own notes in your handler\n\n    eval, err = pw.Evaluate(ctx, \"pass\")\n    if err != nil {\n        // err is a p4ssw0rd.MinLengthError because len(\"pass\") \u003c pw.MinPasswordLength\n        var mlerr *p4ssw0rd.MinLengthError\n        if errors.As(err, \u0026mlerr) {\n            _ = err.MinRequired // 6, as set by pw.MinPasswordLength\n            _ = err.Length // 4\n        } else {\n            //connection issues with haveibeenpwned\n            panic(err)\n        }\n    }\n    err = pw.Validate(ctx, \"password\")\n    if err != nil {\n        var blerr *p4ssw0rd.BreachLimitError\n        if errors.As(err, \u0026blerr) {\n            _ = blerr.BreachCount\n        }\n    }\n}\n```\n\n## Explanation\n\nThe way the package works is the password is hashed (SHA1) then the first 5 characters of that are used to query the API. The result set contains the remainder of the hash, if the password is present, and the count of breaches it has been discovered in. The results from have i been pwned look like this:\n\n```\n1E2AAA439972480CEC7F16C795BBB429372:1\n1E3687A61BFCE35F69B7408158101C8E414:1\n1E4C9B93F3F0682250B6CF8331B7EE68FD8:3861493\n00306FB8A6E528F9B377D068C625E2D5B55:2\n00415E48D704BA89B118934A33E202E41F9:1\n00DFA98B45FE3EE9D2F7BF6872E37672D03:2\n012562CD2D1BECE861B1566A974B52ACBF9:1\n012BE47C832BEE70CAA8E89364FF59B09EA:1\n0134585DCB1B38E99BD0CDA7E56D42A0C16:1\n01D41F17FC9C9CF616DE7A6BA237929AC91:1\n01ED16B974AE0010799BF0AE6F77E8F6CC5:10\n01FFD148305A472EBCED1BF4E70089A0532:1\n```\n\nIf you're still concerned about a man in the middle snooping responses, you can turn on padding which ensures that there are consistently 800 - 1,000 results. See https://haveibeenpwned.com/API/v3#PwnedPasswordsPadding\n\n## Documentation\n\nhttps://pkg.go.dev/github.com/chanced/p4ssw0rd\n\n## License\n\np4ssw0rd is licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/chanced/p4ssw0rd/blob/main/LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanced%2Fp4ssw0rd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanced%2Fp4ssw0rd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanced%2Fp4ssw0rd/lists"}