Originally posted by Shailesh Pillai:
Hello Ranchers,
I want to encrypt the passwords that i am storing in my database. How can I achieve this?
Does anyone have the code or can anyone suggest any URL where I can get MD5 algorithm to encrypt passwords that I am storing in my database.
The
Tomcat code for RealmBase is a good reference.
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java It's main() is a good starting point to see how you can get an encrypted password.
And it's authenticate(
String username, String credentials) is a good starting point to see how you can do the matching.
Regards, Jan