anamba / pwned_password.cr

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:MIT License


Languages

Language:Crystal 100.0%