easy-crypto 0.1.7 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +31 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +19 -18
- data/README.md +1 -1
- data/easy-crypto.gemspec +1 -3
- data/lib/easycrypto/key.rb +5 -5
- data/lib/easycrypto/version.rb +1 -1
- data/repo-info.json +7 -0
- data/spec/easycrypto/key_spec.rb +7 -0
- metadata +7 -26
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32927f958e449242beee9d34653cfca538a61dfd1a7ab50c100144937377b420
|
4
|
+
data.tar.gz: 1088bc0207174f7b69cbc2e19125744a27e7ad0a7d603cd9cac6faa8267039b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6b11db29f050998cd316ca0669819958cc5d78b21efd037a93b8f8858cb9eec652a3e7b1e8070ecdfe74e65728eae240216abe776d7ef16bf6071f0c8e03afa
|
7
|
+
data.tar.gz: 359e29a491171b1f5c1ae2c1c21651da73d4e96bf039f26eb7f20167ee6733c399ec5a62f6716bdede961990411a8c625e0a797544f0ebaacb64fc9a435448a2
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby-versions: ['2.6', '2.7', '3.0', 'jruby']
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby-versions }}
|
17
|
+
- name: Install dependencies
|
18
|
+
run: bundle install
|
19
|
+
- name: Run tests
|
20
|
+
run: bundle exec rake
|
21
|
+
- name: Deploy
|
22
|
+
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.ruby-versions == '3.0'
|
23
|
+
run: |
|
24
|
+
mkdir -p $HOME/.gem
|
25
|
+
touch $HOME/.gem/credentials
|
26
|
+
chmod 0600 $HOME/.gem/credentials
|
27
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
|
+
gem build *.gemspec
|
29
|
+
gem push *.gem
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,39 +1,40 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
easy-crypto (0.
|
5
|
-
openssl (~> 2.1.1, >= 2.1.1)
|
4
|
+
easy-crypto (0.2.4)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
9
8
|
specs:
|
10
9
|
diff-lcs (1.3)
|
11
|
-
|
10
|
+
jruby-openssl (0.10.2-java)
|
12
11
|
openssl (2.1.2)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
rspec-
|
17
|
-
rspec-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
rspec-expectations (3.8.2)
|
12
|
+
rake (12.3.3)
|
13
|
+
rspec (3.9.0)
|
14
|
+
rspec-core (~> 3.9.0)
|
15
|
+
rspec-expectations (~> 3.9.0)
|
16
|
+
rspec-mocks (~> 3.9.0)
|
17
|
+
rspec-core (3.9.1)
|
18
|
+
rspec-support (~> 3.9.1)
|
19
|
+
rspec-expectations (3.9.0)
|
22
20
|
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
-
rspec-support (~> 3.
|
24
|
-
rspec-mocks (3.
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-mocks (3.9.1)
|
25
23
|
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.
|
27
|
-
rspec-support (3.
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-support (3.9.2)
|
28
26
|
|
29
27
|
PLATFORMS
|
28
|
+
java
|
30
29
|
ruby
|
31
30
|
|
32
31
|
DEPENDENCIES
|
33
|
-
bundler (~>
|
32
|
+
bundler (~> 2.2.23)
|
34
33
|
easy-crypto!
|
34
|
+
jruby-openssl (~> 0.9)
|
35
|
+
openssl (~> 2.1.2)
|
35
36
|
rake (~> 12.3)
|
36
37
|
rspec (~> 3.0)
|
37
38
|
|
38
39
|
BUNDLED WITH
|
39
|
-
|
40
|
+
2.2.23
|
data/README.md
CHANGED
data/easy-crypto.gemspec
CHANGED
@@ -15,9 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
|
-
spec.add_development_dependency 'bundler', '~>
|
18
|
+
spec.add_development_dependency 'bundler', '~> 2.2.23'
|
19
19
|
spec.add_development_dependency 'rake', '~> 12.3'
|
20
20
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
21
|
-
|
22
|
-
spec.add_runtime_dependency 'openssl', '~> 2.1.1', '>= 2.1.1'
|
23
21
|
end
|
data/lib/easycrypto/key.rb
CHANGED
@@ -22,12 +22,12 @@ module EasyCrypto
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.generate_with_salt(password, salt)
|
25
|
-
key = OpenSSL::
|
25
|
+
key = OpenSSL::PKCS5.pbkdf2_hmac(
|
26
26
|
password,
|
27
|
-
salt
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
salt,
|
28
|
+
Key::ITERATION_COUNT,
|
29
|
+
Key::KEY_LENGTH,
|
30
|
+
Key::HASH_ALGO
|
31
31
|
)
|
32
32
|
|
33
33
|
new(key, salt)
|
data/lib/easycrypto/version.rb
CHANGED
data/repo-info.json
ADDED
data/spec/easycrypto/key_spec.rb
CHANGED
@@ -24,6 +24,13 @@ RSpec.describe EasyCrypto::Key do
|
|
24
24
|
expect(key.salt).to eq salt
|
25
25
|
end
|
26
26
|
|
27
|
+
it 'generates the expected key' do
|
28
|
+
key = EasyCrypto::Key.generate_with_salt('key password', salt)
|
29
|
+
|
30
|
+
expected_key = "\xC7\xE4\x89\xCB5\x86\xE0)Q)[u\xD6P\x87i\xC6\x13\xBE\xFE|\x19\x8A\xDB\xFB0\xB4\xE50\x12\x00\x95".force_encoding('ASCII-8BIT')
|
31
|
+
expect(key.key).to eq expected_key
|
32
|
+
end
|
33
|
+
|
27
34
|
it 'generates the same key with the same password and salt' do
|
28
35
|
key_1 = EasyCrypto::Key.generate_with_salt('key password', salt)
|
29
36
|
key_2 = EasyCrypto::Key.generate_with_salt('key password', salt)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-crypto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emarsys Security
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.23
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.23
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,26 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: openssl
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.1.1
|
62
|
-
- - "~>"
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 2.1.1
|
65
|
-
type: :runtime
|
66
|
-
prerelease: false
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - ">="
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: 2.1.1
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 2.1.1
|
75
55
|
description:
|
76
56
|
email:
|
77
57
|
- security@emarsys.com
|
@@ -79,8 +59,8 @@ executables: []
|
|
79
59
|
extensions: []
|
80
60
|
extra_rdoc_files: []
|
81
61
|
files:
|
62
|
+
- ".github/workflows/ruby.yml"
|
82
63
|
- ".gitignore"
|
83
|
-
- ".travis.yml"
|
84
64
|
- Gemfile
|
85
65
|
- Gemfile.lock
|
86
66
|
- LICENSE.txt
|
@@ -91,6 +71,7 @@ files:
|
|
91
71
|
- lib/easycrypto/crypto.rb
|
92
72
|
- lib/easycrypto/key.rb
|
93
73
|
- lib/easycrypto/version.rb
|
74
|
+
- repo-info.json
|
94
75
|
- spec/easycrypto/crypto_spec.rb
|
95
76
|
- spec/easycrypto/key_spec.rb
|
96
77
|
- spec/spec_helper.rb
|
@@ -113,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
94
|
- !ruby/object:Gem::Version
|
114
95
|
version: '0'
|
115
96
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
97
|
+
rubygems_version: 3.2.22
|
117
98
|
signing_key:
|
118
99
|
specification_version: 4
|
119
100
|
summary: Provides simple wrappers around openssl crypto implementation.
|
data/.travis.yml
DELETED