InnoZ / MAS

analysis and (potentially) development of a multi-agent simultation for carsharing
Apache License 2.0
0 stars 0 forks source link

Hide password from console output #33

Closed wese-da closed 8 years ago

wese-da commented 8 years ago

Currently we're using new BufferedReader(new InputStreamReader(System.in)).read(....)

We could instead use System.console().readPassword() Then we would have no echoing, which is exactly what we want.

Problem is: The System.console() tells Java to use the native system's console, not the console in Eclipse. This is an Eclipse bug (see: here), so we have to go another way...

Since there is no other way to suppress echoing on the java console ,we have the following alternatives:

  1. no changes for the time being
  2. write ssh password and user name into the configuration
  3. run the scenario generation code only from the system console (not so good)
00Bock commented 8 years ago
  1. write ssh password and user name into the configuration

Does that mean we would enter a ssh generated key and then manually enter our ssh password? Then I would prefer that.

wese-da commented 8 years ago

I have one more idea for this issue: It's possible to make a short work-around with Java Swing by simply asking the user to enter his / her ssh user name and password in this dialog:

bildschirmfoto vom 2016-05-18 10 24 11

The password is not displayed in plain text but in dots, so this would be a "fancy" alternative for now.

Edit: This could also be used for database user data.

00Bock commented 8 years ago

good... great! any solution for the configuration.txt in sight?

wese-da commented 8 years ago

Resolved by 32e91ec6e2f7da8555384502cf47ee9cccbbbd45 and eedb3ff8434feddff43720adcfc79840902f2312