encryptor 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -0
- data/.gitignore +5 -0
- data/.travis.yml +19 -0
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -0
- data/README.md +168 -73
- data/Rakefile +5 -14
- data/certs/saghaulor.pem +21 -0
- data/encryptor.gemspec +41 -0
- data/lib/encryptor.rb +54 -19
- data/lib/encryptor/string.rb +3 -3
- data/lib/encryptor/version.rb +2 -2
- data/test/compatibility_test.rb +29 -25
- data/test/encryptor_string_test.rb +60 -0
- data/test/encryptor_test.rb +57 -65
- data/test/legacy_encryptor_string_test.rb +56 -0
- data/test/legacy_encryptor_test.rb +22 -63
- data/test/openssl_helper.rb +24 -4
- data/test/test_helper.rb +21 -12
- metadata +94 -39
- metadata.gz.sig +0 -0
data/test/openssl_helper.rb
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
-
require File.expand_path('../test_helper', __FILE__)
|
2
|
-
|
3
1
|
module OpenSSLHelper
|
4
|
-
|
5
|
-
|
2
|
+
# For test debugging
|
3
|
+
puts "OpenSSL Version: #{OpenSSL::OPENSSL_VERSION}"
|
4
|
+
|
5
|
+
algorithms = OpenSSL::Cipher.ciphers
|
6
|
+
|
7
|
+
case RUBY_PLATFORM.to_sym
|
8
|
+
when :java
|
9
|
+
security_class = java.lang.Class.for_name('javax.crypto.JceSecurity')
|
10
|
+
restricted_field = security_class.get_declared_field('isRestricted')
|
11
|
+
restricted_field.accessible = true
|
12
|
+
restricted_field.set(nil, false)
|
6
13
|
|
14
|
+
# if key length is less than 24 bytes:
|
15
|
+
# OpenSSL::Cipher::CipherError: key length too short
|
16
|
+
# if key length is 24 bytes or more:
|
17
|
+
# OpenSSL::Cipher::CipherError: DES key too long - should be 8 bytes: possibly you need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your JRE
|
18
|
+
algorithms -= %w(des-ede3 DES-EDE3)
|
19
|
+
else
|
20
|
+
algorithms &= %x(openssl list-cipher-commands).split
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
ALGORITHMS = algorithms.freeze
|
25
|
+
AUTHENTICATED_ENCRYPTION_ALGORITHMS = ['aes-128-gcm','aes-192-gcm','aes-256-gcm']
|
26
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,20 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-rcov'
|
3
|
+
require "codeclimate-test-reporter"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
6
|
+
SimpleCov::Formatter::HTMLFormatter,
|
7
|
+
SimpleCov::Formatter::RcovFormatter,
|
8
|
+
CodeClimate::TestReporter::Formatter
|
9
|
+
]
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
11
|
+
SimpleCov.start do
|
12
|
+
add_filter 'test'
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
CodeClimate::TestReporter.start
|
16
|
+
|
17
|
+
require 'minitest/autorun'
|
18
|
+
require 'minitest/unit'
|
16
19
|
require 'digest/sha2'
|
17
20
|
|
18
21
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
19
22
|
$:.unshift(File.dirname(__FILE__))
|
20
|
-
require 'encryptor'
|
23
|
+
require 'encryptor'
|
24
|
+
require 'openssl_helper'
|
25
|
+
|
26
|
+
require 'encryptor/string'
|
27
|
+
class StringWithEncryptor < String
|
28
|
+
include Encryptor::String
|
29
|
+
end
|
metadata
CHANGED
@@ -1,120 +1,175 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encryptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Sean Huber
|
9
8
|
- S. Brent Faulkner
|
10
9
|
- William Monk
|
10
|
+
- Stephen Aghaulor
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
|
-
cert_chain:
|
14
|
-
|
13
|
+
cert_chain:
|
14
|
+
- |
|
15
|
+
-----BEGIN CERTIFICATE-----
|
16
|
+
MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRIwEAYDVQQDDAlzYWdo
|
17
|
+
YXVsb3IxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
18
|
+
bTAeFw0xNjAxMTEyMjQyMDFaFw0xNzAxMTAyMjQyMDFaMEAxEjAQBgNVBAMMCXNh
|
19
|
+
Z2hhdWxvcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
|
20
|
+
Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx0xdQYk2GwCpQ1n/
|
21
|
+
n2mPVYHLYqU5TAn/82t5kbqBUWjbcj8tHAi41tJ19+fT/hH0dog8JHvho1zmOr71
|
22
|
+
ZIqreJQo60TqP6oE9a5HncUpjqbRp7tOmHo9E+mOW1yT4NiXqFf1YINExQKy2XND
|
23
|
+
WPQ+T50ZNUsGMfHFWB4NAymejRWXlOEY3bvKW0UHFeNmouP5he51TjoP8uCc9536
|
24
|
+
4AIWVP/zzzjwrFtC7av7nRw4Y+gX2bQjrkK2k2JS0ejiGzKBIEMJejcI2B+t79zT
|
25
|
+
kUQq9SFwp2BrKSIy+4kh4CiF20RT/Hfc1MbvTxSIl/bbIxCYEOhmtHExHi0CoCWs
|
26
|
+
YCGCXQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
|
27
|
+
SCpVzSBvYbO6B3oT3n3RCZmurG8wHgYDVR0RBBcwFYETc2FnaGF1bG9yQGdtYWls
|
28
|
+
LmNvbTAeBgNVHRIEFzAVgRNzYWdoYXVsb3JAZ21haWwuY29tMA0GCSqGSIb3DQEB
|
29
|
+
BQUAA4IBAQAeiGdC3e0WiZpm0cF/b7JC6hJYXC9Yv9VsRAWD9ROsLjFKwOhmonnc
|
30
|
+
+l/QrmoTjMakYXBCai/Ca3L+k5eRrKilgyITILsmmFxK8sqPJXUw2Jmwk/dAky6x
|
31
|
+
hHKVZAofT1OrOOPJ2USoZyhR/VI8epLaD5wUmkVDNqtZWviW+dtRa55aPYjRw5Pj
|
32
|
+
wuj9nybhZr+BbEbmZE//2nbfkM4hCuMtxxxilPrJ22aYNmeWU0wsPpDyhPYxOUgU
|
33
|
+
ZjeLmnSDiwL6doiP5IiwALH/dcHU67ck3NGf6XyqNwQrrmtPY0mv1WVVL4Uh+vYE
|
34
|
+
kHoFzE2no0BfBg78Re8fY69P5yES5ncC
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2016-01-12 00:00:00.000000000 Z
|
15
37
|
dependencies:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: minitest
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
16
52
|
- !ruby/object:Gem::Dependency
|
17
53
|
name: rake
|
18
54
|
requirement: !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
55
|
requirements:
|
21
|
-
- -
|
56
|
+
- - ">="
|
22
57
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0
|
58
|
+
version: '0'
|
24
59
|
type: :development
|
25
60
|
prerelease: false
|
26
61
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
62
|
requirements:
|
29
|
-
- -
|
63
|
+
- - ">="
|
30
64
|
- !ruby/object:Gem::Version
|
31
|
-
version: 0
|
65
|
+
version: '0'
|
32
66
|
- !ruby/object:Gem::Dependency
|
33
67
|
name: simplecov
|
34
68
|
requirement: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
69
|
requirements:
|
37
|
-
- -
|
70
|
+
- - ">="
|
38
71
|
- !ruby/object:Gem::Version
|
39
72
|
version: '0'
|
40
73
|
type: :development
|
41
74
|
prerelease: false
|
42
75
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
76
|
requirements:
|
45
|
-
- -
|
77
|
+
- - ">="
|
46
78
|
- !ruby/object:Gem::Version
|
47
79
|
version: '0'
|
48
80
|
- !ruby/object:Gem::Dependency
|
49
81
|
name: simplecov-rcov
|
50
82
|
requirement: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
83
|
requirements:
|
53
|
-
- -
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: codeclimate-test-reporter
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
54
99
|
- !ruby/object:Gem::Version
|
55
100
|
version: '0'
|
56
101
|
type: :development
|
57
102
|
prerelease: false
|
58
103
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
104
|
requirements:
|
61
|
-
- -
|
105
|
+
- - ">="
|
62
106
|
- !ruby/object:Gem::Version
|
63
107
|
version: '0'
|
64
108
|
description: A simple wrapper for the standard ruby OpenSSL library to encrypt and
|
65
109
|
decrypt strings
|
66
110
|
email:
|
67
|
-
- shuber
|
111
|
+
- sean@shuber.io
|
68
112
|
- sbfaulkner@gmail.com
|
69
113
|
- billy.monk@gmail.com
|
114
|
+
- saghaulor@gmail.com
|
70
115
|
executables: []
|
71
116
|
extensions: []
|
72
117
|
extra_rdoc_files: []
|
73
118
|
files:
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
119
|
+
- ".gitignore"
|
120
|
+
- ".travis.yml"
|
121
|
+
- CHANGELOG.md
|
122
|
+
- Gemfile
|
77
123
|
- MIT-LICENSE
|
78
|
-
- Rakefile
|
79
124
|
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- certs/saghaulor.pem
|
127
|
+
- encryptor.gemspec
|
128
|
+
- lib/encryptor.rb
|
129
|
+
- lib/encryptor/string.rb
|
130
|
+
- lib/encryptor/version.rb
|
80
131
|
- test/compatibility_test.rb
|
132
|
+
- test/encryptor_string_test.rb
|
81
133
|
- test/encryptor_test.rb
|
134
|
+
- test/legacy_encryptor_string_test.rb
|
82
135
|
- test/legacy_encryptor_test.rb
|
83
136
|
- test/openssl_helper.rb
|
84
137
|
- test/test_helper.rb
|
85
138
|
homepage: http://github.com/attr-encrypted/encryptor
|
86
|
-
licenses:
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata: {}
|
87
142
|
post_install_message:
|
88
|
-
rdoc_options:
|
143
|
+
rdoc_options:
|
144
|
+
- "--charset=UTF-8"
|
145
|
+
- "--inline-source"
|
146
|
+
- "--line-numbers"
|
147
|
+
- "--main"
|
148
|
+
- README.md
|
89
149
|
require_paths:
|
90
150
|
- lib
|
91
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
152
|
requirements:
|
94
|
-
- -
|
153
|
+
- - ">="
|
95
154
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
hash: -1331952118017536783
|
155
|
+
version: 2.0.0
|
100
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
157
|
requirements:
|
103
|
-
- -
|
158
|
+
- - ">="
|
104
159
|
- !ruby/object:Gem::Version
|
105
160
|
version: '0'
|
106
|
-
|
107
|
-
|
108
|
-
hash: -1331952118017536783
|
109
|
-
requirements: []
|
161
|
+
requirements:
|
162
|
+
- openssl, >= v1.0.1
|
110
163
|
rubyforge_project:
|
111
|
-
rubygems_version:
|
164
|
+
rubygems_version: 2.5.1
|
112
165
|
signing_key:
|
113
|
-
specification_version:
|
166
|
+
specification_version: 4
|
114
167
|
summary: A simple wrapper for the standard ruby OpenSSL library
|
115
168
|
test_files:
|
116
169
|
- test/compatibility_test.rb
|
170
|
+
- test/encryptor_string_test.rb
|
117
171
|
- test/encryptor_test.rb
|
172
|
+
- test/legacy_encryptor_string_test.rb
|
118
173
|
- test/legacy_encryptor_test.rb
|
119
174
|
- test/openssl_helper.rb
|
120
175
|
- test/test_helper.rb
|
metadata.gz.sig
ADDED
Binary file
|