Here you can find the source of md5EncriptionPassword(String str)
public static String md5EncriptionPassword(String str)
//package com.java2s; /******************************************************************************* * * Project : Mirage V2//from w w w. j a va2 s . c o m * * Package : * * Date : September 19, 2007, 11:31 PM * * Author : Praveen Kumar Ralla<pralla@miraclesoft.com> * * File : EncriptDecriptPwd.java * * Copyright 2007 Miracle Software Systems, Inc. All rights reserved. * MIRACLE SOFTWARE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * ***************************************************************************** */ import java.security.MessageDigest; public class Main { private static MessageDigest digester; public static String md5EncriptionPassword(String str) { if (str == null || str.length() == 0) { throw new IllegalArgumentException("String to encript cannot be null or zero length"); } digester.update(str.getBytes()); byte[] hash = digester.digest(); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < hash.length; i++) { if ((0xff & hash[i]) < 0x10) { hexString.append("0" + Integer.toHexString((0xFF & hash[i]))); } else { hexString.append(Integer.toHexString(0xFF & hash[i])); } } return hexString.toString(); } }