Sean Mullan wrote:
Vishal Mahajan wrote:
Dominik Schadow wrote:
I think the problem is that you don't have a JCE provider in your jre that supports AES key generation this way. I am not sure which provider supports it.Yes, I tried the following code:
SecretKeySpec keySpec = new SecretKeySpec(JavaUtils.getBytesFromFile(keyFile), algorithm); SecretKey key = skf.generateSecret(keySpec);
The exception I receive is
java.security.NoSuchAlgorithmException: AES not found at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:86)
Sun's JCE provider supports AES with J2SE/JDK 1.4.2 and up.
Yes J2SE/JDK 1.4.2 and up support AES algorithm for most of the crypto functions. What seems to be missing is a SecretKeyFactory supporting AES.
Vishal
--Sean