Module Authlogic::CryptoProviders
In: lib/authlogic/crypto_providers/scrypt.rb
lib/authlogic/crypto_providers/sha1.rb
lib/authlogic/crypto_providers/bcrypt.rb
lib/authlogic/crypto_providers/wordpress.rb
lib/authlogic/crypto_providers/md5.rb
lib/authlogic/crypto_providers/sha512.rb
lib/authlogic/crypto_providers/aes256.rb
lib/authlogic/crypto_providers/sha256.rb

The acts_as_authentic method has 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 matches? method. See example below.

Example

  class MyAwesomeEncryptionMethod
    def self.encrypt(*tokens)
      # the tokens passed will be an array of objects, what type of object is irrelevant,
      # just do what you need to do with them and return a single encrypted string.
      # for example, you will most likely join all of the objects into a single string and then encrypt that string
    end

    def self.matches?(crypted, *tokens)
      # return true if the crypted string matches the tokens.
      # depending on your algorithm you might decrypt the string then compare it to the token, or you might
      # encrypt the tokens and make sure it matches the crypted string, its up to you
    end
  end

Classes and Modules

Class Authlogic::CryptoProviders::AES256
Class Authlogic::CryptoProviders::BCrypt
Class Authlogic::CryptoProviders::MD5
Class Authlogic::CryptoProviders::SCrypt
Class Authlogic::CryptoProviders::Sha1
Class Authlogic::CryptoProviders::Sha256
Class Authlogic::CryptoProviders::Sha512
Class Authlogic::CryptoProviders::Wordpress

[Validate]