PHPackages                             michaelokgb/zxcvbn-php - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. michaelokgb/zxcvbn-php

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

michaelokgb/zxcvbn-php
======================

Realistic password strength estimation PHP library based on Zxcvbn JS

4.5.0(7y ago)0311MITPHPPHP ^7.0

Since Apr 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MiChAeLoKGB/zxcvbn-php)[ Packagist](https://packagist.org/packages/michaelokgb/zxcvbn-php)[ Docs](https://github.com/MiChAeLoKGB/zxcvbn-php)[ RSS](/packages/michaelokgb-zxcvbn-php/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (4)Versions (11)Used By (0)

Zxcvbn-PHP is a password strength estimator using pattern matching and minimum entropy calculation. Zxcvbn-PHP is based on the [the Javascript zxcvbn project](https://github.com/dropbox/zxcvbn) from [Dropbox and @lowe](https://tech.dropbox.com/2012/04/zxcvbn-realistic-password-strength-estimation/). "zxcvbn" is bad password, just like "qwerty" and "123456".

> zxcvbn attempts to give sound password advice through pattern matching and conservative entropy calculations. It finds 10k common passwords, common American names and surnames, common English words, and common patterns like dates, repeats (aaa), sequences (abcd), and QWERTY patterns.

[![Build Status](https://camo.githubusercontent.com/bc788a472e2ee0065fc15f9b6b5e3dd303b801192fec668eff810a465ba7aea3/68747470733a2f2f7472617669732d63692e6f72672f4d69436841654c6f4b47422f7a786376626e2d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/MiChAeLoKGB/zxcvbn-php)[![Coverage Status](https://camo.githubusercontent.com/5b8b0b5335750c95f0384035023a96a1583b474d797b15903e36e73abd2f2e9c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d69436841654c6f4b47422f7a786376626e2d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/MiChAeLoKGB/zxcvbn-php?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/2702da9284d77458baa3e8aba2f764fdb7812ae7943f2cfa6a90d54279fa7c2b/68747470733a2f2f706f7365722e707567782e6f72672f4d69436841654c6f4b47422f7a786376626e2d7068702f762f737461626c65)](https://packagist.org/packages/mkopinsky/zxcvbn-php)[![License](https://camo.githubusercontent.com/18f6d509daff381ec37dec83dd357270f9f8d7aaf4fedc186cdb23ea50065159/68747470733a2f2f706f7365722e707567782e6f72672f4d69436841654c6f4b47422f7a786376626e2d7068702f6c6963656e7365)](https://packagist.org/packages/MiChAeLoKGB/zxcvbn-php)

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

[](#installation)

The library can be installed with [Composer](http://getcomposer.org) by adding it as a dependency to your composer.json file.

```
{
    "require": {
        "michaelokgb/zxcvbn-php": "^4.5"
    }
}
```

After running `php composer.phar update` on the command line, include the autoloader in your PHP scripts so that the ZxcvbnPhp class is available.

```
require_once 'vendor/autoload.php';
```

Usage
-----

[](#usage)

```
use ZxcvbnPhp\Zxcvbn;

$userData = [
  'Marco',
  'marco@example.com'
];

$zxcvbn = new Zxcvbn();
$strength = $zxcvbn->passwordStrength('password', $userData);
echo $strength['score'];
// will print 0

$strength = $zxcvbn->passwordStrength('correct horse battery staple');
echo $strength['score'];
// will print 4
```

### Acknowledgements

[](#acknowledgements)

Thanks to:

- @lowe for the original [Javascript Zxcvbn](https://github.com/lowe/zxcvbn)
- [@Dreyer's port](https://github.com/Dreyer/php-zxcvbn) for reference for initial implementation
- [bjeavon's implementation](https://github.com/bjeavons/zxcvbn-php) for building out zxcvbn-php as a solid initial port of the Dropbox library with composer support and unit tests

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~231 days

Recently: every ~355 days

Total

9

Last Release

2620d ago

Major Versions

0.3.0 → 4.4.22018-09-14

PHP version history (4 changes)0.1.0PHP &gt;=5.3.0

0.2.0PHP ^5.3 || ^7.0

4.4.2PHP ^5.6 || ^7.0

4.5.0PHP ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6197503?v=4)[Michal](/maintainers/MiChAeLoKGB)[@MiChAeLoKGB](https://github.com/MiChAeLoKGB)

---

Top Contributors

[![clamburger](https://avatars.githubusercontent.com/u/1396298?v=4)](https://github.com/clamburger "clamburger (62 commits)")[![mkopinsky](https://avatars.githubusercontent.com/u/591435?v=4)](https://github.com/mkopinsky "mkopinsky (53 commits)")[![bjeavons](https://avatars.githubusercontent.com/u/94468?v=4)](https://github.com/bjeavons "bjeavons (41 commits)")[![MiChAeLoKGB](https://avatars.githubusercontent.com/u/6197503?v=4)](https://github.com/MiChAeLoKGB "MiChAeLoKGB (16 commits)")[![texdc](https://avatars.githubusercontent.com/u/1590605?v=4)](https://github.com/texdc "texdc (8 commits)")[![paragonie-scott](https://avatars.githubusercontent.com/u/11591518?v=4)](https://github.com/paragonie-scott "paragonie-scott (2 commits)")[![PReimers](https://avatars.githubusercontent.com/u/1785288?v=4)](https://github.com/PReimers "PReimers (1 commits)")

---

Tags

passwordzxcvbn

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/michaelokgb-zxcvbn-php/health.svg)

```
[![Health](https://phpackages.com/badges/michaelokgb-zxcvbn-php/health.svg)](https://phpackages.com/packages/michaelokgb-zxcvbn-php)
```

###  Alternatives

[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k156.0M487](/packages/giggsey-libphonenumber-for-php)[symfony/validator

Provides tools to validate values

2.7k300.0M3.9k](/packages/symfony-validator)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87118.6M76](/packages/bjeavons-zxcvbn-php)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[giggsey/libphonenumber-for-php-lite

A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber

9315.3M63](/packages/giggsey-libphonenumber-for-php-lite)

PHPackages © 2026

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