摘要:
public static boolean decryptSha1(String src,byte[] desc) // 如果这里传入的是byte[] 转换后的字符串,则再转为字符串比较后,会匹配不成功 {// MessageDigest sha1 = MessageDigest.getInstance("sha-1"); try { java.security.MessageDigest algb=java.security.MessageDigest.getInstance("sha-1"); algb.update(src.getBytes()); 阅读全文
摘要:
加密算法:BASE64 (3DES (SHA1(原始字符串)))public static String base64Encode(byte[] str) { BASE64Encoder encoder = new BASE64Encoder(); return encoder.encodeBuffer(str); } public static byte[] base64Decode(String str) { BASE64Decoder dec = new BASE64Decoder(); try { return dec.decodeBuffer(s... 阅读全文