You can get funny using control characters, but I doubt you
will get this to run in a cross-application way.
I would allow an optional command line parameter
"-password xyz" for usage in scripts, and for interactive use
a parameter "-prompt" which will open a AWT window or
JOptionPane...