• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read password in scrambled format  RSS feed

 
herurmath saraswathi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, In one of my application , i have to read password in scrambled format, so that no body can see that password in the script. When we run the script, it accept the correct password...
 
Robert Hill
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a question?
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could add a keyListener to the textfield, and as they hit any

charater keys and Digit keys, diplay '*', but update a private String,

so you dont loose the password..

Justin
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Justin Fox:
you could add a keyListener to the textfield...


Or use JPasswordField...

But he said something about a "script", so it's not clear if this is even Java, let alone a Java GUI application. Let's see if he can clear this up for us.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k, I saw the script too, but I thought maybe he was just refering to the
textfield display.

Justin
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could be wrong but I think what he means is there's a file on the harddrive with the password saved in it, but he doesn't want that password to be saved in clear text. So if someone sat down at the comp. they wouldn't be able to read the password when looking at the file.

If that's the case, you want to use encryption (probably just hash the password). Look at bouncycastle for a VERY good, free library for doing everything you'll need.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!