cryptatron 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{crypt-a-tron.gemspec → cryptatron.gemspec} +0 -0
- data/lib/cryptatron.rb +10 -2
- data/lib/cryptatron/version.rb +1 -1
- metadata +2 -2
File without changes
|
data/lib/cryptatron.rb
CHANGED
@@ -8,10 +8,18 @@ module Cryptatron
|
|
8
8
|
@cipher = Gibberish::AES.new(@key, @key.length)
|
9
9
|
|
10
10
|
def self.encrypt(body)
|
11
|
-
|
11
|
+
begin
|
12
|
+
Base64.strict_encode64 @cipher.encrypt(body, binary: true)
|
13
|
+
rescue
|
14
|
+
nil
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
def self.decrypt(body)
|
15
|
-
|
19
|
+
begin
|
20
|
+
@cipher.decrypt(body)
|
21
|
+
rescue
|
22
|
+
nil
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/cryptatron/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- .gitignore
|
54
54
|
- Gemfile
|
55
55
|
- Rakefile
|
56
|
-
-
|
56
|
+
- cryptatron.gemspec
|
57
57
|
- lib/cryptatron.rb
|
58
58
|
- lib/cryptatron/version.rb
|
59
59
|
homepage:
|