Here you can find the source of Md5(String plainText)
public static String Md5(String plainText)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String Md5(String plainText) { StringBuffer buf = new StringBuffer(""); MessageDigest md;/* w w w. j a va 2s. c o m*/ try { md = MessageDigest.getInstance("MD5"); md.update(plainText.getBytes()); byte b[] = md.digest(); int i; for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return buf.toString().toUpperCase(); } }