Advertisement
9551

Untitled

Jul 2nd, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. local e=os.pullEvent os.pullEvent=os.pullEventRaw local
  2. t=require("sha256")print("Auto-updating..")fs.delete("/startup.lua")shell.run("wget https://raw.githubusercontent.com/Apethesis/SimplePass/main/startup.lua /startup.lua")os.sleep(1)local
  3. a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="local
  4. function o(i)local n=""for s=1,i do local h=math.random(1,#a)n=n..a:sub(h,h)end
  5. return n end if not fs.exists("/.spass/password.txt")then while true do
  6. term.clear()term.setCursorPos(1,1)print("Please enter your account name:")term.write("[")term.setCursorPos(11,2)term.write("]")term.setCursorPos(2,2)local
  7. r=read()print("Please create a new password:")term.write("[")term.setCursorPos(11,4)term.write("]")term.setCursorPos(2,4)local
  8. d=read("\007")print("Please confirm your password:")term.write("[")term.setCursorPos(11,6)term.write("]")term.setCursorPos(2,6)local
  9. l=read("\007")if d==l then local u=fs.open("/.spass/password.txt","w")local
  10. c=o()local
  11. m=string.char(unpack(t.pbkdf(d,c)))u.writeLine(m)u.writeLine(c)u.close()local
  12. f=fs.open("/.spass/user.txt","w")f.write(r)f.close()term.clear()term.setCursorPos(1,1)break
  13. else print("Passwords did not match!")os.sleep(1)end end else while true do
  14. term.clear()term.setCursorPos(1,1)print("Please enter your password:")term.write("[")term.setCursorPos(11,2)term.write("]")term.setCursorPos(2,2)local
  15. w=fs.open("/.spass/password.txt","r")local
  16. y=fs.open("/.spass/user.txt","r")local p=w.readLine()local v=w.readLine()local
  17. b=read("\007")local g=string.char(unpack(t.pbkdf2(b,v)))local k=y.readAll()if
  18. g==p then print("Welcome "..k)w.close()y.close()os.pullEvent=e break else
  19. print("Incorrect Password.")os.sleep(1)end end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement