To do the decryption operation, the following error occurred java.security.InvalidKeyException:Illegal key size
Set the CBC mode of the decryption mode to AES cipher cipher = cipher.getinstance ("aes/cbc/nopadding"); Secretkeyspec Key_spec = new Secretkeyspec (Aeskey, "AES"), Ivparameterspec IV = new Ivparameterspec (Arrays.copyofrange ( Aeskey, 0, ()); Cipher.init (Cipher.decrypt_mode, Key_spec, iv);
Exception reason: If the key is greater than 128, the Java.security.InvalidKeyException:Illegal key size exception is thrown
Workaround: JDK7: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
Place two jar files in the%jdk_home%\jre\lib\security directory to overwrite the original file.
Reference: https://www.cnblogs.com/lilinzhiyu/p/8024100.html
Java decryption Error Invalidkeyexception:illegal key size workaround