uhide 0.0.27 โ 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/uhide +4 -7
- data/lib/uhide/main.rb +130 -131
- 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: f7f3ee7fda8dbc6a3ca90ee120923bb673dc5493160131c608ca702477203696
|
4
|
+
data.tar.gz: 4f2a913910762961b403c30bd0269b17ba268d271ed7c761b99a31d2105e06e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7725eb64648d0b934b3bcb4717e26ed625854f1058b91797c0e89ef8d53b3f31ab3891ecd518c7a2427837b33f7bb62f5d8c3ec165b06cfa00ca305c7a124881
|
7
|
+
data.tar.gz: d70451a07ab063b9a83f862de8cc8fedaef80ffec4968a230d5a6cdbf748d73c1df9e83623590e47c82a591588443ce00b40f4f44c38f35aebc06e85b98ebdd4
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
๐
ฟ๏ธ๐๐ผeยฎ๏ธed ๐
ฑ๏ธ๐พ eโ๏ธ๐ค๐ฏโน๏ธ tec๐จn๐๐ฑ๐
พ๏ธg๐พ
|
4
4
|
|
5
|
-
|
5
|
+
Securely store passwords, phone numbers, email addresses, credit card numbers -- any sensitive text.
|
6
6
|
|
7
7
|
**Install:** `gem install uhide`
|
8
8
|
|
data/bin/uhide
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'optparse'
|
2
2
|
require 'uhide'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
opts.banner = "Usage: uhide command [key-name] [key-value]"
|
7
|
-
|
8
|
-
opts.on("-h", "--help", "Help") do |v|
|
4
|
+
OptionParser.new do |๐|
|
5
|
+
๐.on('-h', '--help', 'Help') do |๐|
|
9
6
|
puts <<-HELP
|
10
7
|
Usage: uhide command [key-name] [key-value]
|
11
8
|
Example: uhide set gmail mysecurepassword123
|
@@ -14,7 +11,7 @@ Example: uhide get gmail
|
|
14
11
|
Get Started:
|
15
12
|
|
16
13
|
1. run `uhide`
|
17
|
-
2. You will
|
14
|
+
2. You will see: ๐ > . Choose a password you can remember and enter it.
|
18
15
|
3. You can now run commands. Next time you run `uhide` from this directory, enter the same password to manage your sensitive information.
|
19
16
|
|
20
17
|
Commands and Optional Arguments:
|
@@ -26,4 +23,4 @@ Commands and Optional Arguments:
|
|
26
23
|
|
27
24
|
end.parse!
|
28
25
|
|
29
|
-
Uhide::Main
|
26
|
+
Uhide::Main.โ๏ธ
|
data/lib/uhide/main.rb
CHANGED
@@ -1,151 +1,151 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
$โผ๏ธ๐ = 'invalid key'.colorize(:magenta)
|
2
|
+
$โผ๏ธ๐พ = 'unsupported'.colorize(:magenta) + ' ๐พ'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
$๐๏ธ = {}
|
9
|
-
|
10
|
-
def ๐ฝ
|
11
|
-
print "\r"
|
12
|
-
$stdout.flush
|
13
|
-
end
|
14
|
-
|
15
|
-
def ๐งผ ๐๏ธ
|
16
|
-
๐๏ธ.chomp
|
17
|
-
end
|
18
|
-
|
19
|
-
def โ ๐, simple: true
|
20
|
-
print ๐
|
21
|
-
โ๏ธ = ๐งผ STDIN.noecho(&:gets)
|
22
|
-
$โ๏ธ = โ๏ธ if simple
|
23
|
-
๐ฝ
|
24
|
-
return โ๏ธ
|
25
|
-
end
|
26
|
-
|
27
|
-
def ๐ ๐ท๏ธ: nil
|
28
|
-
if ๐ท๏ธ.nil?
|
29
|
-
puts $๐๏ธ['ddllv']
|
30
|
-
else
|
31
|
-
puts $๐๏ธ['ddllv'][๐ท๏ธ]
|
32
|
-
end
|
33
|
-
|
34
|
-
๐ = File.read './๐ง'
|
35
|
-
if ๐.empty?
|
36
|
-
๐ = SecureRandom.random_bytes $๐.call
|
37
|
-
File.write './๐ง', Marshal.dump(๐)
|
38
|
-
return $๐๏ธ['๐ง'] = ๐
|
39
|
-
else
|
40
|
-
return $๐๏ธ['๐ง'] = Marshal.load(File.read './๐ง')
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
def ๐ ๐ท๏ธ, ๐
|
46
|
-
$๐๏ธ['ddllv'][๐ท๏ธ] = ๐
|
47
|
-
๐พ
|
48
|
-
end
|
49
|
-
|
50
|
-
def ๐พ
|
51
|
-
โ๏ธ = ActiveSupport::MessageEncryptor.new(
|
52
|
-
ActiveSupport::KeyGenerator.new($โ๏ธ).generate_key($๐ง.call, $๐.call)
|
53
|
-
)
|
54
|
-
|
55
|
-
was_bootstrapped = !(not $๐๏ธ['ddllv'])
|
56
|
-
๐ = ๐๏ธ 'ddllv', {}, โ๏ธ: โ๏ธ
|
57
|
-
๐ 'ddllv', ๐, โ๏ธ: โ๏ธ if was_bootstrapped
|
58
|
-
end
|
59
|
-
|
60
|
-
def ๐ ๐๏ธ, ๐, โ๏ธ: false
|
61
|
-
if โ๏ธ
|
62
|
-
๐ = โ๏ธ.encrypt_and_sign ๐
|
63
|
-
else
|
64
|
-
๐ = ๐
|
65
|
-
end
|
66
|
-
|
67
|
-
๐ = Marshal.dump ๐
|
68
|
-
File.write "./#{๐๏ธ}", ๐
|
69
|
-
return ๐
|
70
|
-
end
|
71
|
-
|
72
|
-
def ๐๏ธ ๐๏ธ, ๐, โ๏ธ: false
|
73
|
-
if $๐๏ธ[๐๏ธ]
|
74
|
-
return $๐๏ธ[๐๏ธ]
|
75
|
-
end
|
76
|
-
|
77
|
-
begin
|
78
|
-
๐ = File.read "./#{๐๏ธ}"
|
79
|
-
rescue Errno::ENOENT
|
80
|
-
๐ = ๐ ๐๏ธ, ๐, โ๏ธ: โ๏ธ
|
81
|
-
end
|
4
|
+
class Uhide::Main
|
5
|
+
@@โ = " โ > "
|
6
|
+
@@๐ = " ๐ > "
|
7
|
+
@@๐๏ธ = {}
|
82
8
|
|
83
|
-
|
84
|
-
|
9
|
+
class << self
|
10
|
+
def ๐ง
|
11
|
+
๐๏ธ '๐ง', SecureRandom.random_bytes
|
12
|
+
end
|
85
13
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
14
|
+
def ๐
|
15
|
+
๐๏ธ '๐', ActiveSupport::MessageEncryptor.key_len
|
16
|
+
end
|
17
|
+
|
18
|
+
def ๐ฝ
|
19
|
+
print "\r"
|
20
|
+
$stdout.flush
|
21
|
+
end
|
22
|
+
|
23
|
+
def ๐งผ ๐๏ธ
|
24
|
+
๐๏ธ.chomp
|
25
|
+
end
|
26
|
+
|
27
|
+
def โ ๐, ๐: true
|
28
|
+
print ๐
|
29
|
+
โ๏ธ = ๐งผ STDIN.noecho(&:gets)
|
30
|
+
@@โ๏ธ = โ๏ธ if ๐
|
31
|
+
๐ฝ
|
32
|
+
return โ๏ธ
|
33
|
+
end
|
34
|
+
|
35
|
+
def ๐ ๐ท๏ธ: nil
|
36
|
+
if ๐ท๏ธ.nil?
|
37
|
+
puts @@๐๏ธ['ใฝ๏ธ']
|
38
|
+
else
|
39
|
+
puts @@๐๏ธ['ใฝ๏ธ'][๐ท๏ธ]
|
92
40
|
end
|
93
41
|
|
94
|
-
else
|
95
|
-
๐ = ๐
|
96
42
|
end
|
97
43
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
def ๐ค ๐ฃ๏ธ
|
104
|
-
๐พ, ๐ท๏ธ, ๐ = ๐ฃ๏ธ.split
|
105
|
-
|
106
|
-
if ๐พ.nil?
|
107
|
-
return
|
108
|
-
end
|
109
|
-
|
110
|
-
case ๐พ.to_sym
|
111
|
-
when :get
|
112
|
-
if ๐ท๏ธ
|
113
|
-
๐ ๐ท๏ธ: ๐ท๏ธ
|
114
|
-
else
|
115
|
-
๐
|
44
|
+
def ๐ ๐ท๏ธ, ๐
|
45
|
+
@@๐๏ธ['ใฝ๏ธ'][๐ท๏ธ] = ๐
|
46
|
+
๐พ
|
116
47
|
end
|
117
48
|
|
118
|
-
|
119
|
-
|
49
|
+
def ๐พ
|
50
|
+
โ๏ธ = ActiveSupport::MessageEncryptor.new(
|
51
|
+
ActiveSupport::KeyGenerator.new(@@โ๏ธ).generate_key(๐ง, ๐)
|
52
|
+
)
|
53
|
+
|
54
|
+
๐ฅพ = !(not @@๐๏ธ['ใฝ๏ธ'])
|
55
|
+
๐ = ๐๏ธ 'ใฝ๏ธ', {}, โ๏ธ: โ๏ธ
|
56
|
+
๐ 'ใฝ๏ธ', ๐, โ๏ธ: โ๏ธ if ๐ฅพ
|
57
|
+
end
|
120
58
|
|
121
|
-
|
122
|
-
|
59
|
+
def ๐ ๐๏ธ, ๐, โ๏ธ: false
|
60
|
+
if โ๏ธ
|
61
|
+
๐ = โ๏ธ.encrypt_and_sign ๐
|
62
|
+
else
|
63
|
+
๐ = ๐
|
64
|
+
end
|
65
|
+
|
66
|
+
๐ = Marshal.dump ๐
|
67
|
+
File.write "./#{๐๏ธ}", ๐
|
68
|
+
return ๐
|
69
|
+
end
|
123
70
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
71
|
+
def ๐๏ธ ๐๏ธ, ๐, โ๏ธ: false
|
72
|
+
if @@๐๏ธ[๐๏ธ]
|
73
|
+
return @@๐๏ธ[๐๏ธ]
|
74
|
+
end
|
75
|
+
|
76
|
+
begin
|
77
|
+
๐ = File.read "./#{๐๏ธ}"
|
78
|
+
rescue Errno::ENOENT
|
79
|
+
๐ = ๐ ๐๏ธ, ๐, โ๏ธ: โ๏ธ
|
80
|
+
end
|
81
|
+
|
82
|
+
if not ๐.empty?
|
83
|
+
๐ = Marshal.load ๐
|
84
|
+
|
85
|
+
if โ๏ธ
|
86
|
+
begin
|
87
|
+
๐ = โ๏ธ.decrypt_and_verify ๐
|
88
|
+
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
89
|
+
puts $โผ๏ธ๐
|
90
|
+
exit!
|
91
|
+
end
|
92
|
+
|
93
|
+
else
|
94
|
+
๐ = ๐
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
return @@๐๏ธ[๐๏ธ] = ๐
|
130
100
|
end
|
131
101
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
102
|
+
def ๐ค ๐ฃ๏ธ
|
103
|
+
๐พ, ๐ท๏ธ, ๐ = ๐ฃ๏ธ.split
|
104
|
+
|
105
|
+
if ๐พ.nil?
|
106
|
+
return
|
107
|
+
end
|
108
|
+
|
109
|
+
case ๐พ.to_sym
|
110
|
+
when :get
|
111
|
+
if ๐ท๏ธ
|
112
|
+
๐ ๐ท๏ธ: ๐ท๏ธ
|
113
|
+
else
|
114
|
+
๐
|
115
|
+
end
|
116
|
+
|
117
|
+
when :set
|
118
|
+
๐ ๐ท๏ธ, ๐
|
119
|
+
|
120
|
+
when :exit, :quit
|
121
|
+
exit!
|
122
|
+
|
123
|
+
when :help
|
124
|
+
puts "For help, quit and run `uhide -h` from your shell"
|
125
|
+
|
126
|
+
when :reset
|
127
|
+
if โ(@@๐, ๐: false) == @@โ๏ธ
|
128
|
+
['ใฝ๏ธ', '๐ง', '๐'].each_entry { | ๐ | File.delete "./#{๐}" }
|
129
|
+
exit!
|
130
|
+
else
|
131
|
+
puts $โผ๏ธ๐
|
132
|
+
end
|
133
|
+
|
134
|
+
else
|
135
|
+
puts $โผ๏ธ๐พ
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
def โ๏ธ
|
141
141
|
begin
|
142
|
-
โ
|
142
|
+
โ @@๐
|
143
143
|
|
144
144
|
๐พ
|
145
145
|
|
146
146
|
loop do
|
147
|
-
print
|
148
|
-
๐ค
|
147
|
+
print @@โ
|
148
|
+
๐ค ๐งผ gets
|
149
149
|
end
|
150
150
|
|
151
151
|
rescue SystemExit, Interrupt
|
@@ -158,4 +158,3 @@ class Uhide::Main
|
|
158
158
|
end
|
159
159
|
|
160
160
|
end
|
161
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uhide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Keen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|