Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Triple-DES BadPaddingException...

843810Aug 2 2003 — edited Aug 4 2003
Hi,

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....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2003
Added on Aug 2 2003
2 comments
129 views