Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- os.pullEvent = os.pullEventRaw
- if not fs.exists("/sha256") then
- os.loadAPI("pLoad")
- pLoad.DLoad("jJD5udwK","/sha256")
- end
- if not fs.exists("/.first") then
- local f = fs.open("/.first","w")
- f.write("---")
- f.close()
- term.clear()
- term.setCursorPos(1,1)
- print("Input Password: ")
- local pass = read("*")
- local f = fs.open("/.pass","w")
- os.loadAPI("sha256")
- f.write(sha256.sha256(pass))
- f.flush()
- f.close()
- end
- if args[1] == ".ovr" then
- term.clear()
- term.setCursorPos(1,1)
- write("P: ")
- local a = read("*")
- os.loadAPI("sha256")
- local f = fs.open("/.ovr","w")
- f.write(sha256.sha256(a))
- f.flush()
- f.close()
- end
- if fs.exists("/.pass") then
- while true do
- sleep(0)
- term.clear()
- term.setCursorPos(1,1)
- print("Input Password")
- local A = read("*")
- local f = fs.open("/.pass","r")
- local o = fs.open("/.ovr","r")
- ov = o.readAll()
- o.close()
- p = f.readAll()
- f.close()
- os.loadAPI("sha256")
- if sha256.sha256(A) == p then
- rs.setOutput("left",true)
- sleep(3)
- rs.setOutput("left",false)
- elseif sha256.sha256(A) == ov then
- term.clear()
- term.setCursorPos(1,1)
- return printError("Overwrite Password Entered")
- else
- print("incorrect password")
- end
- end
- end
Add Comment
Please, Sign In to add comment