This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The primary reason for this is to preserve some purely private data - even from the servers that house it on the web within a database. Think of it as a privacy preserving data transport and storage mechanism.
Here's a shot in the dark: Encrypting a string produces an array of bytes, which you subsequently decrypt into (hopefully) the original string.
So you have to make sure that you transmit that array of bytes as an array of bytes. Don't allow it to be converted into a String at any time, and particularly not by Java. Converting bytes to a String in Java only works successfully if those bytes represented text in the charset you used in the conversion. It doesn't work on arbitrary binary data.
J Marshall Presnell
Joined: Jun 01, 2011
Nice shot in the dark there
But I do base64 encode before transmission and decode before decryption. Sorry, I should have mentioned that in the original post
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.