前端代码: // 这个是加密用的 function encrypt(text){ var key = CryptoJS.enc.Utf8.parse('1234567890654321'); //为了避免补位,直接用16位的秘钥 var iv = CryptoJS.enc.Utf8.parse('1234567890123456'); //16位初始向量 var encrypted = CryptoJS.AES.encrypt(text, key, { iv: iv, mode:CryptoJS…
import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; /** * Created by 黄俊聪 on 2017/12/15. */ public class AESUtil { public static final String KEY_ALGORITHM = "AES"; public static final Str…