{"id":18002151,"url":"https://github.com/tarzan/leaked_passwords","last_synced_at":"2025-07-24T21:35:54.175Z","repository":{"id":30743060,"uuid":"125869926","full_name":"tarzan/leaked_passwords","owner":"tarzan","description":"Checking for leaked passwords through haveibeenpwned v2 API using the hash-range checker","archived":false,"fork":false,"pushed_at":"2024-02-07T13:32:41.000Z","size":55,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-14T11:06:21.477Z","etag":null,"topics":["elixir","haveibeenpwned","leaks","password","security"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/tarzan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-03-19T14:22:29.000Z","updated_at":"2024-05-23T02:03:55.000Z","dependencies_parsed_at":"2024-02-07T14:40:43.502Z","dependency_job_id":"628b33ef-6444-4a76-8bc9-dbb970fd7f18","html_url":"https://github.com/tarzan/leaked_passwords","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.18181818181818177","last_synced_commit":"42dbebcaa830e437429fa6abd11dace67711de15"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tarzan/leaked_passwords","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarzan%2Fleaked_passwords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarzan%2Fleaked_passwords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarzan%2Fleaked_passwords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarzan%2Fleaked_passwords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarzan","download_url":"https://codeload.github.com/tarzan/leaked_passwords/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarzan%2Fleaked_passwords/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266905623,"owners_count":24004149,"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-07-24T02:00:09.469Z","response_time":99,"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":["elixir","haveibeenpwned","leaks","password","security"],"created_at":"2024-10-29T23:20:11.705Z","updated_at":"2025-07-24T21:35:54.151Z","avatar_url":"https://github.com/tarzan.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeakedPasswords\n\n[![Module Version](https://img.shields.io/hexpm/v/leaked_passwords.svg)](https://hex.pm/packages/leaked_passwords)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/leaked_passwords/)\n[![Total Download](https://img.shields.io/hexpm/dt/leaked_passwords.svg)](https://hex.pm/packages/leaked_passwords)\n[![License](https://img.shields.io/hexpm/l/leaked_passwords.svg)](https://github.com/tarzan/leaked_passwords/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/tarzan/leaked_passwords.svg)](https://github.com/tarzan/leaked_passwords/commits/master)\n\nA wrapper around [Have I Been Pwned?](https://haveibeenpwned.com/) API endpoints for checking through its datasets whether a given password has been leaked. This wrapper uses the 'safe' endpoints by first calculating the SHA1 and then only POSTing the first 5 characters to the API endpoints.\n\n---\n\n## Usage\n\n```elixir\niex\u003e LeakedPasswords.leaked?(\"my_password\")\n896\n\niex\u003e LeakedPasswords.leaked?(\"my_super_safe_unknown_password\")\nfalse\n```\n\n_Within Changesets_\n\n```elixir\n  defp check_for_leaked_password(%Changeset{changes: %{set_password: password}} = changeset) do\n    password\n    |\u003e LeakedPasswords.leaked?()\n    |\u003e process_leaked_check(changeset)\n  end\n\n  defp check_for_leaked_password(changeset), do: changeset\n\n  defp process_leaked_check(false, changeset), do: changeset\n\n  defp process_leaked_check(_, changeset),\n    do:\n      add_error(\n        changeset,\n        :set_password, #virtual password field\n        dgettext(\n          \"errors\",\n          \"The chosen password must not match %{link_start}this list of common passwords%{link_end}.\",\n          link_start:\n            \"\u003ca href=\\\"https://haveibeenpwned.com/passwords\\\" target=\\\"_blank\\\" rel=\\\"noopener noreferrer\\\"\u003e\",\n          link_end: \"\u003c/a\u003e\"\n        ),\n        error_type: :leaked_password\n      )\n```\n\n## Installation\n\nThe package can be installed by adding `:leaked_passwords` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:leaked_passwords, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Copyright and License\n\nCopyright (c) 2018 Maarten Jacobs\n\nThis work is free. You can redistribute it and/or modify it under the\nterms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarzan%2Fleaked_passwords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarzan%2Fleaked_passwords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarzan%2Fleaked_passwords/lists"}