This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Message digest functions use one-way functions and it is infeasible to reverse/decrypt the message digest and discover the original data
For comparing the data/password,
The Enter password needs to encrypted and compared with the already existing encrypted data
Also, in Spring Security when it sees you are using MD5, and you do the login form with j_username and j_password, the Spring Security will automatically encode the incoming password to then match against what is encoded in the database and authenticate for you.