Calls HIBP API to check whether password was listed in a breach
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec
src
.editorconfig
.gitignore
.guardian.yml
.travis.yml
CHANGELOG.md
LICENSE
README.md
shard.yml

README.md

pwned_password - Calls HIBP API to check whether password was listed in a breach

Version Build Status License

Implements API v2 of Troy Hunt's HIBP to check whether a given password has been exposed in a breach.

https://haveibeenpwned.com/API/v2#PwnedPasswords

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  pwned_password:
    github: anamba/pwned_password.cr
  1. Run shards install

Usage

require "pwned_password_check"

PwnedPassword.search("correct horse battery staple") # -> 2 (found in 2 breaches)
PwnedPassword.search("f7Yr,f9dffF?eKeDpjepGwcc")     # -> nil (not found)

Contributing

  1. Fork it (https://github.com/anamba/pwned_password/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors