PHPackages                             haibrini/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. haibrini/password-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

haibrini/password-generator
===========================

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

v0.6.0(8y ago)0273↓80%MITPHP

Since Oct 11Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (9)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)

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 transliterated phrases (example "kater nekiy zabrat dazhe")

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

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "haibrini/password-generator": "~0.5"
    }
}
```

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

[](#basic-usage)

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

```
use HaiBrini\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 "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 HaiBrini\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 HaiBrini\Password\WordList\En(),
        new HaiBrini\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, bolshoySecurity
--------

[](#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)

### 0.5.0

[](#050)

- Added option for uppercase/capitalize

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/haibrini/password-generator/blob/master/LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~158 days

Recently: every ~219 days

Total

8

Last Release

3130d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9318915?v=4)[HaiBrini](/maintainers/haibrini)[@haibrini](https://github.com/haibrini)

---

Top Contributors

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

---

Tags

password

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[kevinlebrun/password.php

Helpers for password generation and validation

17142.3k1](/packages/kevinlebrun-passwordphp)[naif/generate-password

A Laravel Nova password field with generating random password option

1880.3k](/packages/naif-generate-password)

PHPackages © 2026

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