The fantastic pwqgen from the passwdqc package is a one-of-a-kind implementation of a pronounceable random passphrase / password generator. I’ve been searched around the net for something similar but there were none.
The passphrase generator that I want needs to be pronounceable, easy to read and type, and most importantly still secure. Of course, passwords are the most secure with a random string of characters, but they are hardly useable. More readable ones need to be longer but given their readability, the slight increase in length is a well-worth tradeoff. xkcd: Password Strength illustrates this concept succinctly.
- Ruby >= 1.9.2
gem install pwqgen.rb
You can generate a random password from the command line.
$ pwqgen.rb --help Usage: pwqgen.rb [options] [<length>] Options: -h, --help show this help message and exit -v, --version show version and exit <length>: Number of words in the passphrase. [default: 3]
require it within your app:
require 'rubygems' require 'pwqgen' p Pwqgen.generate # => "Image&Both-action" p Pwqgen.generate 5 # => "Alaska_Union9Calf=domain&ever" pgen = Pwqgen.new # => #<Pwqgen::Generator:0x9f6ec40 ...> p pgen.generate # => "String5Rebel+horse" p pgen.generate 2 # => "Easily2desist"
- A web-based demonstration is available on Heroku. (Source).
- Original C Implementation, http://www.openwall.com/passwdqc/.
- Original Design and C implementation from http://www.openwall.com/passwdqc/ by Solar Designer.
The random number generator is based on MT algorithm. I welcome pull-requests for better implementations of a random number generator.