Here you can find the source of encryptByUsingMd5(String passwd)
public static String encryptByUsingMd5(String passwd)
//package com.java2s; import java.security.MessageDigest; public class Main { public static String encryptByUsingMd5(String passwd) { try {/* w w w.ja v a2 s . com*/ MessageDigest sha = MessageDigest.getInstance("MD5"); byte[] tmp = passwd.getBytes(); sha.update(tmp); return new String(sha.digest()); } catch (java.security.NoSuchAlgorithmException e) { System.out.println("Rats, MD5 doesn't exist"); System.out.println(e.toString()); } return null; } }