Here you can find the source of MD5(String pwd)
public static String MD5(String pwd)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { private static char[] md5String = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; public static String MD5(String pwd) { if (pwd != null) { try { byte[] btInput = pwd.getBytes(); MessageDigest mdInst = MessageDigest.getInstance("MD5"); mdInst.update(btInput);/*from w w w . j av a 2 s .c o m*/ byte[] md = mdInst.digest(); int j = md.length; char[] str = new char[j * 2]; int k = 0; for (byte byte0 : md) { str[(k++)] = md5String[(byte0 >>> 4 & 0xF)]; str[(k++)] = md5String[(byte0 & 0xF)]; } return new String(str).toLowerCase(); } catch (Exception e) { return null; } } return null; } }