lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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 ...