kyle 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kyle.rb +59 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e06b32823626d646d4d1dbf1e4a223fb5295313b
|
4
|
+
data.tar.gz: 03aeaafe886f69def5b29df24db35444d0cab3cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db7a7114b92027a800f5dd0098700f5371c0f088e004ddc7bd393432b0a02cc442b8af534e84dc2cf533ab5bbf9aab99c85356652bed37a033c434569dbb6ac
|
7
|
+
data.tar.gz: b3b289e2333fe728c87644bb8fe973ab0e4f068bf90126ea8da4e5c398a010d3bb83a74a2e1d51925ee02259c4f0762bee2d6d08d080b0cb1a9d2eb6bf79c7c8
|
data/lib/kyle.rb
CHANGED
@@ -169,19 +169,72 @@ class Kyle
|
|
169
169
|
puts "Finished #{failed ? "and Failed" : "successfully"}"
|
170
170
|
end
|
171
171
|
|
172
|
+
def self.getkey()
|
173
|
+
|
174
|
+
key = "a"
|
175
|
+
key2 = "b"
|
176
|
+
|
177
|
+
while (key != key2)
|
178
|
+
key = ask("Key:") { |q| q.echo = false }
|
179
|
+
key2 = ask("Key (again):") { |q| q.echo = false }
|
180
|
+
|
181
|
+
if (key != key2)
|
182
|
+
puts "Passes do not match!!"
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
return key
|
187
|
+
|
188
|
+
end
|
189
|
+
|
172
190
|
def self.run(args)
|
191
|
+
|
192
|
+
puts "Kyle - A password manager for paranoids. ( 0.0.2 )"
|
193
|
+
puts ""
|
194
|
+
|
173
195
|
if (args.size > 0 && args[0] == "test")
|
174
196
|
test_it()
|
197
|
+
elsif (args.size == 3 && args[0].to_s.downcase == "-b" && args[1] != nil && args[2] != nil)
|
198
|
+
|
199
|
+
# Batch MODE
|
200
|
+
# -b record_file favourite_animal_name
|
201
|
+
|
202
|
+
key = getkey()
|
203
|
+
|
204
|
+
text=File.open(args[1]).read
|
205
|
+
text.gsub!(/\r\n?/, "\n")
|
206
|
+
text.each_line do |line|
|
207
|
+
|
208
|
+
hostname, account, port = line.split(';')
|
209
|
+
|
210
|
+
port = port.gsub(/\n/,"")
|
211
|
+
|
212
|
+
vals = generate(hostname,account,port,key)
|
213
|
+
|
214
|
+
$animalnames.each.with_index(0) do |animal,i|
|
215
|
+
|
216
|
+
puts "#{hostname}:#{account}:#{port} = #{vals[i]}" if (animal.downcase == args[2].downcase)
|
217
|
+
|
218
|
+
end
|
219
|
+
|
220
|
+
|
221
|
+
end
|
222
|
+
|
175
223
|
else
|
176
224
|
hostname = ask("Hostname:")
|
177
225
|
account = ask("Account:")
|
178
226
|
port = ask("Port:")
|
179
|
-
key =
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
227
|
+
key = getkey()
|
228
|
+
|
229
|
+
if (args.size > 0 && args[0].to_s.downcase == "-r")
|
230
|
+
# Record given parameters to .kyle file at home
|
231
|
+
kyle_r_path = File.join(Dir.home,".kyle")
|
232
|
+
|
233
|
+
line_to_add = "#{hostname};#{account};#{port}"
|
234
|
+
|
235
|
+
File.open(kyle_r_path, 'a') do |file|
|
236
|
+
file.puts line_to_add
|
237
|
+
end
|
185
238
|
end
|
186
239
|
|
187
240
|
puts "Calculating..."
|