PHPackages                             barzo/password-generator - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. barzo/password-generator

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

barzo/password-generator
========================

PHP library for generating easy to remember but hard to guess passwords

v1.0.0(5y ago)3640.8k↓38.5%12[1 issues](https://github.com/denys-potapov/password-generator/issues)[1 PRs](https://github.com/denys-potapov/password-generator/pulls)MITPHPCI failing

Since Oct 11Pushed 5y ago3 watchersCompare

[ Source](https://github.com/denys-potapov/password-generator)[ Packagist](https://packagist.org/packages/barzo/password-generator)[ Docs](https://github.com/denys-potapov/password-generator)[ RSS](/packages/barzo-password-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Phrase password generator
=========================

[](#phrase-password-generator)

[![PHP 7 ready](https://camo.githubusercontent.com/d2c1c2a81a6abcba071b59ae59ad18a23d54706052eab458f4ff2ebac47ac591/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f64656e79732d706f7461706f762f70617373776f72642d67656e657261746f722f62616467652e737667)](https://travis-ci.org/denys-potapov/password-generator)[![Build Status](https://camo.githubusercontent.com/4c84df10daaa82f7816530df2a6f2d261268edbb6e504922777f1fa0fc0fa406/68747470733a2f2f7472617669732d63692e6f72672f64656e79732d706f7461706f762f70617373776f72642d67656e657261746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/denys-potapov/password-generator)[![Total Downloads](https://camo.githubusercontent.com/d8582558ecb6868b52052e90f4729a0b135770cf9b6cd96be6f3cd8b755f9929/68747470733a2f2f706f7365722e707567782e6f72672f6261727a6f2f70617373776f72642d67656e657261746f722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/barzo/password-generator)

PHP library for generating easy to remember, but hard to quess passwords. Inspired by [xkcd comic](http://xkcd.com/936/), library generates phrases from frequently used words:

- English phrases (example "throat fast only idea")
- German phrases (examle "laut welt ganze liter")
- Russian phrases (example "тоже металл пора подача")
- Russian transliterated phrases (example "kater nekiy zabrat dazhe")

[Try online](http://denyspotapov.com/password/?en)

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "barzo/password-generator": "~0.4"
    }
}
```

Basic usage
-----------

[](#basic-usage)

Generate password with default length (4 words) and default separator (space).

```
use Barzo\Password\Generator;

// would output something like "throat fast only idea"
echo Generator::generateEn();

// would output something like "laut welt ganze liter"
echo Generator::generateDe();

// would output something like "тоже металл пора подача"
echo Generator::generateRu();

// would output something like "kater nekiy zabrat dazhe"
echo Generator::generateRuTranslit();
```

Each of above functions accepts length and separator paramenetrs.

```
// would output something like "ritual-error-raise-arab-tail"
echo Barzo\Password\Generator::generateEn(5, '-');
```

Advanced usage
--------------

[](#advanced-usage)

Call static function Generator::generate to generate passwords from wordlists. Params

- *wordlists* - array of WordListInterface. If array is shorter then length, function would iterate from the beginning of array.
- *lenght* - password length in words. Default - 4
- *separator* - words separator. Default - ' '(space)

Example:

```
echo Generator::generate(
    [
        new Barzo\Password\WordList\En(),
        new Barzo\Password\WordList\RuTranslit()
    ],
    5,
    '-'
);

// would output something like "idea-dovod-critic-sever-happy"
```

Word lists
----------

[](#word-lists)

### English

[](#english)

List of 2048 most frequently used English words.

ClassCommentWord lenghthExample**WordList\\En**all words4-6have, that**WordList\\En\\Nouns**nouns4-6time, year**WordList\\En\\Verbs**verbs4-6have, would**WordList\\En\\Adjectives**adjectives4-8other, good### German

[](#german)

List of 2048 most frequently used german words(source). Words with diacritic letters (ä, ö, ü) and eszett (ß) excluded.

ClassCommentWord lenghthExample**WordList\\De**all words4-6sich, nicht### Russian Transliterated

[](#russian-transliterated)

List of 2048 transliterated most frequently used Russain words ([source](http://dict.ruslang.ru/freq.php)). "Hard" to transliterate letters (ь, ъ) excluded.

ClassCommentWord lenghthExample**WordList\\RuTranslit**all words4-6chto, etot**WordList\\RuTranslit\\Nouns**nouns4-8chelovek, vremya**WordList\\RuTranslit\\Verbs**verbs4-8moch, skazat**WordList\\RuTranslit\\Adjectives**adjectives4-8novyy, bolshoy### Russian

[](#russian)

Lists consist of 2048 most frequently used Russain words ([source](http://dict.ruslang.ru/freq.php)).

ClassCommentWord lenghthExample**WordList\\Ru**all words4-6быть, этот**WordList\\Ru\\Nouns**nouns4-8человек, время**WordList\\Ru\\Verbs**verbs4-8быть, мочь**WordList\\Ru\\Adjectives**adjectives4-8новый, большойSecurity
--------

[](#security)

If OpenSSL extension avaivable library would use [openssl\_random\_pseudo\_bytes](http://php.net/manual/en/function.openssl-random-pseudo-bytes.php) for random number generation.

Testing
-------

[](#testing)

```
$ php vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

### 1.0.0

[](#100)

- Update namespaces for psr-4 and composer 2 (thanks to @parkourben99)

### 0.4.0

[](#040)

- Updated **WordList\\Ru**. Now only words with length from 4 to 6
- Updated **WordList\\RuTranslit**. Now only words with length from 4 to 6
- Added German words list

Contributing
------------

[](#contributing)

To add new language open an issue with link to frequency dictionary.

Pull requests are welcome.

Credits
-------

[](#credits)

[All Contributors](https://github.com/denys-potapov/password-generator/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/denys-potapov/password-generator/blob/master/LICENSE) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

5

Last Release

2023d ago

Major Versions

v0.4.0 → v1.0.02020-11-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e35a35a4b046e325ce7ed7627d862638950bdb73cc0e33c5f0513867a8c9e94?d=identicon)[denys-potapov](/maintainers/denys-potapov)

---

Top Contributors

[![denys-potapov](https://avatars.githubusercontent.com/u/2123712?v=4)](https://github.com/denys-potapov "denys-potapov (45 commits)")

---

Tags

password

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/barzo-password-generator/health.svg)

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

###  Alternatives

[paragonie/halite

High-level cryptography interface powered by libsodium

1.2k9.4M63](/packages/paragonie-halite)[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

791.2M17](/packages/kartik-v-yii2-password)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[phpnode/yiipassword

Password strategies for the Yii PHP framework.

75188.5k3](/packages/phpnode-yiipassword)[yebor974/filament-renew-password

Package for manage renew password according to the last renew or other criteria

4482.6k3](/packages/yebor974-filament-renew-password)[martbock/laravel-diceware

Diceware Passphrase Generator for Laravel

3264.7k](/packages/martbock-laravel-diceware)

PHPackages © 2026

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