posted 10 years ago

Dear All,

I am looking for some standard way of generating the key pair (Public and Private Key) and encrypting the text using the private key which would be decrypted at the other end using our public key.

Pls, either refer to me to some sites or with some open source where in I get the details how to proceed with the above approach.

Regards,

Krish

I am looking for some standard way of generating the key pair (Public and Private Key) and encrypting the text using the private key which would be decrypted at the other end using our public key.

Pls, either refer to me to some sites or with some open source where in I get the details how to proceed with the above approach.

Regards,

Krish

posted 10 years ago

The standard API for doing en-/decryption in Java Home page. You didn't mention which algorithm you want to use; if it's RSA, then you need to use an RSA provider like Bouncycastle, because JCE doesn't support RSA out of the box.

posted 10 years ago

Normally, when you want to send text to the "other end", you ask for the other's public key, which you use to encrypt. The other end can then decrypt with their private key.

In your scenario, anyone listening to your conversation can decrypt -- as they can get your public key in the same way the other end gets it. The public key is.... public. You have to assume that everyone knows it.

Henry

I am looking for some standard way of generating the key pair (Public and Private Key) and encrypting the text using the private key which would be decrypted at the other end using our public key.

Normally, when you want to send text to the "other end", you ask for the other's public key, which you use to encrypt. The other end can then decrypt with their private key.

In your scenario, anyone listening to your conversation can decrypt -- as they can get your public key in the same way the other end gets it. The public key is.... public. You have to assume that everyone knows it.

Henry