Skip to content

Illegal key size #10

@rockyhalo

Description

@rockyhalo

Hi,

I am getting issue at line

cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));

Error :
java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
at javax.crypto.Cipher.init(Cipher.java:1393)
at javax.crypto.Cipher.init(Cipher.java:1327)

After debugging i came to know that
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
maxKeyLen = 128, but it should be 256.

The above error get fixed after replacing 2 jar files "local_policy.jar" and "US_export_policy.jar". Is there any way where we can fix this without doing this change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions