File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
java code to keep password in ******** format in database(sql server)
Joined: Feb 21, 2007
Feb 28, 2007 23:22:00
I want to know how to keep password in ******** format
in database(sql server)using
Thanks & Regards
Joined: Nov 24, 2005
Feb 28, 2007 23:48:00
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 :
All roads lead to JavaRanch
Joined: Jan 18, 2007
Mar 01, 2007 02:35:00
Dont bother too much..
I will soon send you the code because i got it and will show you when i will be back
Joined: Mar 22, 2005
Mar 01, 2007 03:51:00
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:
String password = ... MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(password); byte hashedPassword = md5.digest();
I agree. Here's the link:
subject: java code to keep password in ******** format in database(sql server)
char to binary
problem with connecting to a SQLServer database
how to convert .csv files into sql server files using java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014