MD5 Encoding

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 base64

In 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

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • Technorati
  • YahooMyWeb

 

August 2006
S M T W T F S
« Jul   Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories