Module: EncryptedAttributes::ClassMethods

Defined in:
lib/encryptedattributes.rb

Instance Method Summary collapse

Instance Method Details

#encrypted_attributesObject

Class-level reader for the @@encrypted_attributes array



25
26
27
# File 'lib/encryptedattributes.rb', line 25

def encrypted_attributes
  @encrypted_attributes
end

#encrypted_attributes=(attributes) ⇒ Object

Class-level writer for the @@encrypted_attributes array



20
21
22
# File 'lib/encryptedattributes.rb', line 20

def encrypted_attributes=(attributes)
  @encrypted_attributes = attributes
end

#random_ivObject

Generates a random IV for seeding a cipher



30
31
32
# File 'lib/encryptedattributes.rb', line 30

def random_iv
  OpenSSL::Cipher::Cipher.new('aes-256-cbc').random_iv
end

#random_keyObject

Generates a random IV for seeding a cipher



35
36
37
# File 'lib/encryptedattributes.rb', line 35

def random_key
  OpenSSL::Cipher::Cipher.new('aes-256-cbc').random_key
end