Hi,
please give help urgent....
In my servlet i am encrypting one message (say userId or pswd)
for encryption i am using javax.crypto package algoritham used is DES
I am generating key as ..
-----------code--------
SecretKey key =KeyGenerator.getInstance("DES").generateKey();
------------------
Then converting it into String and passing it as requestparameter along with encrypted message.
(this is step i can't change ie i need to pass these as requestParameter)
In the second servlet for decryption i need this key ,I am getting that but
I am not able to cast it to SecretKey object
any solution related to this will be great for me..
or any method to reproduce the same key in the second servlet as in first servlet used for encryption.
Any method is available for generating a key with respect to a String given hardcoded...
please give help urgent....
In my servlet i am encrypting one message (say userId or pswd)
for encryption i am using javax.crypto package algoritham used is DES
I am generating key as ..
-----------code--------
SecretKey key =KeyGenerator.getInstance("DES").generateKey();
------------------
Then converting it into String and passing it as requestparameter along with encrypted message.
(this is step i can't change ie i need to pass these as requestParameter)
In the second servlet for decryption i need this key ,I am getting that but
I am not able to cast it to SecretKey object
any solution related to this will be great for me..
or any method to reproduce the same key in the second servlet as in first servlet used for encryption.
Any method is available for generating a key with respect to a String given hardcoded...