Module: Cryptatron

Defined in:
lib/cryptatron.rb,
lib/cryptatron/version.rb

Constant Summary collapse

VERSION =
'0.0.4'

Class Method Summary collapse

Class Method Details

.decrypt(body) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/cryptatron.rb', line 16

def self.decrypt(body)
	setup

	begin
		@cipher.decrypt(body)
	rescue
		nil
	end
end

.encrypt(body) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/cryptatron.rb', line 6

def self.encrypt(body)
	setup

	begin
		Base64.strict_encode64 @cipher.encrypt(body, binary: true)
	rescue
		nil
	end
end