PHPackages                             dragonbe/hibp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. dragonbe/hibp

ActiveLibrary[Security](/categories/security)

dragonbe/hibp
=============

A package integrating Troy Hunt's HaveIBeenPawnd API for password checking.

v0.1.1(6y ago)12936.4k7[1 issues](https://github.com/DragonBe/hibp/issues)[2 PRs](https://github.com/DragonBe/hibp/pulls)1MITPHPPHP &gt;= 7.2

Since Jun 8Pushed 3y ago5 watchersCompare

[ Source](https://github.com/DragonBe/hibp)[ Packagist](https://packagist.org/packages/dragonbe/hibp)[ RSS](/packages/dragonbe-hibp/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (8)Versions (11)Used By (1)

[![PHP 7.2+](https://camo.githubusercontent.com/aaf3019acd783905f8a0a60c5e33e11bba0a234d5a3e4a0a0b61346f4f4baa03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f647261676f6e62652f686962702e737667)](https://secure.php.net/downloads.php)[![Packagist version](https://camo.githubusercontent.com/002b3de09f4072bf087bb087efdd6bda02c5c22ea0552b1eb28802d4aaaf0ddd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647261676f6e62652f686962702e737667)](https://packagist.org/packages/dragonbe/hibp)[![Packagist daily downloads](https://camo.githubusercontent.com/33e3255bcd6000892edfadb662e110ddafd40956029ccefebffd198558dd54e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647261676f6e62652f686962702e737667)](https://packagist.org/packages/dragonbe/hibp)[![CircleCI status](https://camo.githubusercontent.com/ae94cc440bf59bffe9519a8dee5be6c3612caa9e6c86f06327cd8e7fca178823/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6769746875622f447261676f6e42652f686962702e737667)](https://circleci.com/gh/DragonBe/hibp)[![Infection MSI](https://camo.githubusercontent.com/d0245743d5081a54a5c7844a32c9eb0b486747dddf925d4e80db03fb4125e465/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f447261676f6e42652f686962702f6d6173746572)](https://github.com/DragonBe/hibp)

Have I been pwned Composer package
==================================

[](#have-i-been-pwned-composer-package)

To increase security of users on your system, I started building a client for [@TroyHunt](https://twitter.com/troyhunt)'s [Have I Been Pwned?](https://haveibeenpwned.com/) API v2 that will check if a given password was already used in a breach. Many thanks to Mr. Troy Hunt for providing us this service.

Project scope
-------------

[](#project-scope)

The goal of this project is to have a [composer package](https://packagist.org) that will allow you to quickly verify if a given password (from a registration or password reset form) was found in a data breach so you can inform your users to change their password and thus improving overal security.

This project was also the subject of my talk [Mutation Testing with Infection](https://www.meetup.com/PHP-Leuven-Web-Innovation-Group/events/sctxfnyxjbkb/) where the code base was not only covered by unit tests, but also was subjected to **Mutation Testing** using [Infection](https://infection.github.io/) to ensure no coding mistakes could slip into the codebase.

Getting started
---------------

[](#getting-started)

First of all you need to add this library to your project. The easiest way is to use [Composer](https://getcomposer.org).

```
composer require dragonbe/hibp

```

If you want to quickly test the functionality, copy/paste the following code in a file named `hibp.php`.

```
