code: private static String readSecretFromStdin(String message) {
          Console console = System.console();
          if (console == null) {
              return null;
          }
          console.writer().write(message);
          console.writer().flush();
          return String.valueOf(console.readPassword());
      }
docs: Reads a secret from the console (stdin).
  
  @param message to present before reading
  @return secret value or null if console is not available