crypt_keeper_providers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +12 -0
- data/README.md +1 -1
- data/crypt_keeper_providers.gemspec +2 -0
- data/lib/crypt_keeper_providers/aes.rb +3 -1
- data/lib/crypt_keeper_providers/version.rb +1 -1
- data/spec/aes_spec.rb +1 -1
- metadata +12 -11
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -19,5 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_development_dependency 'guard', '~> 1.2.0'
|
20
20
|
gem.add_development_dependency 'guard-rspec', '~> 1.1.0'
|
21
21
|
gem.add_development_dependency 'rake', '~> 0.9.2.2'
|
22
|
+
gem.add_development_dependency 'jruby-openssl', '~> 0.7.7' if RUBY_PLATFORM == 'java'
|
23
|
+
|
22
24
|
|
23
25
|
end
|
@@ -23,7 +23,8 @@ module CryptKeeperProviders
|
|
23
23
|
value = value.to_s
|
24
24
|
aes.encrypt
|
25
25
|
aes.key = key
|
26
|
-
|
26
|
+
iv = rand.to_s
|
27
|
+
Base64::encode64("#{iv}:#{aes.update(value) + aes.final}")
|
27
28
|
end
|
28
29
|
|
29
30
|
# Public: Decrypt a string
|
@@ -31,6 +32,7 @@ module CryptKeeperProviders
|
|
31
32
|
# Returns a string
|
32
33
|
def decrypt(value)
|
33
34
|
value = Base64::decode64(value.to_s)
|
35
|
+
iv, value = value.split(':')
|
34
36
|
aes.decrypt
|
35
37
|
aes.key = key
|
36
38
|
aes.update(value) + aes.final
|
data/spec/aes_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crypt_keeper_providers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-07-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &14606720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.10.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14606720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard
|
27
|
-
requirement: &
|
27
|
+
requirement: &14606100 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.2.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *14606100
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard-rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &14605540 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.1.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *14605540
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &14605020 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 0.9.2.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *14605020
|
58
58
|
description: Encryption providers for crypt_keeper
|
59
59
|
email:
|
60
60
|
- jmazzi@gmail.com
|
@@ -64,6 +64,7 @@ extra_rdoc_files: []
|
|
64
64
|
files:
|
65
65
|
- .gitignore
|
66
66
|
- .rspec
|
67
|
+
- .travis.yml
|
67
68
|
- Gemfile
|
68
69
|
- Guardfile
|
69
70
|
- LICENSE
|
@@ -89,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
90
|
version: '0'
|
90
91
|
segments:
|
91
92
|
- 0
|
92
|
-
hash:
|
93
|
+
hash: -3907968441542420392
|
93
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
95
|
none: false
|
95
96
|
requirements:
|
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
99
|
version: '0'
|
99
100
|
segments:
|
100
101
|
- 0
|
101
|
-
hash:
|
102
|
+
hash: -3907968441542420392
|
102
103
|
requirements: []
|
103
104
|
rubyforge_project:
|
104
105
|
rubygems_version: 1.8.11
|