0.0
No commit activity in last 3 years
No release in over 3 years
Returns passphrase strength based on entropy and weak passphrase tests
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Logo

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