Inquirer.js: Password prompt should display no characters

Created on 14 Oct 2014  Â·  8Comments  Â·  Source: SBoudrias/Inquirer.js

Password prompt should display no characters when entering text, or there should be an option to enable this behaviour. This would mimic the behaviour of applications like ssh-add.

Most helpful comment

This would not be the case during a ‘screen sharing’ session/recorded screen playback.

All 8 comments

This has been discussed before, It adds no security to do this since for someone to see how many asterisks appear then they must be able to observe the screen and thus can see the number of keystrokes pressed. The output is removed when the password entered so they will not appear in any logs.

This would not be the case during a ‘screen sharing’ session/recorded screen playback.

Good point.

anyone know how to hack this together @Asheboy @danielchatfield?

You certainly can hack it together by removing https://github.com/SBoudrias/Inquirer.js/blob/master/lib/prompts/password.js#L148-L152. You'd really want to remove that function, alas, I receive an error of which I do not have time to resolve at the moment. I might take another look this evening

You can create a custom prompt and register it on Inquirer so you or other people can use it without hacking Inquirer source in a way that'll be unmaintainable.

yea ok, I'll mess around with it and hopefully send a PR this weekend or early next week.

This has been discussed before, It adds no security to do this since for someone to see how many asterisks appear then they must be able to observe the screen and thus can see the number of keystrokes pressed. The output is removed when the password entered so they will not appear in any logs.

@danielchatfield do you have a source on that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szul picture szul  Â·  5Comments

lvjiaxuan picture lvjiaxuan  Â·  6Comments

ro31337 picture ro31337  Â·  5Comments

bugzpodder picture bugzpodder  Â·  4Comments

mechanical-turk picture mechanical-turk  Â·  3Comments