This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
greyhack-public/decipher.src
2022-12-29 18:06:14 -08:00

24 lines
No EOL
655 B
Lua

cp=include_lib("/lib/crypto.so")
GetPassword = function(userPass)
password=cp.decipher(userPass)
return(password)
end function
if params.len != 1 then exit
origFile = params[0]
if origFile.len < 32 then exit
lines=[origFile]
for line in lines
userPass=line.split(":")
if userPass.len == 2 then
user=userPass[0]
userPass=userPass[1]
password=GetPassword(userPass)
if not password then print("password for "+user+" not found")
if password then print(user+":"+password)
else
userPass=userPass[0]
password=GetPassword(userPass)
if not password then print ("could not decipher "+userPass)
if password then print(password)
end if
end for