why there is no AESKeySpec?

Hi All,

Lack of AESKeySpec creating many problems, as we can't give our own SecretKey (say, 0xabcdef....) that is 128 bits long for AES Encryption.

Also, SecretKeyFactory doesn't generate AES keys.

I wonder about SUN's decision,(maybe because of legalities?)

well, the problem is obvious, generating 'raw' AES keys from password+salt.

Message was edited by:

rajesh_bhide

[419 byte] By [rajesh_bhidea] at [2007-10-3 9:40:53]
# 1

I don't know why you think you need an AESKeySpec. Sun have defined a framework where, as far as possible, you don't need to know the specifics of which algorithm is being used.

For AES I use something like

SecretKey skey = new SecretKeySpec(keyBytes, "AES");

Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");

cipher.init(javax.crypto.Cipher.DECRYPT_MODE, skey);

As to generating a 'raw' key from 'password' + 'salt', you will need to specify the algorithm to be used. PBE with AES is available as one approach.

Message was edited by:

sabre150

sabre150a at 2007-7-15 4:56:55 > top of Java-index,Security,Cryptography...