My requirement : need to exchange some keys between server and client (J2EE).
Key is just a piece of text, could be a number, string whose size would probably be not more than 30 chars.
Since the key is sensitive, I'm thinking of encrypting it, and decrypt it back when I receive the same.
Q1) Legacy code is using 'PBEWithMD5AndDES'. I would like to know whether it's appropriate.
In the context of performance, which could be better?
UPDATE:
There will be no logic on the client side. Server sends an encrypted string to the client, and client returns it. Just like jsessionid.
The key is not too sensitive like a credit card number. But it needs to be exchanged in an unreadable format, better than plain encoding technique
UPDATE 2:
- Here is the scenario. We send an email to the client in which we include 'unsubscribe' from alerts. Clicking on that link should deactivate alerts with out prompting for the login. So, I encrypt his userID and include it the unsubscribe link. On the server side, I decrypt and deactivate his/her alerts. So, the parameters passed by hackers would not work.