PHPackages                             drenso/genphrase - 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. drenso/genphrase

ActiveLibrary

drenso/genphrase
================

Secure passphrase generator for PHP applications

v2.2.0(1y ago)24.0k—2.2%MITPHPPHP &gt;=8.3

Since Feb 12Pushed 1mo agoCompare

[ Source](https://github.com/Drenso/GenPhrase)[ Packagist](https://packagist.org/packages/drenso/genphrase)[ Docs](https://github.com/timoh6/GenPhrase)[ RSS](/packages/drenso-genphrase/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

About
=====

[](#about)

[![Packagist](https://camo.githubusercontent.com/1bace018b5a2192410baa1716787ca46f760f92819b8bbcf752d70876c330333/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472656e736f2f67656e7068726173652e737667)](https://packagist.org/packages/genphrase/genphrase)[![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](LICENSE)

> This library has been forked from [timoh6/GenPhrase](https://github.com/timoh6/GenPhrase)and has been updated for modern PHP.

GenPhrase is a secure passphrase generator for PHP applications. GenPhrase is based on passwdqc's pwqgen program. See

GenPhrase can be used to generate secure and easy to memorize random passphrases. For example output, see [examples](#what-kind-of-passphrases-genphrase-generate).

GenPhrase can use arbitrary size wordlists. Words for a passphrase are selected uniformly at random from the wordset.

Requirements
------------

[](#requirements)

GenPhrase requires PHP version 8.3 or greater. See `composer.json` for all requirements.

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

[](#installation)

GenPhrase supports installation using Composer:

[drenso/genphrase ](https://packagist.org/packages/drenso/genphrase)

Passphrase generation with GenPhrase
------------------------------------

[](#passphrase-generation-with-genphrase)

By default, GenPhrase generates passphrases using english words (english.lst). Those passphrases will have at least 50 bits of entropy.

GenPhrase has currently two built-in wordlists: english.lst (default) and diceware.lst. You can add/remove/combine wordlists as you like.

More about the original english wordlist via Openwall: [http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/passwdqc/passwdqc/wordset\_4k.c?rev=1.5;content-type=text%2Fplain](http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/passwdqc/passwdqc/wordset_4k.c?rev=1.5;content-type=text%2Fplain)

The only modification between the GenPhrase english wordlist and the Openwall wordlist is we changed all the words to be lowercase.

Note, the Diceware list bundled with GenPhrase as of 1.1.0 is EFF's "long" version, but without four words which contains "-" character (as this character is a GenPhrase separator character). For more information about EFF's Diceware list, see:

Note, GenPhrase allows you to specify separator characters which may be used between the words. If you want to specify these separator characters, make sure you use only unique single-byte characters. More information about setting separator characters is in the usage examples below.

### What kind of passphrases GenPhrase generate?

[](#what-kind-of-passphrases-genphrase-generate)

A few examples to demonstrate the output:

With default settings, the passphrase would be for example like:

```
Alter Berlin Paint meaning

```

Generating a passphrase having 40 bits of entropy:

```
musica$Menu&Quota

```

A passphrase having 50 bits of entropy and separator characters and word capitalizing disabled:

```
setthenrolegiftdancing

```

Usage
-----

[](#usage)

```
