Posted on 2008-07-10 17:49
追梦人 阅读(155)
评论(0) 编辑 收藏 所属分类:
Other
public static String MD5Encrypt(String strSrc)
{
MessageDigest md = null;
String strDes = null;
byte[] bt = strSrc.getBytes();
try
{
md = MessageDigest.getInstance("MD5");//getInstance("MD5");//"MD5"、"SHA-1"、"SHA-256"
md.update(bt);
strDes = EncryptUtils.bytes2Hex(md.digest()); // to HexString
} catch (Exception e)
{
return null;
}
return strDes;
}