DESCBC加密参考:点击打开链接
public class TripleDESUtil {
字符转换参考之前一片博文点击打开链接
/** * 加密字节数组 * * @param arrB 需加密的字节数组 * @return 加密后的字节数组 * @throws Exception */ private static byte[] encrypt(byte[] arrB) throws Exception { return encryptCipher.doFinal(arrB); } /** * 加密字符串 * * @param strIn 需加密的字符串 * @return 加密后的字符串 * @throws Exception */ public static String encrypt(String strIn) { String encryptStr = ""; if (null == encryptCipher || null == decryptCipher) { try {