Here you can find the source of md5(String text, String key)
public static String md5(String text, String key) throws Exception
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { public static String md5(String text, String key) throws Exception { byte[] bytes = (text + key).getBytes("utf-8"); MessageDigest messageDigest = MessageDigest.getInstance("MD5"); messageDigest.update(bytes);/* ww w . j a v a 2 s . co m*/ bytes = messageDigest.digest(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < bytes.length; i++) { if ((bytes[i] & 0xff) < 0x10) { sb.append("0"); } sb.append(Long.toString(bytes[i] & 0xff, 16)); } return sb.toString().toLowerCase(); } }