griffolion/pwned

A small library for checking the status of a password against the HaveIBeenPwned database.

v1.2.1 2022-10-10 22:18 UTC

This package is auto-updated.

Last update: 2024-10-11 02:56:09 UTC


README

PHPUnit

HaveIBeenPwnedRangeChecker

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.

Requirements

  • PHP 7.1 or above
  • Curl

Installation

composer require griffolion/pwned

Basic Usage

use Pwned\Range;
...
$pwnedCount = (new Range())->check("password");
if ($pwnedCount > 0) {
    echo "Your password is at risk!";
}