Module: SimpleRecord::Encryptor
- Defined in:
- lib/simple_record/encryptor.rb
Class Attribute Summary collapse
-
.default_options ⇒ Object
Returns the value of attribute default_options.
Class Method Summary collapse
-
.decrypt(options) ⇒ Object
Decrypts a
:value
with a specified:key
. -
.encrypt(options) ⇒ Object
Encrypts a
:value
with a specified:key
.
Class Attribute Details
.default_options ⇒ Object
Returns the value of attribute default_options.
11 12 13 |
# File 'lib/simple_record/encryptor.rb', line 11 def @default_options end |
Class Method Details
.decrypt(options) ⇒ Object
Decrypts a :value
with a specified :key
Optionally accepts :iv
and :algorithm
options
Example
decrypted_value = Huberry::Encryptor.decrypt(:value => 'some encrypted string', :key => 'some secret key')
32 33 34 |
# File 'lib/simple_record/encryptor.rb', line 32 def self.decrypt() crypt :decrypt, end |
.encrypt(options) ⇒ Object
Encrypts a :value
with a specified :key
Optionally accepts :iv
and :algorithm
options
Example
encrypted_value = Huberry::Encryptor.encrypt(:value => 'some string to encrypt', :key => 'some secret key')
21 22 23 |
# File 'lib/simple_record/encryptor.rb', line 21 def self.encrypt() crypt :encrypt, end |