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.