pycryptodome icon indicating copy to clipboard operation
pycryptodome copied to clipboard

Encrypting data using PGP public key

Open ArifNawaz36 opened this issue 2 years ago • 1 comments

I have a PGP key and I want to encrypt data with that key. I have almost tried all of the cipher algorithms but I am facing the same issue. When I try to import the PGP key from a file using the below code it gives me an error ValueError: RSA key format is not supported

recipient_key = RSA.import_key(open("F:\\pgp_keys\\pub_key.asc").read())

First of all, can I use a PGP key to encrypt data with this library? As for as I have researched PGP key format is different from the RSA key and that's why some people suggest using a PGP library rather than using any other. Stackoverflow

If I can use this library to encrypt data with a PGP key, please guide me on how.

ArifNawaz36 avatar Sep 01 '22 06:09 ArifNawaz36

As I am aware, this is currently not possible with PyCryptodome.

Varbin avatar Sep 05 '22 15:09 Varbin