I have a couple of programs that I am using, one for locking doors, and one for dailing stargates.
In these two programs a password is requested from the user, but the problem is the password is typed out in plain text, for anyone to see who is also watching the screen.
Is there a way to mask the input, so that other users can't "spy" and steal it?
Thanks ahead of time! Love this mod.
Masking Input With Astricks (Password Style)
Started by NullSchritt, Jul 22 2013 12:28 PM
7 replies to this topic
#1
Posted 22 July 2013 - 12:28 PM
#2
Posted 22 July 2013 - 12:33 PM
There sure is:
You can call read with a mask character like the code above. That code will use the asterisk as a mask when printing the input back out during the read call.
local input = read ('*')
You can call read with a mask character like the code above. That code will use the asterisk as a mask when printing the input back out during the read call.
#3
Posted 22 July 2013 - 12:52 PM
Grim Reaper, on 22 July 2013 - 12:33 PM, said:
There sure is:
You can call read with a mask character like the code above. That code will use the asterisk as a mask when printing the input back out during the read call.
local input = read ('*')
You can call read with a mask character like the code above. That code will use the asterisk as a mask when printing the input back out during the read call.
os.pullEvent=os.pullEventRaw
id = os.getComputerLabel()
while true do
shell.run("redset right true")
shell.run("redset left true")
shell.run("clear")
print("Please enter the password to gain access to this area:")
pass = read ('*')
content = http.get("http://smp.projectbuilder.info/fetch.php?cmd=page&ID=doorcheck&buffer=0&NAME=" .. id .. "&PASS=" .. pass)
s = content.readAll()
if s == "1" then
shell.run("redset right false")
shell.run("redset left false")
print("Success, the door has been opened. Please enter the area promptly.")
sleep(6)
shell.run("redset right true")
shell.run("redset left true")
else
print("Error, incorrect password, please try again")
sleep(3)
end
end
#4
Posted 22 July 2013 - 12:54 PM
You're not checking the pass variable at all.
#5
Posted 22 July 2013 - 01:09 PM
What do you mean by it's not working?
#6
Posted 22 July 2013 - 01:38 PM
What version of CC/Minecraft are you using ?
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











