Need to do client side encryption/decryption

I am developing a web application in jsp, servlets and database.

I have a registrationform.jsp which takes details like name, address etc.

On submitting this form, server validates the user entered information and if everything is correct, then sends him an ID(a number in encrypted format). But client has to see the actual data instead of encrypted value i.e., on receiving response from server, before getting displayed on browser, client side decryption should be done and actual data should get displayed.

I am using RSA public/private key pairs to do encryption and decryption. I am successful on server encryption and decryption. But I am not sure how to do encryption and decryption on client side.

I need the solution as early as possible.

Please provide the solution and also provide any useful links or resources that I can follow.

Thanks

[892 byte] By [snehaka] at [2007-11-27 11:44:52]
# 1

> Please provide the solution and also provide any

> useful links or resources that I can follow.

>

The only real solution is to use HTTPS then no explicit encryption is required.

Also, sending the client an ID number (encrypted or otherwise if the client can access the ID) has serious security implications. Unless you are very careful, a client will be able to fake an ID of another user.

sabre150a at 2007-7-29 17:58:22 > top of Java-index,Security,Cryptography...
# 2

Thanks for your response.

In order to prevent the ID to be faked, server sents it in encrypted form and on client side, the received encrypted value is decrypted first using clients private key and then actual data is displayed.

The problem is that I am not sure how to capture that encrypted value sent by server and then decrypt it.

Thanks

snehaka at 2007-7-29 17:58:22 > top of Java-index,Security,Cryptography...
# 3

If you use HTTPS you will not need to explicitly decrypt anything.

sabre150a at 2007-7-29 17:58:22 > top of Java-index,Security,Cryptography...