0

How to invoke non-echoing password prompt in cmd.exe|bash from nodejs application?

Use case :

$ npm install nodejsApplication -g
$ nodejsApplication arg1 arg2
Type your password:
*********** 

After user types password then nodejs app should be able to use it further.

nodeJsApplication will only modify password typerd by user. For instance it will generate SHA1 hash of user's password...

Kuba Wyrobek
  • 5,273
  • 1
  • 24
  • 26
  • Just a thought, would you be able to prevent the user from checking your .js files for the password? – beny23 Oct 23 '13 at 21:07
  • Password won't be stored inside JS file. The idea is that JS file will create new password from the original one. – Kuba Wyrobek Oct 23 '13 at 21:08
  • 1
    This might help: http://stackoverflow.com/questions/4708787/get-password-from-input-using-node-js – beny23 Oct 23 '13 at 21:10
  • and how do you prevent the user from editing your .js file and commenting out the check? I guess my question is: is it worth trying to prevent the user from accessing your program when it is probably quite easy to circumvent the protection? – beny23 Oct 23 '13 at 21:13
  • Let me explain the idea behind this application. This application will take my MASTER password add some salt depending on arguments and return hash. The hash will be used as password in services like gmail, github, stackoverflow. I just want to have one master password which will be used to generate password for services (salt) – Kuba Wyrobek Oct 23 '13 at 21:23
  • 1
    This library is a really nice way to handle prompts: https://github.com/flatiron/prompt – Jeff Escalante Oct 23 '13 at 22:42

0 Answers0