Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide user input on password prompt [duplicate]

Tags:

People also ask

How do you make an input invisible in C++?

Use getch() to get the input instead of using cin , so the input will not be shown (quoting wiki): int getch(void) Reads a character directly from the console without buffer, and without echo.

Which of the following techniques is used by terminal driver to stop displaying the passwords on console in Linux?

c - Hide password input on terminal - Stack Overflow.

How do you hide a password when typing in Python?

maskpass() maskpass() is a Python module that can be used to hide passwords of users during the input time. The maskpass() modules also provides a secure way to handle the password prompt where programs interact with the users via terminal.


Possible Duplicate:
Read a password from std::cin

I don't work normally with the console, so my question is maybe very easy to answer or impossible to do .

Is it possible to "decouple" cin and cout, so that what I type into the console doesn't appear directly in it again?

I need this for letting the user typing a password and neither me nor the user normally wants his password appearing in plaintext on the screen.

I tried using std::cin.tie on a stringstream, but everything I type is still mirrored in the console.