PHP library for generating easy to remember, but hard to quess passwords. Inspired by xkcd comic, library generates phrases from frequently used words. Contains different word lists:
- Common English words (example "idea critic happy chinese")
- Common Russian words (example "порошок земля нуль платье")
- Common Russian transliterated (example "vysota razum bumazhka razmer")
Via Composer
{
"require": {
"barzo/password-generator": "dev-master"
}
}
Generate password from English words list with default length (4 words) and default separator (space)
// would output something like "idea critic happy chinese"
echo Barzo\Password\Generator::generateEn();
Generate password with implict word list and params
$wordList = new Barzo\Password\WordList\RuTranslit();
// would output something like "dovod-gore-sever-nomer-druzhka"
echo Generator::generate($wordList, 5, '-');
Example - idea critic happy chinese. List of 2048 most frequently used English words (source)
// using short syntax
echo Barzo\Password\Generator::generateEn();
// equivalent
$wordList = new Barzo\Password\WordList\En();
echo Generator::generate($wordList);
Example - vysota razum bumazhka razmer. List of 2048 most frequently used Russain nouns (source). Words with "hard" to transliterate letters (ц, щ, ь, ъ) excluded.
// using short syntax
echo Barzo\Password\Generator::generateRuTranslit();
// equivalent
$wordList = new Barzo\Password\WordList\RuTranslit();
echo Generator::generate($wordList);
Example - порошок земля нуль платье. List of 2048 most frequently used Russain nouns (source).
// using short syntax
echo Barzo\Password\Generator::generateRu();
// equivalent
$wordList = new Barzo\Password\WordList\Ru();
echo Generator::generate($wordList);
$ phpunit
Pull requests are welcome.
The MIT License (MIT). Please see License File for more information.