Advertisement
Guest User

Passwordencryption

a guest
May 22nd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. count = 0
  2. -- Settings
  3. globalpassword = "Global"
  4. retrys = 5 -- Trys before the timeout kicks in.
  5. timeout = 20 --timeout-time if you have entered a wrong password too often
  6. verifieduser = false -- Set to true to deactivate the lock
  7.  
  8. function openProtection()
  9.  print("Login successful")
  10.  end
  11.  
  12. while verifieduser == false do  -- Loop of the Passwordverfication
  13. shell.run("clear")
  14. skipPasswordcheck = false
  15. io.write("Hello User. Please enter the up-to-date password in Order to continue.")
  16. print()
  17. if count >= retrys then
  18. print("You have failed "..retrys.." times already. Please wait "..timeout.." seconds before trying again")
  19. skipPasswordcheck =true
  20. sleep(timeout)
  21. count = 0
  22.  
  23. elseif skipPasswordcheck == false then
  24.     if globalpassword == io.read() then
  25.     verifieduser = true
  26.     else
  27.     verifieduser = false
  28.     count = count+1
  29.     end --verification of the Password
  30. end --exit Var: Count Check
  31. end --exit of the loop
  32.  
  33. openProtection() -- Release the lock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement