class Authlogic::CryptoProviders::MD5
A poor choice. There are known attacks against this algorithm.
Attributes
join_token[RW]
stretches[W]
Public Class Methods
encrypt(*tokens)
click to toggle source
Turns your raw password into a MD5
hash.
# File lib/authlogic/crypto_providers/md5.rb, line 22 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 30 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 16 def stretches @stretches ||= 1 end