Help needed on how to encryption password and verify it?

Hi all, I need help on how to encrypt the client's password and verify it. I will receive a post request from the client. Then I need to encrypt the client's password to MD5 format and the encrypted password need to be verify by the servlet before the client is able to login. I do not have a database of the valid encrypted password so the valid encrypted password need to be written in the servlet itself. May I know how do I code it? Your help is greatly appreciated.

//This receives the input stream send by the client

WVCSPMessageDocument xmlToBean(InputStream in) {

WVCSPMessageDocument inMessage = null;

try {

BufferedReader inReader = new BufferedReader(new InputStreamReader(in));

StringBuffer buffer = new StringBuffer();

String line = null;

while ((line = inReader.readLine()) != null)

buffer.append(line);

WVCSPMessageDocument doc = WVCSPMessageDocument.Factory.parse(buffer.toString());

inMessage = doc;

} catch(Exception e) {

e.printStackTrace(System.err);

}

return inMessage;

}

[1097 byte] By [noobboya] at [2007-11-27 6:56:46]
# 1
You can find here how to get a MD5 hash for the given string: http://balusc.xs4all.nl/srv/dev-jep-use.html
BalusCa at 2007-7-12 18:33:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...