How can I perform PGP encryption and decryption method using openssl commands

1

I have a PGP public key of B. Now A wants to send an encrypted message to B using his PGP Public key by using PGP method. How can I do this with OpenSSL?

Edit

I have seen wiki page for PGP method where a random key is used to encrypt the message and that random key is again encrypted with senders PGP Public key and then receiver will decrypt the encrypted key using his private key and then that decrypted key is used to decrypt the message. But i am not able to do that process in openssl.

It can be done in gpg, but i want to know how can it be done in OpenSSL?

nandan

Posted 2015-10-02T05:14:17.310

Reputation: 13

Answers

2

OpenPGP is a protocol not implemented by OpenSSL, including a derivated mode of symmetric encryption. While you could use OpenSSL for the actual cryptographic algorithms, for implementing OpenPGP with OpenSSL commands, you'd have to:

Don't write your own crypto code (this is not an actually small project here), rely on available libraries instead. There's GnuPG which can be interfaced with GPGME, and a bunch of GPGME interfaces and native libraries for pretty much all (more or less) important programming language.

Jens Erat

Posted 2015-10-02T05:14:17.310

Reputation: 14 141

2

No, it cannot. While OpenSSL implements most of the same cryptographic algorithms, it can neither understand nor generate the OpenPGP packet format.

user1686

Posted 2015-10-02T05:14:17.310

Reputation: 283 655

yeah i get that it cannot be performed with OpenSSL directly but can we do it in step by step as mentioned in this [link] (https://en.wikipedia.org/wiki/File:PGP_diagram.svg)

– nandan – 2015-10-02T06:50:16.000