PHPackages                             yarri/password-strength-analyzer - 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. yarri/password-strength-analyzer

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

yarri/password-strength-analyzer
================================

Scores password strength from 0% to 100%, penalizing repeated patterns and consecutive character sequences.

v0.1.4(2mo ago)0291↓92.9%MITPHPPHP &gt;=5.6.0CI passing

Since Jul 6Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/yarri/PasswordStrengthAnalyzer)[ Packagist](https://packagist.org/packages/yarri/password-strength-analyzer)[ Docs](https://github.com/yarri/PasswordStrengthAnalyzer)[ RSS](/packages/yarri-password-strength-analyzer/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

PasswordStrengthAnalyzer
========================

[](#passwordstrengthanalyzer)

[![Tests](https://github.com/yarri/PasswordStrengthAnalyzer/actions/workflows/tests.yml/badge.svg)](https://github.com/yarri/PasswordStrengthAnalyzer/actions/workflows/tests.yml)[![Downloads](https://camo.githubusercontent.com/fc277976e522f834734799dbcc3e3231b71a81075bca8e46d36b3e92065e6cb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79617272692f70617373776f72642d737472656e6774682d616e616c797a65722e737667)](https://packagist.org/packages/yarri/password-strength-analyzer)

Scores password strength from 0% to 100%, penalizing repeated patterns and consecutive character sequences. Unicode and diacritics are supported.

Usage
-----

[](#usage)

```
$analyzer = new Yarri\PasswordStrengthAnalyzer();
$score = $analyzer->analyze("someFAIRpasswd"); // 26

```

Passwords with letters, numbers, and symbols are rated high.

```
echo $analyzer->analyze("SomW2!3RE#"); // 91

```

Letter-only passwords can also score high if they are long enough.

```
echo $analyzer->analyze("someBOYS"); // 9
echo $analyzer->analyze("someBOYSdontCRY"); // 38
echo $analyzer->analyze("someBOYSdontCRYmuch"); // 71

```

But not all long passwords are rated high.

```
echo $analyzer->analyze("somesomesomesomesomesome"); // 4

```

Groups of 3 or more consecutive characters have a negative impact on the final score.

```
echo $analyzer->analyze("Secret18239!"); // 58
echo $analyzer->analyze("Secret12345!"); // 45
echo $analyzer->analyze("Secret76543!"); // 45

echo $analyzer->analyze("OpenAFBGCED!"); // 42
echo $analyzer->analyze("OpenABCDEFG!"); // 30

```

Use `getCoefficients()` to inspect the individual scoring factors after an analysis:

```
$analyzer->analyze("SomW2!3RE#"); // 91
print_r($analyzer->getCoefficients());
// [
//   'unique_chars'      => 2,
//   'password_length'   => 1,
//   'types_used'        => 1.0125,
//   'type_transitions'  => 0.8958,
//   'simplicity_factor' => 1,
// ]

```

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

[](#installation)

Use Composer:

```
composer require yarri/password-strength-analyzer

```

Live testing
------------

[](#live-testing)

In the package, there is a script runnable in shell which can be used for live testing.

```
$ php test/test_cli.php

initial score: 50%
coefficients:
* unique_chars: 1.8
* password_length: 1.2
* types_used: 0.675
* type_transitions: 0.7465
* simplicity_factor: 1
FINAL SCORE: 54%
password: THISisS3CR3T

```

License
-------

[](#license)

PasswordStrengthAnalyzer is free software distributed [under the terms of the MIT license](http://www.opensource.org/licenses/mit-license)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance83

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~343 days

Total

5

Last Release

87d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/974278?v=4)[Jaromir Tomek](/maintainers/yarri)[@yarri](https://github.com/yarri)

---

Top Contributors

[![yarri](https://avatars.githubusercontent.com/u/974278?v=4)](https://github.com/yarri "yarri (43 commits)")

---

Tags

passwordscoreanalyzestrength

### Embed Badge

![Health badge](/badges/yarri-password-strength-analyzer/health.svg)

```
[![Health](https://phpackages.com/badges/yarri-password-strength-analyzer/health.svg)](https://phpackages.com/packages/yarri-password-strength-analyzer)
```

###  Alternatives

[kartik-v/strength-meter

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

881.3M7](/packages/kartik-v-strength-meter)[rollerworks/password-strength-validator

Password-strength validator for Symfony

1446.0M7](/packages/rollerworks-password-strength-validator)[rollerworks/password-strength-bundle

Password-strength validator bundle for Symfony

1473.8M10](/packages/rollerworks-password-strength-bundle)[schuppo/password-strength

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

1442.8M1](/packages/schuppo-password-strength)[jbafford/password-strength-bundle

Provides a password strength validator

30502.1k](/packages/jbafford-password-strength-bundle)[infinitypaul/laravel-password-history-validation

Prevent users from reusing recently used passwords

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

PHPackages © 2026

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