uhide 0.0.25 โ 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uhide/main.rb +15 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a06d744fe8a6c1f74e8fd848e74af96ba37d5c377ee3d6b33599f0d38d30c1
|
4
|
+
data.tar.gz: 94cf1b71fbe3255fa896e25a53fd474e0bdb0e69677a6ef644944972cc452f0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d6f4416ab7af95df3e132b6651408be6d684847fc2b3740d44e89f28ca717959af688c8043c33782e4fe2dc2142d41121da0bd7f05bb93da47d8bf396fad2da
|
7
|
+
data.tar.gz: fb0c709b806ce2cef94508141e21dd062c845db86886657ea63e7a4572431bc962126c7d4f3873ec76cf677d594c28930b49dcaa41697e1362ed4ba99bac8d19
|
data/lib/uhide/main.rb
CHANGED
@@ -4,7 +4,7 @@ $๐ง = -> { ๐๏ธ '๐ง', SecureRandom.random_bytes }
|
|
4
4
|
$๐ = -> { ๐๏ธ '๐', ActiveSupport::MessageEncryptor.key_len }
|
5
5
|
INVALID_KEY = 'invalid key'.colorize(:magenta)
|
6
6
|
UNSUPPORTED_๐พ = 'unsupported'.colorize(:magenta) + ' ๐พ'
|
7
|
-
|
7
|
+
$๐๏ธ = {}
|
8
8
|
|
9
9
|
def ๐ฝ
|
10
10
|
print "\r"
|
@@ -17,32 +17,32 @@ end
|
|
17
17
|
|
18
18
|
def โ ๐, simple: true
|
19
19
|
print ๐
|
20
|
-
|
21
|
-
|
20
|
+
โ๏ธ = ๐งผ STDIN.noecho(&:gets)
|
21
|
+
$โ๏ธ = โ๏ธ if simple
|
22
22
|
๐ฝ
|
23
|
-
return
|
23
|
+
return โ๏ธ
|
24
24
|
end
|
25
25
|
|
26
26
|
def ๐ ๐ท๏ธ: nil
|
27
27
|
if ๐ท๏ธ.nil?
|
28
|
-
puts
|
28
|
+
puts $๐๏ธ['ddllv']
|
29
29
|
else
|
30
|
-
puts
|
30
|
+
puts $๐๏ธ['ddllv'][๐ท๏ธ]
|
31
31
|
end
|
32
32
|
|
33
33
|
๐ = File.read './๐ง'
|
34
34
|
if ๐.empty?
|
35
35
|
๐ = SecureRandom.random_bytes $๐.call
|
36
36
|
File.write './๐ง', Marshal.dump(๐)
|
37
|
-
return
|
37
|
+
return $๐๏ธ['๐ง'] = ๐
|
38
38
|
else
|
39
|
-
return
|
39
|
+
return $๐๏ธ['๐ง'] = Marshal.load(File.read './๐ง')
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def ๐ ๐ท๏ธ, ๐
|
45
|
-
|
45
|
+
$๐๏ธ['ddllv'][๐ท๏ธ] = ๐
|
46
46
|
๐พ
|
47
47
|
end
|
48
48
|
|
@@ -68,7 +68,7 @@ def ๐ค ๐ฃ๏ธ
|
|
68
68
|
exit!
|
69
69
|
|
70
70
|
when :reset
|
71
|
-
if โ($๐, simple: false) ==
|
71
|
+
if โ($๐, simple: false) == $โ๏ธ
|
72
72
|
['ddllv', '๐ง', '๐'].each_entry{ |item| File.delete "./#{item}" }
|
73
73
|
exit!
|
74
74
|
else
|
@@ -83,10 +83,10 @@ end
|
|
83
83
|
|
84
84
|
def ๐พ
|
85
85
|
โ๏ธ = ActiveSupport::MessageEncryptor.new(
|
86
|
-
ActiveSupport::KeyGenerator.new(
|
86
|
+
ActiveSupport::KeyGenerator.new($โ๏ธ).generate_key($๐ง.call, $๐.call)
|
87
87
|
)
|
88
88
|
|
89
|
-
was_bootstrapped = !(not
|
89
|
+
was_bootstrapped = !(not $๐๏ธ['ddllv'])
|
90
90
|
๐ = ๐๏ธ 'ddllv', {}, โ๏ธ: โ๏ธ
|
91
91
|
๐ 'ddllv', ๐, โ๏ธ: โ๏ธ if was_bootstrapped
|
92
92
|
end
|
@@ -104,8 +104,8 @@ def ๐ ๐๏ธ, ๐, โ๏ธ: false
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def ๐๏ธ ๐๏ธ, ๐, โ๏ธ: false
|
107
|
-
if
|
108
|
-
return
|
107
|
+
if $๐๏ธ[๐๏ธ]
|
108
|
+
return $๐๏ธ[๐๏ธ]
|
109
109
|
end
|
110
110
|
|
111
111
|
begin
|
@@ -131,7 +131,7 @@ def ๐๏ธ ๐๏ธ, ๐, โ๏ธ: false
|
|
131
131
|
|
132
132
|
end
|
133
133
|
|
134
|
-
return
|
134
|
+
return $๐๏ธ[๐๏ธ] = ๐
|
135
135
|
end
|
136
136
|
|
137
137
|
class Uhide::Main
|