help me this is urgent
hi everybody
i am doing the encryption/decryption using AES(256bit key) using SunJCE provider following is the code
String key2 = "FFF3454D1E9CCDE00101010101010101";
byte [] keybytes = key2.getBytes();
SecretKeySpec keyspec = new SecretKeySpec(keybytes,0,32, "AES");
My program is working fine but in the above code i want to know how the key is generated by SecretKeySpec class. what type of algorithm it uses.
i just want to know internals of how the key is generated.
Thanks in advance
andy
# 2
HI,
Sorry if I put into wrong words. what I want to confirm is,
As I am specifying 32 character string (256 bit key ) AES Key manually, Is it the actual Key or Is the 32 character string is taken as a seed to generate some internal Key to do AES Encryption/Decryption.
I need this information for the security policy in my Application environment.
Please let us know if you want any add on info on this.....
Thanks & regards,
andy
# 3
The bytes ARE the actual AES key bytes. They are not processed in any way and can be used with other packages such as openssl (when hex encoded first).
I don't like your use of characters to define the key. This restricts the search space somewhat since the chances are you will restrict the characters to the ASCII printable set. The search space will therefore be about 95^N rather than 256^N. Much smaller.
I don't like that you have not specified an encoding when you turn your key string into key bytes. This will use the default character encoding which is platform and configuration dependent.