Sha256: 887cef9cc9e22b12b9c916668e896f895b73aee31e49951f131ffc4ec2875d25

Contents?: true

Size: 347 Bytes

Versions: 2

Compression:

Stored size: 347 Bytes

Contents

require "ezcrypto"

class AES128CryptoProvider
  class << self
    def encrypt(*tokens)
      [key.encrypt(tokens.join)].pack("m").chomp
    end
    
    def matches?(crypted, *tokens)
      key.decrypt(crypted.unpack("m").first) == tokens.join
    end
    
    def key
      EzCrypto::Key.with_password "master_key", "some_salt"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authlogic-1.3.3 test/libs/aes128_crypto_provider.rb
authlogic-1.3.4 test/libs/aes128_crypto_provider.rb