{"id":13643676,"url":"https://github.com/skeeto/pwcheck","last_synced_at":"2026-03-27T02:28:16.225Z","repository":{"id":66813695,"uuid":"137594148","full_name":"skeeto/pwcheck","owner":"skeeto","description":"Database lookup for \"Have I Been Pwned\"","archived":false,"fork":false,"pushed_at":"2018-06-16T17:46:27.000Z","size":15,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T17:51:33.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skeeto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-06-16T16:21:57.000Z","updated_at":"2022-03-26T07:27:36.000Z","dependencies_parsed_at":"2023-02-25T22:00:32.499Z","dependency_job_id":null,"html_url":"https://github.com/skeeto/pwcheck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skeeto/pwcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skeeto%2Fpwcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skeeto%2Fpwcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skeeto%2Fpwcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skeeto%2Fpwcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skeeto","download_url":"https://codeload.github.com/skeeto/pwcheck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skeeto%2Fpwcheck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271083830,"owners_count":24696378,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"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":[],"created_at":"2024-08-02T01:01:51.176Z","updated_at":"2026-03-27T02:28:11.161Z","avatar_url":"https://github.com/skeeto.png","language":"C","readme":"# Database Lookup for \"Have I Been Pwned\"\n\nThis is a little C99 library for efficiently checking passwords against\nthe [Have I Been Pwned][pwn] dataset. The database is the sorted list of\nhashes converted to binary, truncated, and concatenated. Look-ups are a\nbinary search on this memory-mapped file.\n\nOnce warmed up, this library can test around 250,000 passwords per\nsecond.\n\nOnly POSIX systems are currently supported.\n\n## Compilation\n\nTo build, run `make`. It produces:\n\n* `compact`: A command line program for constructing databases.\n\n* `pwcheck`: A simple command line password checking utility.\n\n* `libpwcheck.so`: For use by other programs, particularly those written\n  in languages with a foreign function interface (FFI).\n\n## Database generation\n\nTo build a database from the \"ordered by hash\" dataset, pipe it through\nthe `compact` command:\n\n    $ ./compact \u003cpwned-passwords-ordered-2.0.txt \u003epwned.db\n\nHash truncation is controlled at *compile time* in `config.h`. With the\ndefault configuration, the 2.0 dataset (501m passwords) becomes a 3.8GB\ndatabase. Since the database is memory mapped, it is not essential to\nhave that much physical memory, but it *is* essential for maintaining\nhigh throughput.\n\nThe `pwcheck` convenient utility queries a database without involving\nthe library. It reads passwords, one per line, on standard input:\n\n    $ echo correcthorsebatterystaple | ./pwcheck pwned.db\n    correcthorsebatterystaple: found\n\n    $ echo LyX | ./pwcheck pwned.db\n    LyX: not found\n\n## Shared library API\n\nThe API for `libpwcheck.so` is very FFI-friendly:\n\n```c\n/**\n * Open a database by its filename and return a handle.\n * Returns NULL if the file could not be opened.\n */\nstruct pwcheck *pwcheck_open(const char *);\n\n/**\n * Close a database and free its resources.\n */\nvoid pwcheck_close(struct pwcheck *);\n\n/**\n * Return 0 if the null-terminated password is not in the database.\n */\nint pwcheck_password(const struct pwcheck *, const char *);\n\n/**\n * Return 0 if the given SHA-1 hash is not in the database.\n */\nint pwcheck_hash(const struct pwcheck *, const void *);\n```\n\n[pwn]: https://haveibeenpwned.com/Passwords\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskeeto%2Fpwcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskeeto%2Fpwcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskeeto%2Fpwcheck/lists"}