Many of us are using AES encryption. If we would try to do a 256 bit encryption, we would encounter this exception. This exception is thrown because of a restriction imposed by default JDK. On a default JDK installation, AES is limited to 128 bit key size. In order to perform 256-bit AES encryption, you will need to download and install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. We need to use different version of files for different JDK versions. The below table contains link to the appropriate JCE files for the respective JDK versions.
Please download the archive. The archive would contain 2 jar files, namely local_policy.jar and US_export_policy.jar. Extract the jar files from the archive and save them into
${java.home}/jre/lib/security/
. This would solve the issue.