Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
hidutta duttax
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Manoj Paul
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic