By using the MD5 Encoding, we can create encryted password using message digest technology. To do this, we can make use of utility provided by JBoss. See the following:
If you need to generate passwords in code, the org.jboss.security.Util class provides a static helper method that will hash a password using a given encoding.
String hashedPassword = Util.createPasswordHash("MD5", Util.BASE64_ENCODING, null, null, "password");OpenSSL provides an alternative way to quickly generate hashed passwords.
echo -n password | openssl dgst -md5 -binary | openssl base64In both cases, the text password should hash to “X03MO1qnZdYdgyfeuILPmQ==”. This is the value that would need to be stored in the user store.
The about org.jboss.security.Util class can be found in the jbossx.jar shipped with JBoss Application Server.
Reference:
http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch8.chapter.html









No comments
Comments feed for this article
Trackback link
http://blog.planner4u.org/blog/2006/08/02/md5-encoding/trackback/