xkcd936 style passphrase generator.
But we use 5 words instead of 4, since 5 words will achieve an entropy of:
log(99171)/log(2)*5 = 82.988
This is enough. NIST recommends 80-bits for the most secure passwords. And it roughly needs 6 billions USD to break.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install xkcd936
As a library:
require 'xkcd936' Xkcd936.generate_passphrase('path/to/dictionary/file')
If you does not give a path, it will use
/usr/share/dict/words as default.
As a command line tool:
- Fork it ( https://github.com/weakish/xkcd936/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request