larrysy
asked on
Java crypto - Illegal key size or default parameters
Hey guys,
I'm running into some trouble loading a key into a cipher to encrypt some strings. Below is the line of code that's causing an issue.
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT _MODE, secretKey);
where secretKey contains 256 bytes.
I'm getting a java.security.InvalidKeyEx ception: Illegal key size or default parameters.
I've scoured the internet and have come to believe this is an environment issue - I'm assuming I need to install JCE (Java Cryptography Extensions), but am running out of luck getting anything to work (most of the better documentation are around 8 years old).
I'll start off by saying I have Eclipse Standard/SDK installed, Version Kepler Service Release 1. Are there any set up gurus out there that could assist me in resolving this issue?
I'm running into some trouble loading a key into a cipher to encrypt some strings. Below is the line of code that's causing an issue.
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT
where secretKey contains 256 bytes.
I'm getting a java.security.InvalidKeyEx
I've scoured the internet and have come to believe this is an environment issue - I'm assuming I need to install JCE (Java Cryptography Extensions), but am running out of luck getting anything to work (most of the better documentation are around 8 years old).
I'll start off by saying I have Eclipse Standard/SDK installed, Version Kepler Service Release 1. Are there any set up gurus out there that could assist me in resolving this issue?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Turns out I had pulled the wrong version of JCE.
:)
So the limit was 128-bit, correct?
Bits?
Think 128 might be the limit.