Class: Authgasm::Sha512CryptoProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/authgasm/sha512_crypto_provider.rb

Overview

Sha512 Crypto Provider

The acts_as_authentic method allows you to pass a :crypto_provider option. This allows you to use any type of encryption you like. Just create a class with a class level encrypt and decrypt method. The password will be passed as the single parameter to each of these methods so you can do your magic.

If you are encrypting via a hash just don’t include a decrypt method, since hashes can’t be decrypted. Authgasm will notice this adjust accordingly.

Constant Summary collapse

STRETCHES =
20

Class Method Summary collapse

Class Method Details

.encrypt(pass) ⇒ Object



10
11
12
13
14
# File 'lib/authgasm/sha512_crypto_provider.rb', line 10

def self.encrypt(pass)
  digest = pass
  STRETCHES.times { digest = Digest::SHA512.hexdigest(digest) }
  digest
end