To prevent the "Illegal key size or default parameters"
exception, update your Java SDK by downloading the Java(TM)
Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy
Files 6. Follow the README within that download for instructions on
upgrading your JDK to support 256-bit encryption. (Another option is to
reduce the encryption level of the sample to 128-bit by following
the instructions in this sample's README file.)
You can download the policy files from http://www.oracle.com/technetwork/java/javase/downloads/index.html
. All versions of Java from 1.8.0_161 enable the
unlimited strength policy files by default, see https://www.oracle.com/technetwork/java/javase/8u161-relnotes-4021379.html
for more information.