Password Generator

True\PasswordGenerator produces secure but memorable passwords by stitching together random adjectives and nouns — handy for default account passwords, password-reset emails, or any flow where the user has to retype or read out the value.

Generate a password

use True\PasswordGenerator;

$gen = new PasswordGenerator;
$password = $gen->generate(4);

echo $password;
// => Brave Tiger Happy Mountain

Word count

The single argument picks the structure:

ValueStructureExample
21 adjective + 1 nounBrave Tiger
32 adjectives + 1 nounBrave Happy Tiger
4 (default)2 adjectives + 2 nounsBrave Tiger Happy Mountain
53 adjectives + 2 nounsBrave Quiet Tiger Happy Mountain

Word sources

The adjective and noun lists ship with the True package:

  • BP/vendor/truecastdesign/true/assets/adjectives.txt
  • BP/vendor/truecastdesign/true/assets/nouns.txt

Each line is one word. Edit the files or drop in your own lists if you want a domain-specific vocabulary.