class Authlogic::CryptoProviders::MD5
This class was made for the users transitioning from md5 based systems. I highly discourage using this crypto provider as it superbly inferior to your other options.
Please use any other provider offered by Authlogic.
Attributes
join_token[RW]
stretches[W]
Public Instance Methods
encrypt(*tokens)
click to toggle source
Turns your raw password into a MD5 hash.
# File lib/authlogic/crypto_providers/md5.rb, line 21 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times { digest = Digest::MD5.hexdigest(digest) } digest end
matches?(crypted, *tokens)
click to toggle source
Does the crypted password match the tokens? Uses the same tokens that were used to encrypt.
# File lib/authlogic/crypto_providers/md5.rb, line 28 def matches?(crypted, *tokens) encrypt(*tokens) == crypted end
stretches()
click to toggle source
The number of times to loop through the encryption.
# File lib/authlogic/crypto_providers/md5.rb, line 15 def stretches @stretches ||= 1 end