Module: Cryptor::EncryptedAttribute

Defined in:
lib/cryptor/encrypted_attribute.rb

Overview

Support for the attr_encrypted encryptor API

Class Method Summary collapse

Class Method Details

.symmetric_cryptor(options) ⇒ Object



14
15
16
# File 'lib/cryptor/encrypted_attribute.rb', line 14

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

.symmetric_decrypt(options) ⇒ Object



10
11
12
# File 'lib/cryptor/encrypted_attribute.rb', line 10

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

.symmetric_encrypt(options) ⇒ Object



6
7
8
# File 'lib/cryptor/encrypted_attribute.rb', line 6

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