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 yesterday

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 60% 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

2572d 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://www.gravatar.com/avatar/9295d08f59cf2fd9b63c7b7812a6aa3bc0756398f4e21fffc23a22c3b29c6041?d=identicon)[MiChAeLoKGB](/maintainers/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

[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[rollerworks/password-strength-validator

Password-strength validator for Symfony

1455.7M6](/packages/rollerworks-password-strength-validator)[rollerworks/password-strength-bundle

Password-strength validator bundle for Symfony

1433.7M6](/packages/rollerworks-password-strength-bundle)[schuppo/password-strength

This package provides a validator for ensuring strong passwords in Laravel 4 applications.

1432.7M1](/packages/schuppo-password-strength)[kartik-v/strength-meter

A dynamic strength meter for password input validation with various configurable options.

871.2M4](/packages/kartik-v-strength-meter)[infinitypaul/laravel-password-history-validation

Prevent users from reusing recently used passwords

86214.4k](/packages/infinitypaul-laravel-password-history-validation)

PHPackages © 2026

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