I have a file encrypted with java application using AES. I also have a key file was encrypted with. But i can\'t understand how to use the key to decrypt file. Most tutorials an
The answer could be simply to put the key data as bytes into a SecretKeySpec like this:
SecretKeySpec aesKey = new SecretKeySpec(myKeyData, "AES");
Note that SecretKeySpec implements the Key interface, so you can use it directly in a Cipher.init()
method. So there is no SecretKeyFactory needed, which you would use otherwise.