Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read password #58

Open
gwenn opened this issue Jul 27, 2016 · 8 comments
Open

Read password #58

gwenn opened this issue Jul 27, 2016 · 8 comments

Comments

@gwenn
Copy link
Collaborator

gwenn commented Jul 27, 2016

Disable echo...

@gwenn
Copy link
Collaborator Author

gwenn commented Jan 12, 2019

antirez/linenoise#125

Reading passwords securely requires more than that. Usually you want to ensure no one else is reading the input and that you are really connected to a terminal etc.

@madprops
Copy link

I'm looking for this. It doesn't even have to be incredibly secure, just hiding the visible input would be enough for lots of cases.

@gwenn
Copy link
Collaborator Author

gwenn commented Aug 14, 2019

@madprops You can try something like this:

  • Disable auto_add_history so that password does not appear in your history file.
  • Define a Highlighter such as highlight returns '*' x width(line) because rustyline expects the highlighted line to have the same width as the raw line and highlight_char returns true.
  • And force highlighting: color_mode.

@madprops
Copy link

Hmm not sure how to do this. It seems to define a highlighter I need to provide a helper, and to do that I need to implement all the helper stuff, not just the highlight? Can't find an easier way. Also in my case I think I don't need to bother about the history bit, since I'm not using history features in my inputs.

@gwenn
Copy link
Collaborator Author

gwenn commented Aug 15, 2019

@madprops I know, this is just a hack.
I will try to provide you a complete example.

@gwenn
Copy link
Collaborator Author

gwenn commented Aug 15, 2019

See #266

@gwenn
Copy link
Collaborator Author

gwenn commented Apr 13, 2020

antirez/linenoise#182

@bjorn3
Copy link
Contributor

bjorn3 commented Apr 13, 2020

Using a * per input character rather than nothing is less secure as it leaks the length of the password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants