accept password from command prompt secretly
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   krishnamohan_kumsi
Posted On:   Thursday, February 21, 2002 01:32 PM

hi

i am writing a program where i have to accept username and password from the userat the command prompt, the username while typing is visible which is OK, but with password i have a problem.

My requirement is that i need to take password from the user which is not visible when he is typing, something like when you log into a unix system, where you get either a **** or nothing at all when you type the password.

Can any one help me please !!

regards
kumsi

Re: accept password from command prompt secretly

Posted By:   Eugene_Kuleshov  
Posted On:   Thursday, February 21, 2002 05:49 PM

You can't do it in easy way in Java without native code, because it is not possible to disable output for standard reader.


Hopefuly there is a trick you can do to make password invisible at a entering time.


Start an additional thread and setup a print two backspace plus one random character character about 100 times at a second. And let that thread working until you will not finish reading your password. This trick will make your password invisible.
About | Sitemap | Contact