class Authlogic::CryptoProviders::MD5::V2
A poor choice. There are known attacks against this algorithm.
Attributes
Public Class Methods
Source
# File lib/authlogic/crypto_providers/md5/v2.rb, line 20 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times { digest = Digest::MD5.digest(digest) } digest.unpack1("H*") end
Turns your raw password into a MD5
hash.
Source
# File lib/authlogic/crypto_providers/md5/v2.rb, line 28 def matches?(crypted, *tokens) encrypt(*tokens) == crypted end
Does the crypted password match the tokens? Uses the same tokens that were used to encrypt.
Source
# File lib/authlogic/crypto_providers/md5/v2.rb, line 14 def stretches @stretches ||= 1 end
The number of times to loop through the encryption.