= Ruby Gem: Secure Password Hash to do SHA256 secure passwords. Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com Copyright:: Copyright (c) 2006-2009 Joel Parker Henderson License:: CreativeCommons License, Non-commercial Share Alike License:: LGPL, GNU Lesser General Public License Password hash tool to create secure passwords, This uses SHA256 hexdigest for the cryptographic hash, and authenticates a password, salt, and hash. To create a password: require 'rubygem_secure_password_hash' text = 'mysecret' salt = 'azsxdcfv' hash = SecurePasswordHash.new(text,salt) To create a password using our helpers: require 'rubygem_secure_password_hash' require 'rubygem_secure_password_salt' require 'rubygem_secure_password_text' text = SecurePasswordText.new salt = SecurePasswordSalt.new hash = SecurePasswordHash.new(text,salt) To verify a password: hash.valid?(text,salt) To verify a password from a web form for a user: user = User.find(params[:id]) or raise 'user not found' user.hash.valid?(params[:password],user.salt)