class Authlogic::CryptoProviders::Sha1
A poor choice. There are known attacks against this algorithm.
Attributes
Public Class Methods
Source
# File lib/authlogic/crypto_providers/sha1.rb, line 25 def encrypt(*tokens) tokens = tokens.flatten digest = tokens.shift stretches.times do digest = Digest::SHA1.hexdigest([digest, *tokens].join(join_token)) end digest end
Turns your raw password into a Sha1
hash.
Source
# File lib/authlogic/crypto_providers/sha1.rb, line 13 def join_token @join_token ||= "--" end
Source
# File lib/authlogic/crypto_providers/sha1.rb, line 36 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/sha1.rb, line 19 def stretches @stretches ||= 10 end
The number of times to loop through the encryption.