0

I have an messsage and I want to encrypt it using PGP public key and then decrypt that decrypted meesage using private key. I see most of the methods used both of these private key and public key for encrption but I want to encrypt it using public key and decrypt it by using private key. Please tell me some solution to implement it in such way.

Nikhil Vasdev
  • 183
  • 1
  • 3
  • 14

1 Answers1

0

In public-key cryptography (such as in OpenPGP) you encrypt the data using public keys and decrypt the data using private keys (secret keyring in OpenPGP terms). It's strange that "most method" used private keys for encryption. Possibly you saw the code that performed both signing and encryption, in which case private keys of the sender are used for signing, and public keys of the recipient are used for encryption.

In .NET you can use BouncyCastle (tricky) or OpenPGPBlackbox package of our SecureBlackbox (supported with samples) to encrypt and decrypt data with OpenPGP. You've been given a link to the sample code that uses BouncyCastle, and our SecureBlackbox includes all samples in the installation package.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
  • Yes, I see many methods that used both public key and private key. But now I had done it using BountyCaste. Thanks for your help. :) – Nikhil Vasdev Feb 26 '14 at 04:40