Module: SimpleRecord::Encryptor

Defined in:
lib/simple_record/encryptor.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_optionsObject

Returns the value of attribute default_options.



11
12
13
# File 'lib/simple_record/encryptor.rb', line 11

def default_options
  @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(options)
  crypt :decrypt, options
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(options)
  crypt :encrypt, options
end