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 ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ script: "bundle exec rake spec"
3
+ notifications:
4
+ email:
5
+ recipients:
6
+ jmazzi@gmail.com
7
+ on_success: never
8
+ on_failure: always
9
+ rvm:
10
+ - 1.9.2
11
+ - 1.9.3
12
+ - jruby-19mode
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CryptKeeperProviders
2
2
 
3
- TODO: Write a gem description
3
+ Provides encryption classes for use with [crypt_keeper](https://github.com/jmazzi/crypt_keeper)
4
4
 
5
5
  ## Installation
6
6
 
@@ -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
- Base64::encode64(aes.update(value) + aes.final)
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
@@ -1,3 +1,3 @@
1
1
  module CryptKeeperProviders
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/aes_spec.rb CHANGED
@@ -28,7 +28,7 @@ module CryptKeeperProviders
28
28
 
29
29
  describe "#decrypt" do
30
30
  let(:decrypted) do
31
- subject.decrypt "duEAvLPakSVPRx2yGSmP8Q==\n"
31
+ subject.decrypt "MC4xODk0NzkyNjkzMTYyMjE4Mzp24QC8s9qRJU9HHbIZKY/x\n"
32
32
  end
33
33
 
34
34
  it "should decrypt the string" do
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.2
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: &12987180 !ruby/object:Gem::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: *12987180
24
+ version_requirements: *14606720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard
27
- requirement: &13000640 !ruby/object:Gem::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: *13000640
35
+ version_requirements: *14606100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: guard-rspec
38
- requirement: &12997240 !ruby/object:Gem::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: *12997240
46
+ version_requirements: *14605540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &12993640 !ruby/object:Gem::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: *12993640
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: 1171779919379127825
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: 1171779919379127825
102
+ hash: -3907968441542420392
102
103
  requirements: []
103
104
  rubyforge_project:
104
105
  rubygems_version: 1.8.11