Sha256: c1391ec30c04a2e486a01c8a6494c2f2849fd5bebfc5268723c4164b07b4fc35

Contents?: true

Size: 708 Bytes

Versions: 2

Compression:

Stored size: 708 Bytes

Contents

module Authgasm
  # = 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.
  class Sha512CryptoProvider
    STRETCHES = 20
    def self.encrypt(pass)
      digest = pass
      STRETCHES.times { digest = Digest::SHA512.hexdigest(digest) }
      digest
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authgasm-0.10.2 lib/authgasm/sha512_crypto_provider.rb
authgasm-0.10.3 lib/authgasm/sha512_crypto_provider.rb