Class Authlogic::CryptoProviders::Sha512
In: lib/casserver/authenticators/authlogic_crypto_providers/sha512.rb
Parent: Object

Sha512

Uses the Sha512 hash algorithm to encrypt passwords.

Methods

encrypt   matches?   stretches  

Attributes

join_token  [RW] 
stretches  [W] 

Public Class methods

Turns your raw password into a Sha512 hash.

[Source]

    # File lib/casserver/authenticators/authlogic_crypto_providers/sha512.rb, line 37
37:         def encrypt(*tokens)
38:           digest = tokens.flatten.join(join_token)
39:           stretches.times { digest = Digest::SHA512.hexdigest(digest) }
40:           digest
41:         end

Does the crypted password match the tokens? Uses the same tokens that were used to encrypt.

[Source]

    # File lib/casserver/authenticators/authlogic_crypto_providers/sha512.rb, line 44
44:         def matches?(crypted, *tokens)
45:           encrypt(*tokens) == crypted
46:         end

The number of times to loop through the encryption. This is ten because that is what restful_authentication defaults to.

[Source]

    # File lib/casserver/authenticators/authlogic_crypto_providers/sha512.rb, line 31
31:         def stretches
32:           @stretches ||= 20
33:         end

[Validate]