Download the PHP package haibrini/password-generator without Composer
On this page you can find all versions of the php package haibrini/password-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download haibrini/password-generator
More information about haibrini/password-generator
Files in haibrini/password-generator
Package password-generator
Short Description PHP library for generating easy to remember but hard to guess passwords
License MIT
Homepage https://github.com/haibrini/password-generator
Informations about the package password-generator
Phrase password generator
PHP library for generating easy to remember, but hard to quess passwords. Inspired by xkcd comic, 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")
Install
Via Composer
Basic usage
Generate password with default length (4 words) and default separator (space).
Each of above functions accepts length and separator paramenetrs.
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:
Word lists
English
List of 2048 most frequently used English words.
Class | Comment | Word lenghth | Example |
---|---|---|---|
WordList\En | all words | 4-6 | have, that |
WordList\En\Nouns | nouns | 4-6 | time, year |
WordList\En\Verbs | verbs | 4-6 | have, would |
WordList\En\Adjectives | adjectives | 4-8 | other, good |
German
List of 2048 most frequently used german words(source). Words with diacritic letters (ä, ö, ü) and eszett (ß) excluded.
Class | Comment | Word lenghth | Example |
---|---|---|---|
WordList\De | all words | 4-6 | sich, nicht |
Russian Transliterated
List of 2048 transliterated most frequently used Russain words (source). "Hard" to transliterate letters (ь, ъ) excluded.
Class | Comment | Word lenghth | Example |
---|---|---|---|
WordList\RuTranslit | all words | 4-6 | chto, etot |
WordList\RuTranslit\Nouns | nouns | 4-8 | chelovek, vremya |
WordList\RuTranslit\Verbs | verbs | 4-8 | moch, skazat |
WordList\RuTranslit\Adjectives | adjectives | 4-8 | novyy, bolshoy |
Security
If OpenSSL extension avaivable library would use openssl_random_pseudo_bytes for random number generation.
Testing
Changelog
0.5.0
- Added option for uppercase/capitalize
Contributing
To add new language open an issue with link to frequency dictionary.
Pull requests are welcome.
Credits
License
The MIT License (MIT). Please see License File for more information.