Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sha2 = require("sha2")
- local term = require("term")
- function setPass()
- print("Please set password")
- term.write("Password: ")
- pass = term.read(nil, nil, nil, "*") -- password in plain text
- permPass = sha2.hash256(pass) --sets permPass to the hashed thingy of pass
- pass = nil --Make sure the pass is not left in a variable
- print("Done!")
- end
- function checkPass()
- print("Please enter password")
- term.write("Password: ")
- pass = term.read(nil, nil, nil, "*") --password in plain text
- pass = sha2.hash256(pass) --Do the thingy with pass
- if pass == permPass then --See if pass is permPass
- print("Sucess")
- else
- print("Nope")
- end
- end
- print("Starting setPass")
- setPass()
- print("Starting checkPass")
- checkPass()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement