Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local e=os.pullEvent os.pullEvent=os.pullEventRaw local
- 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
- a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="local
- function o(i)local n=""for s=1,i do local h=math.random(1,#a)n=n..a:sub(h,h)end
- return n end if not fs.exists("/.spass/password.txt")then while true do
- 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
- r=read()print("Please create a new password:")term.write("[")term.setCursorPos(11,4)term.write("]")term.setCursorPos(2,4)local
- d=read("\007")print("Please confirm your password:")term.write("[")term.setCursorPos(11,6)term.write("]")term.setCursorPos(2,6)local
- l=read("\007")if d==l then local u=fs.open("/.spass/password.txt","w")local
- c=o()local
- m=string.char(unpack(t.pbkdf(d,c)))u.writeLine(m)u.writeLine(c)u.close()local
- f=fs.open("/.spass/user.txt","w")f.write(r)f.close()term.clear()term.setCursorPos(1,1)break
- else print("Passwords did not match!")os.sleep(1)end end else while true do
- term.clear()term.setCursorPos(1,1)print("Please enter your password:")term.write("[")term.setCursorPos(11,2)term.write("]")term.setCursorPos(2,2)local
- w=fs.open("/.spass/password.txt","r")local
- y=fs.open("/.spass/user.txt","r")local p=w.readLine()local v=w.readLine()local
- b=read("\007")local g=string.char(unpack(t.pbkdf2(b,v)))local k=y.readAll()if
- g==p then print("Welcome "..k)w.close()y.close()os.pullEvent=e break else
- print("Incorrect Password.")os.sleep(1)end end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement