1 /** 2 * MD5加密 3 * @param strObj 待加密数据 4 * @return 5 */ 6 public static byte[] MD5(String strObj) { 7 byte[] resultString = null; 8 try { 9 MessageDigest md = MessageDigest.getInstance("MD5"); 10 resultString = md.digest(strObj.getBytes()); 11 } catch (NoSuchAlgorithmException ex) { 12 ex.printStackTrace(); 13 } 14 return resultString; 15 }