Class: Crypto::Encryptor

Inherits:
Object
  • Object
show all
Defined in:
lib/crypto/encryptor.rb

Class Method Summary collapse

Class Method Details

.decrypt(options, secret = Crypto.secret_key_base.to_s) ⇒ Object



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

def self.decrypt(options, secret=Crypto.secret_key_base.to_s)
  return options[:value] if options[:value].blank?

  Crypto::Commons.decrypt(options[:value], secret)
end

.encrypt(options, secret = Crypto.secret_key_base.to_s) ⇒ Object



3
4
5
6
7
# File 'lib/crypto/encryptor.rb', line 3

def self.encrypt(options, secret=Crypto.secret_key_base.to_s)
  return options[:value] if options[:value].blank?

  Crypto::Commons.encrypt(options[:value], secret)
end