Personally, I would use MD5 to encrypt the passwords; it is a pretty standard algorithm. I used this method in my own code and it works for me:
public static String encrypt(String s)
String the_message=new String(dig.digest());
Remember to import java.security.MessageDigest and java.security.NoSuchAlgorithmException
Btw I assume you're referring to an applet or a stand-alone application, I have little to no experience in JSP so I don't know how you could do this in JSP.