Module: EncryptedAttributes::ClassMethods
- Defined in:
- lib/encryptedattributes.rb
Instance Method Summary collapse
-
#encrypted_attributes ⇒ Object
Class-level reader for the @@encrypted_attributes array.
-
#encrypted_attributes=(attributes) ⇒ Object
Class-level writer for the @@encrypted_attributes array.
-
#random_iv ⇒ Object
Generates a random IV for seeding a cipher.
-
#random_key ⇒ Object
Generates a random IV for seeding a cipher.
Instance Method Details
#encrypted_attributes ⇒ Object
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_iv ⇒ Object
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_key ⇒ Object
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 |