A small, simple library for checking a password against the HaveIBeenPwned password checker API.
Passwords appearing in the search results of the API have appeared in breached databases, and thus any accounts using such a password are at greater risk of being breahced.
- PHP 7.1 or above
- Curl
composer require griffolion/pwned
use Pwned\Range;
...
$pwnedCount = (new Range())->check("password");
if ($pwnedCount > 0) {
echo "Your password is at risk!";
}