Posts

Showing posts with the label Security

Solve java.security.InvalidKeyException: Illegal key size or default parameters

Image
Solve java.security.InvalidKeyException: Illegal key size or default parameters When first time I was working on AES 256 bit encyrption, I faced above exception. I tried everything and was frustrated what is the main cause. Then I reasearhed little bit on this, and found this has to do with " Java Cryptography Extension (JCE) Unlimited Strength Policy Files" . So, What is  JCE Unlimited Strength Policy ? So when you install JDK / JRE on your machine a normal version of JCE policy jars is included which doesn't support higher bit (256 in my case) encryption / decryption. The reason behind this is, US has restrictions on the export of cryptographic technology: https://en.wikipedia.org/wiki/Export_of_cryptography_from_the_United_States They used to be very strict -- cryptography was classified as munitions, and you can only download the full strength products from the US and other white-listed countries. Restrictions have eased up a lot since then,