Copyright 2013 Brooks Mason ~ LICENSE
Ruby Entropy is an algorithm for evaluating the robustness of passphrases. The algorithm uses standard entropy to calculate a base passphrase strength and then reduces that strength based on repeatability patterns, keyboard patterns, and several weak passphrase tests.
There is a javascript version of the algorithm here.
##Install
$ gem install ruby-entropy
gem 'ruby-entropy', '~> 0.2.0'
##Require
require 'ruby-entropy'
##Use
example = RubyEntropy.new('correct horse battery staple')
example.passphrase
# => correct horse battery staple
example.strength
# => 77.27
###Blacklisted words and phrases (0.2.0+) Ruby Entropy maintains a short list of blacklisted words and phrases. If you want to add a blacklisted word or phrase e.g., your website name, you can add it like so:
RubyEntropy.blacklist_passphrase('correct')
example.strength
# => 57.95