laszlof / php-hibp
A PHP library for communicating with the HaveIBeenPwned.com API
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/laszlof/php-hibp
Requires
- php: ^7.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2025-12-07 11:07:55 UTC
README
laszlof/php-hibp is an SDK which allows PHP developers to easily communicate with the API provided by HaveIBeenPwned.Com.
Requirements
- PHP 7.0+
How to install
composer require laszlof/php-hibp
Usage
Get a list of breaches for a specific acccount (username/email)
use Hibp\Hibp; $account = 'you@yourdomain.com'; $breaches = Hibp::getBreaches($account);
Get a single breach by name
use Hibp\Hibp; $name = 'Adobe'; $breach = Hibp::getBreach($account);
Get a list of sites that have been breached (optionally filtered by domain)
use Hibp\Hibp; $breaches = Hibp::getBreachedSites(); $domain = 'adobe.com'; $breaches = Hibp::getBreachedSites($domain);
Get a list of the types of dataclasses
use Hibp\Hibp; $dataClasses = Hibp::getDataClasses();
Get a list of pastes for a specific acccount (username/email)
use Hibp\Hibp; $account = 'you@yourdomain.com'; $breaches = Hibp::getPastes($account);
Check if a password has been compromised.
use Hibp\Hibp; $password = 'password123'; $isCompromised = Hibp::checkPassword($password); // Optionally check with a password that IS a hash itself. $password_is_a_hash = '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'; $isCompromised = Hibp::checkPassword($password_is_a_hash, true);