tags:

views:

73

answers:

2

Hi can everyone tell me how to encrypt & decrypt Java oject

+1  A: 

First of all, the object should be serializable. Then, for an example using Cipher and the DES algorithm, see http://www.exampledepot.com/egs/javax.crypto/EncryptObject.html

I'll leave it as an exercise to figure out how to change this to use RSA.

If you need something more specific, please add on to your question; generic questions get generic responses.

foxwoods
+1  A: 

http://andreas.louca.org/2008/03/20/java-rsa-encryption-an-example/

http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml

P.S. What is the U.S. law on providing Encryption howto on this site ?

Romain Hippeau
Use export-grade key in your example :)
ZZ Coder