Module: Huberry::Encryptor

Defined in:
lib/encryptor.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_algorithmObject

Returns the value of attribute default_algorithm.



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

def default_algorithm
  @default_algorithm
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')


31
32
33
# File 'lib/encryptor.rb', line 31

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')


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

def self.encrypt(options)
  crypt :encrypt, options
end