PHPackages                             staabm/password\_exposed - 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. staabm/password\_exposed

ActiveLibrary[Security](/categories/security)

staabm/password\_exposed
========================

This PHP package provides a `password\_exposed` helper function, that uses the haveibeenpwned.com API to check if a password has been exposed in a data breach.

5.0.1(1y ago)0589.6k—4.3%1LGPL-3.0-onlyPHPPHP ^7.4||^8.0

Since Feb 1Pushed 1y agoCompare

[ Source](https://github.com/staabm/password_exposed)[ Packagist](https://packagist.org/packages/staabm/password_exposed)[ GitHub Sponsors](https://github.com/staabm)[ RSS](/packages/staabm-password-exposed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (29)Used By (0)

🔒 Password Exposed Helper Function
==================================

[](#-password-exposed-helper-function)

This PHP package provides a `password_exposed` helper function, that uses the haveibeenpwned.com API to check if a password has been exposed in a data breach.

 [![](assets/images/password-exposed.png)](assets/images/password-exposed.png)

 [ ![Build Status](https://camo.githubusercontent.com/6b8b1376a47810d166c14126c6db5595cee27f4345844ba9b08e1cdbc25d05cb/68747470733a2f2f7472617669732d63692e6f72672f446976696e654f6d6567612f70617373776f72645f6578706f7365642e7376673f6272616e63683d6d6173746572) ](https://travis-ci.org/DivineOmega/password_exposed) [ ![StyleCI](https://camo.githubusercontent.com/9107aa48fb3202339e48725df2b0292f9a3430ad32f8d111e3baae9eaf41a45f/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131393834353839362f736869656c643f6272616e63683d6d6173746572) ](https://styleci.io/repos/119845896) [ ![](https://camo.githubusercontent.com/afbf9c6c64feb3dad268f349b7dd1533d120646aa964145eac553d22ba933f31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f446976696e654f6d6567612f70617373776f72645f6578706f7365642e737667) ](https://packagist.org/packages/divineomega/password_exposed/stats)

Credits
-------

[](#credits)

This package is based on the work of Jordan Hall aka. [DivineOmega](https://github.com/DivineOmega/password_exposed).

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

[](#installation)

The `password_exposed` package can be easily installed using Composer. Just run the following command from the root of your project.

```
composer require "divineomega/password_exposed"

```

If you have never used the Composer dependency manager before, head to the [Composer website](https://getcomposer.org/) for more information on how to get started.

Usage
-----

[](#usage)

To check if a password has been exposed in a data breach, just pass it to the `password_exposed` method.

Here is a basic usage example:

```
switch(password_exposed('hunter2')) {

    case PasswordStatus::EXPOSED:
        // Password has been exposed in a data breach.
        break;

    case PasswordStatus::NOT_EXPOSED:
        // Password has not been exposed in a known data breach.
        break;

    case PasswordStatus::UNKNOWN:
        // Unable to check password due to an API error.
        break;
}
```

If you prefer to avoid using helper functions, the following syntax is also available.

```
$passwordStatus = (new PasswordExposedChecker())->passwordExposed($password);
```

### SHA1 Hash

[](#sha1-hash)

You can also supply the SHA1 hash instead of the plain text password, by using the following method.

```
$passwordStatus = (new PasswordExposedChecker())->passwordExposedByHash($hash);
```

or...

```
$passwordStatus = password_exposed_by_hash($hash);
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 52.6% 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.

###  Release Activity

Cadence

Every ~96 days

Recently: every ~477 days

Total

27

Last Release

515d ago

Major Versions

v1.0.1 → v2.0.02018-02-08

v2.8.0 → v3.0.02019-02-04

v3.2.0 → 5.02024-12-18

PHP version history (4 changes)v2.4.0PHP &gt;=5.6

v3.0.0PHP ^7.1

v3.2.0PHP ^7.1||^8.0

5.0PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/99d4e5e5fa8fb7d0782de39b43c558953d0a5881a7ba596b90ed9c312db8c4d9?d=identicon)[staabm](/maintainers/staabm)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (72 commits)")[![nicklog](https://avatars.githubusercontent.com/u/462920?v=4)](https://github.com/nicklog "nicklog (28 commits)")[![jameswilddev](https://avatars.githubusercontent.com/u/3138458?v=4)](https://github.com/jameswilddev "jameswilddev (13 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (7 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (6 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![tacovandenbroek](https://avatars.githubusercontent.com/u/1499481?v=4)](https://github.com/tacovandenbroek "tacovandenbroek (2 commits)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (2 commits)")[![paragonie-security](https://avatars.githubusercontent.com/u/15914520?v=4)](https://github.com/paragonie-security "paragonie-security (2 commits)")[![caugner](https://avatars.githubusercontent.com/u/495429?v=4)](https://github.com/caugner "caugner (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/staabm-password-exposed/health.svg)

```
[![Health](https://phpackages.com/badges/staabm-password-exposed/health.svg)](https://phpackages.com/packages/staabm-password-exposed)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15224.3M65](/packages/opensearch-project-opensearch-php)

PHPackages © 2026

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