ubiq-security 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/ubiq/algo.rb +17 -0
- data/lib/ubiq/decrypt.rb +2 -1
- data/lib/ubiq/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f6376d379fdebaeda8a17d77949217fe2990b01fc31a2cff938abd7297d404
|
4
|
+
data.tar.gz: 5a1847bccf50187573ba326848ef713e651ca8b2fa8da2b3430370a2d75e32e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8676c73c34928dba6bab74ea0f4d58441a43dc1212f2393e19f8ea7a8643eb1ad6067f0caef9f50df0fc676f57dbe5b462f9bece298f109023776757265d9a61
|
7
|
+
data.tar.gz: b0b7f399ba98b63f814d5e8efb15361111026146d3e5e521d2d2db663c0f8acecdce082701599c30675c137a9d58570bbd87a7b45d2100a224d238d7319533e1
|
data/README.md
CHANGED
@@ -31,8 +31,11 @@ To build and install directly from a clone of the gitlab repository source:
|
|
31
31
|
```sh
|
32
32
|
git clone https://gitlab.com/ubiqsecurity/ubiq-ruby.git
|
33
33
|
cd ubiq-ruby
|
34
|
-
|
34
|
+
bundle install
|
35
|
+
gem build ubiq-security.gemspec
|
36
|
+
gem install ./ubiq-security*.gem
|
35
37
|
```
|
38
|
+
You may need to run the `gem install` commands above using sudo.
|
36
39
|
|
37
40
|
|
38
41
|
## Usage
|
data/lib/ubiq/algo.rb
CHANGED
@@ -33,10 +33,27 @@ module Ubiq
|
|
33
33
|
key_length: 32,
|
34
34
|
iv_length: 12,
|
35
35
|
tag_length: 16
|
36
|
+
},
|
37
|
+
'aes-128-gcm' => {
|
38
|
+
id: 1,
|
39
|
+
algorithm: OpenSSL::Cipher::AES128,
|
40
|
+
mode: OpenSSL::Cipher::AES128.new(:GCM),
|
41
|
+
key_length: 16,
|
42
|
+
iv_length: 12,
|
43
|
+
tag_length: 16
|
36
44
|
}
|
37
45
|
}
|
38
46
|
end
|
39
47
|
|
48
|
+
def find_alg(id)
|
49
|
+
set_algo.each do |k,v|
|
50
|
+
if v[:id] == id
|
51
|
+
return k
|
52
|
+
end
|
53
|
+
end
|
54
|
+
"unknown"
|
55
|
+
end
|
56
|
+
|
40
57
|
def get_algo(name)
|
41
58
|
set_algo[name]
|
42
59
|
end
|
data/lib/ubiq/decrypt.rb
CHANGED
@@ -165,7 +165,8 @@ module Ubiq
|
|
165
165
|
@key['client_id'] = client_id
|
166
166
|
@key['session'] = response['encryption_session']
|
167
167
|
|
168
|
-
|
168
|
+
# Get the algorithm name from the internal algorithm id in the header
|
169
|
+
@key['algorithm'] = Algo.new.find_alg(algorithm_id)
|
169
170
|
|
170
171
|
encrypted_private_key = response['encrypted_private_key']
|
171
172
|
# Decrypt the encryped private key using SRSA
|
data/lib/ubiq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ubiq-security
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ubiq Security, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-readline
|