通过MD5明文加密
public static String md5(String source) {
if(source==null || source.length()==0) {
throw new RuntimeException(CrowdConstant.MESSAFE_STRING_INVALIDATE);
}
try {
String algorithm="md5";
MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
byte[] input = source.getBytes();
byte[] output= messageDigest.digest(input);
int signum=1;
BigInteger bigInteger = new BigInteger(signum,output);
int radix=16;
String encoded = bigInteger.toString(radix);
return encoded;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return null;
}