RbPass
RbPass is a Ruby port of PHPass, a portable password hashing framework written in PHP. PHPass is used by WordPress, bbPress, Vanilla Forums, PivotX and phpBB.
Installation
Add this line to your application's Gemfile:
gem 'rbpass'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rbpass
Usage
require 'rbpass'
password_hasher = RbPass::PasswordHasher.new(8, false)
# Hashing a password
password = 'somepasswordhere'
password_hash = password_hasher.hash(password)
# Password checking
password = 'somepasswordhere'
password_hash = get_password_hash_from_somewhere()
if password_hasher.check(password, password_hash)
puts 'Valid password'
else
puts 'Invalid password'
end
Copyright
Copyright © 2013 Pablo Elices. See license for details.