AndreSoYeah

Untitled

Jan 12th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. --# WaliLogin by Andre A. Walia (walia6)
  2. --# liscensed under CreativeCommons Attribution.
  3. --# You may distribute,remix, tweak, and build
  4. --# upon my work, even commercially, as long as
  5. --# you credit me by my First, middle initial, and last name.
  6. characters = {'a','b','c','d','e','f','1','2','3','4','5','6','7','8','9','0'}
  7. function genSalt()
  8. toReturn=''
  9. for xx=1,64 do
  10. toReturn=toReturn..characters[math.random(1,#characters)]
  11. end
  12. return toReturn
  13. end
  14. local codes = {
  15. ["APIS/walCrypt"] = "efeJSTH9",
  16. ["APIS/sha256"] = "tBStqhvU",
  17. ["startup"] = "kNJ6sFHd",
  18. ["addUser"] = "1Tf3CjWS",
  19. [".shell"] = "WrH70miG"
  20. }
  21. re = http.get("http://www.pastebin.com/raw.php?i=GQ1JmtNq").readLine()
  22. local function get(name,code)
  23. shell.run("pastebin get "..code.." "..name)
  24. end
  25. print()
  26. print("Would you like to install walia6's login? y/n")
  27. local a = true
  28. while a do
  29. event,char = os.pullEvent("char")
  30. if string.upper(char) == "N" or string.upper(char) == "Y" then
  31. k=string.upper(char)
  32. a=false
  33. end
  34. end
  35. if k == "Y" then
  36. for k,v in pairs(codes) do
  37. if fs.exists(k) then
  38. fs.delete(k)
  39. end
  40. get(k,v)
  41. end
  42.  
  43. --get("walCrypt",codes["walCrypt"])
  44. --get("startup",codes["startup"])
  45. os.loadAPI("APIS/sha256")
  46. print()
  47. write("Username: ")
  48. user = read()
  49. while true do
  50. print()
  51. write("Password: ")
  52. pass = read("*")
  53. write("Enter password again: ")
  54. if read("*") == pass then
  55. if fs.exists("loginSettings") then
  56. fs.delete("loginSettings")
  57. end
  58. shell.run("mkdir loginSettings")
  59. if fs.exists("loginSettings/version") then
  60. fs.delete("loginSettings/version")
  61. end
  62. ff=fs.open("loginSettings/version","w")
  63. ff.writeLine(re)
  64. ff.flush()
  65. ff.close()
  66. info={}
  67. info[user] = {}
  68. info[user]['salt'] = genSalt()
  69. info[user]['hash'] = sha256.sha256(pass..(info[user]['salt']))
  70. infoFile=fs.open('accounts','w')
  71. infoFile.writeLine(textutils.serialize(info))
  72. infoFile.close()
  73. info=nil
  74. break
  75. else
  76. print("password do not match")
  77. end
  78. end
  79. os.reboot()
  80. end
Advertisement
Add Comment
Please, Sign In to add comment