Turns your raw password into a Sha512 hash.
# File lib/authlogic/crypto_providers/sha512.rb, line 37 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times { digest = Digest::SHA512.hexdigest(digest) } digest end
Does the crypted password match the tokens? Uses the same tokens that were used to encrypt.
# File lib/authlogic/crypto_providers/sha512.rb, line 44 def matches?(crypted, *tokens) encrypt(*tokens) == crypted end
The number of times to loop through the encryption. This is ten because that is what restful_authentication defaults to.
# File lib/authlogic/crypto_providers/sha512.rb, line 31 def stretches @stretches ||= 20 end