Dominik Schadow wrote:
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)
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.
Vishal
But how can that be? I used AES for encryption…
Any ideas? Thanks Dominik
Dominik Schadow wrote:
Hello,
how can I decrypt an AES encrypted XML-document? I understand how to do
it
with DESede:
File kekFile = new File(keyFile);
DESedeKeySpec keySpec = new
DESedeKeySpec(JavaUtils.getBytesFromFile(keyFile));
SecretKeyFactory skf = SecretKeyFactory.getInstance("DESede");
SecretKey key = skf.generateSecret(keySpec);
But how does it work with AES or Blowfish?
Did you try using the *javax.crypto.spec.SecretKeySpec *class?
Vishal
The problem is only loading the
key file. Does anyone have a code sample for that?
Thank you very much.
Dominik