I'm working on a web application.in the login page,I have to check the user password and compare with the encrypted password stored in database. anybody can recommand some easy encryption sample to encrypt and decrypt password
This is very easy. Use the java.security.MessageDigest class, http://java.sun.com/j2se/1.3/docs/api/java/security/MessageDigest.html. It doesn't really matter which algorithm you choose, MD5 or SHA, but there's plenty of documents on Google comparing the two.