This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I'm trying to implement cyptography and found this code sample from Java SE documentation.
However, when I encrypt a text and then decrypt it again, the end result is not the same as the original text.
Could you tell me what's wrong?
You are not printing the values of the clear and cipher text array. You are printing the value returned by the toString() method for the byte array -- which is just "[B", which means byte array, followed by the identity hash code.