[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reading passwords in a console application
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 1 Aug 2011 10:43:39 -0300
> The following code
>
> if (hash(io.read())==hashed_password) then ...
>
> suffers from the drawback that what you type appears on the screen.
Try this:
io.write("password: ")
io.flush()
os.execute("stty -echo")
password=io.read()
os.execute("stty sane")
if (hash(password)==hashed_password) then ...