Using raw_input
in python expects standard input, which echo’s it back after enter is executed, below is an example:
1 2 3 4 5 |
|
Using getpass, the standard input gets masked, like you would expect when entering a password, like below:
1 2 3 4 5 |
|
Changing the default prompt:
1 2 3 4 |
|
Creating a Simple Insecure Password Verification App:
1 2 3 4 5 6 7 |
|
Testing it, by first entering a incorrect string, then the correct one:
1 2 3 4 5 6 7 |
|
You definitely don’t want to hard code the credentials in your app, but you get the idea.