I am successfully encrypting a URL from my client servlet and my serverside servlet handles the request. The code is below.
My problem is that the decrypted URL is not the "id=101&item=22&conf=12234" I am expecting -- in fact, the encrypted part of the URL is changing each time (not what I'd expect because I'm using the same passphrase). I need help understanding AES encryption and possibly an example using a passphrases would be appreciated.
You can't use "encrypted.toString()" because encrypted does not consist of characters, but of binary bytes. If you need to transport it as ASCII, use an encoding like base-64 (e.g. from the Jakarta Commons Codec library).