Client-side decryption
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Florin_Rapan
Posted On:   Wednesday, February 20, 2002 07:52 AM

Hi all: I have a client/server application implementing servlet-to-servlet communication. I am sending a server generated Key object and an encrypted String object using serialization to the client. The encrypted String received on client matches the encrypted String sent from the server. I am instantiating a symmetric Cipher object on client (same type, mode, padding scheme as on server), and initializing it for decryption with the de-serialized Key received from server. The problem is that after decryption I get a different version of the originally encrypted String i.e instead of: 29uirtvuszt:-3b3a9bc0:3ig4129bad:-2fff I get: Ò[ù ÿYè`×p2ÍäͶ”:-3b3a9bc0:3ig4129bad:-2fff    More>>

Hi all:


I have a client/server application implementing servlet-to-servlet communication. I am sending a server generated Key object and an encrypted String object using serialization to the client. The encrypted String received on client matches the encrypted String sent from the server.



I am instantiating a symmetric Cipher object on client (same type, mode, padding scheme as on server), and initializing it for decryption with the de-serialized Key received from server.

The problem is that after decryption I get a different version of the originally encrypted String i.e instead of:

29uirtvuszt:-3b3a9bc0:3ig4129bad:-2fff

I get:

Ò[ù ÿYè`×p2ÍäͶ”:-3b3a9bc0:3ig4129bad:-2fff



The first part of the decrypted String is different; the part after the first column is identical.



If I decrypt the original String on server using the same Cipher object decryption is successful.



Does anyone know why the decryption on client does not reproduce the correct original String?



Thanks,

   <<Less

Re: Client-side decryption

Posted By:   Florin_Rapan  
Posted On:   Tuesday, February 26, 2002 06:25 AM

I found the problem and the solution.

Problem: I was sending the encrypted String unencoded;

Solution: Probably the better way to send an encrypted String object to the client for decryption is either to send the byte array from the string, or send its hexadecimal representation using the cryptix.util.core.Hex class.
About | Sitemap | Contact