Sha256: 8caa500197a1270b470e354c91cffbca8060142b81082e9a14ceac31133b2440

Contents?: true

Size: 452 Bytes

Versions: 2

Compression:

Stored size: 452 Bytes

Contents

module Cryptor
  # Support for the attr_encrypted encryptor API
  module EncryptedAttribute
    module_function

    def symmetric_encrypt(options)
      symmetric_cryptor(options).encrypt(options[:value])
    end

    def symmetric_decrypt(options)
      symmetric_cryptor(options).decrypt(options[:value])
    end

    def symmetric_cryptor(options)
      Cryptor::SymmetricEncryption.new(options[:key], keyring: options[:keyring])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cryptor-1.1.1 lib/cryptor/encrypted_attribute.rb
cryptor-1.1.0 lib/cryptor/encrypted_attribute.rb