Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

matt-allan/battery-staple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battery Staple

A password generator, inspired by XKCD.

XKCD comic

Install

Via Composer

composer require yuloh/battery-staple

Usage

$password = Yuloh\BatteryStaple\PasswordGenerator::generate();
// returns something like "beefjapanesesealedunwrap"

Security

The library is 8 lines of code, so there isn't much that can go wrong. Here is what happens:

  • A word list of 10,000 words is loaded.
  • A random number is generated with random_int and the word on that line is used.
  • Repeat the above until you have 4 words.

That being said, I am not a security expert. I cannot guarantee that this library is cryptographically secure and you shouldn't use it for anything important.

Contributing

Contributions Welcome. Some ideas:

  • Allow choosing a delimiter
  • Set min/max word length, so you don't get words like 'the'
  • Case transformation options (using neko?)

About

PHP lib for generating XKCD style passwords

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages