Advertisement
Guest User

login

a guest
Nov 9th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. write("Username: ")
  2. status, username = pcall(read)
  3.  
  4. file = fs.open("/etc/passwd/"..username, "r")
  5.  
  6. if (file == nil or file.readAll() == "") then
  7.     error("User "..username.." does not exist.")
  8. end
  9.  
  10. write("Password: ")
  11. status, password = pcall(read, "*")
  12.  
  13. testhash = sha256.sha256(password)
  14. passhash = file.read()
  15.  
  16. if (testhash == passhash) then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement