PHPackages                             unique/was-password-pwned - 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. unique/was-password-pwned

ActiveLibrary[Security](/categories/security)

unique/was-password-pwned
=========================

A small tool to check if a password has been leaked against haveibeenpwned.com database.

131PHP

Since Feb 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/uniquexor/was-password-pwned)[ Packagist](https://packagist.org/packages/unique/was-password-pwned)[ RSS](/packages/unique-was-password-pwned/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Events
======

[](#events)

A small tool to check if a password has been leaked against haveibeenpwned.com database.

Installation
------------

[](#installation)

This component requires php &gt;= 7.4. To install it, you can use composer:

```
composer require unique/was-password-pwned

```

Usage
-----

[](#usage)

```
    $checker = new PasswordChecker();
    $count = $checker->checkIfPasswordPwned( sha1( 'my-password' ) );
    if ( $count ) {

        echo 'Your password has been leaked and found in ' . $count . ' databases.';
    } elseif ( $count === null ) {

        if ( $checker->getLastException() ) {

            echo (string) $checker->getLastException();
        } else {

            echo 'An error has occured.';
        }
    }
```

haveibeenpwned.com usage and license
------------------------------------

[](#haveibeenpwnedcom-usage-and-license)

Please read  for acceptable use of haveibeenpwned.com service and attribute it according to the author: .

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a798acb845b9c8ab35c7853f5a6bfd5e3b2b0578faea86e873fa269ea997371?d=identicon)[unique](/maintainers/unique)

---

Top Contributors

[![uniquexor](https://avatars.githubusercontent.com/u/6176836?v=4)](https://github.com/uniquexor "uniquexor (2 commits)")

### Embed Badge

![Health badge](/badges/unique-was-password-pwned/health.svg)

```
[![Health](https://phpackages.com/badges/unique-was-password-pwned/health.svg)](https://phpackages.com/packages/unique-was-password-pwned)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M212](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
