Class: Encrypter

Inherits:
Object show all
Defined in:
lib/commonthread/encrypter.rb

Class Method Summary collapse

Class Method Details

.decrypt(input) ⇒ Object



9
10
11
12
# File 'lib/commonthread/encrypter.rb', line 9

def self.decrypt(input)
  return nil unless input.is_a?(String)
  self.blowfish.decrypt_string(Base64.decode64(input))
end

.encrypt(input) ⇒ Object



4
5
6
7
# File 'lib/commonthread/encrypter.rb', line 4

def self.encrypt(input)
  return nil unless input.is_a?(String)
  Base64.encode64(self.blowfish.encrypt_string(input))
end

.saltObject



14
15
16
# File 'lib/commonthread/encrypter.rb', line 14

def self.salt
  @@salt || 'common-salt'
end

.salt=(value) ⇒ Object



18
19
20
# File 'lib/commonthread/encrypter.rb', line 18

def self.salt=(value)
  @@salt = value
end