class Authlogic::CryptoProviders::Sha512::V2
SHA-512 does not have any practical known attacks against it. However, there are better choices. We recommend transitioning to a more secure, adaptive hashing algorithm, like scrypt.
Attributes
Public Class Methods
Source
# File lib/authlogic/crypto_providers/sha512/v2.rb, line 22 def encrypt(*tokens) digest = tokens.flatten.join(join_token) stretches.times do digest = Digest::SHA512.digest(digest) end digest.unpack1("H*") end
Turns your raw password into a Sha512
hash.
Source
# File lib/authlogic/crypto_providers/sha512/v2.rb, line 32 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/sha512/v2.rb, line 16 def stretches @stretches ||= 20 end
The number of times to loop through the encryption.