I am using AES algo with keysize 256 bit and have installed the JCE files for JAVA 8 in both locations i.e under Java\jdk1.8.0_05\jre\lib\security & Java\jre8\lib\security I am using bouncy castle as service provider and added the jar as lib on my android project.When I set the keysize 128bit ,everything works just fine but when I go for 192 or 256 a java.security.InvalidKeyException: Illegal key size occurs.One more thing is that I have also installed the bouncycastle provider at run time. the exception occurs at this line
cipher.init(Cipher.ENCRYPT_MODE, secret,new IvParameterSpec(ivBytes));
Also the same code runs just fine in netbeans with 256 keysize. What is wrong?
Android Studio contains it's own JRE installation in the directory jre
in it's installation dir.
However as you use Android Studio you are developing an Android app. The execution of an Android app does not use any JRE/JDK on your computer. It uses Dalvik on the device you use for testing your app.
Therefore this Android Studio internal JRE is only used for components that are executed directly on your computer, e.g. local tests or something similar.