It's not a secret anymore!*
The moose likes JSP and the fly likes java code to keep password in ******** format in database(sql server) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "java code to keep password in ******** format in database(sql server)" Watch "java code to keep password in ******** format in database(sql server)" New topic
Author

java code to keep password in ******** format in database(sql server)

hidutta duttax
Greenhorn

Joined: Feb 21, 2007
Posts: 1
Respected sir/Madam,
I want to know how to keep password in ******** format
in database(sql server)using jsp code of servlet code.

Thanks & Regards
Goutam Dutta
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Storing a password ****** in the database sounds pointless, as there's no way to get the real password back
If you mean that you want to encrypt the password, then the following thread may interest you :
http://www.coderanch.com/t/291488/JSP/java/Encryption-JSP


[My Blog]
All roads lead to JavaRanch
Manoj Paul
Ranch Hand

Joined: Jan 18, 2007
Posts: 110
hi Goutam...
Dont bother too much..
I will soon send you the code because i got it and will show you when i will be back
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Welcome to JavaRanch.

A better approach than storing cleartext or encrypted passwords in a DB is to store a hashed version of the password. That way, nobody can get at the password, and there's no need to deal with en-/decryption. It is as easy as:


Ping & DNS - updated with new look and Ping home screen widget
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java code to keep password in ******** format in database(sql server)
 
Similar Threads
Passwords
char to binary
Creating DSN
problem with connecting to a SQLServer database
how to convert .csv files into sql server files using java