AES CBC PKCs × 7 encryption

Performing encryption behind Java. Security. InvalidKeyException: illegal Key Size
Because the key is more than 128, sell Java. Security. InvalidKeyException: Illegal key size. Because the key length is limited, the Java runtime environment reads restricted policy files.
solution :
lution A:
g> the official download of the JCE unrestricted permission policy file, and replace the corresponding file
JDK7 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
JDK8 download address: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
Download after decompression can see local_policy. Jar and US_export_policy jar and readme. TXT
if installed JRE, put the two jar files in % JRE_HOME % \ lib \ security directory under the cover of the original file
if installed JDK, and put the two jar files are in % JDK_HOME % \ JRE \ lib \ security directory to cover the original file
Option B:
Replace Oracle JDK with OpenJDK, the free and open source Java version of Oracle. OpenJDK does not have this limitation, and most Java services run on the OpenJDK environment


Read More: