Parent

Class/Module Index [+]

Quicksearch

Authlogic::CryptoProviders::Sha256

Sha256

Uses the Sha256 hash algorithm to encrypt passwords.

Attributes

join_token[RW]
stretches[W]

Public Class Methods

encrypt(*tokens) click to toggle source

Turns your raw password into a Sha256 hash.

# File lib/authlogic/crypto_providers/sha256.rb, line 37
def encrypt(*tokens)
  digest = tokens.flatten.join(join_token)
  stretches.times { digest = Digest::SHA256.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/sha256.rb, line 44
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/sha256.rb, line 31
def stretches
  @stretches ||= 20
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.