Triple-DES BadPaddingException...
843810Aug 2 2003 — edited Aug 4 2003Hi,
I've searched for the BadPaddingException in these forums but not found a satisfactory answer to my problem.
I'm using Triple-DES encoding on the server to encode a random key(generated by java.util.Random.nextBytes()).
I then send this encrypted key to the client (actually a JSP hosting an applet). The applet then tries to decode this key and encrypt the password using this key. Here I am getting a BadPaddingException.
The problem is I can only pass Strings as parameters to applets, so I cannot work with byte arrays on the whole. I have to convert byte arrays to Strings and then Strings back to byte arrays.
Do all encodings chop-off/add bytes during this conversion, that is, is there no way to be sure that some encoding will not mistreat the bytes whatever bytes I feed in, if I use the same encoding on client and server?
Thanx in advance....