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;
}

