diff --git a/myShit/betterDec.src b/myShit/betterDec.src
index 877908e..37ba226 100644
--- a/myShit/betterDec.src
+++ b/myShit/betterDec.src
@@ -6,17 +6,12 @@ myComputer = myShell.host_computer
crypto = include_lib("/lib/crypto.so")
if not crypto then exit("
There is no crypto.so in you /lib\n")
+g = get_custom_object
+
passFile = user_input("Path to encrypted file: \n")
fullString = myComputer.File(passFile).get_content
lines = fullString.split(char(10))
-
-/* TODO
- Fix logic to properly display name:pass combo
- I think I'm deciphering too late
- I think I should decipher first, then split
-*/
-
userNames = []
hashes = []
passes = []
@@ -25,15 +20,26 @@ for line in lines
line = line.trim
if line == "" then continue
parts = line.split(":")
- //if parts.len < 2 then continue
+ if parts.len < 2 then continue
userNames.push(parts[0])
hashes.push(parts[1])
end for
for entry in hashes
- passes.push(crypto.decipher(entry))
+ if g.hashTable.hasIndex(hashes[entry]) then
+ passes.push(hashes[entry])
+ continue
+ end if
+ passes.push(entry)
end for
+if passes.len > 0 then
+ for line in passes
+ passes.replace([line], crypto.decipher(line))
+ g.hashTable.push(passes[line])
+ end for
+end if
+
for line in userNames
if not passes[indexOf(line)] then passes.indexOf(line) = "|no password found|"
print(userNames[indexOf(line)] + " has the password " + passes[indexOf(line)])