-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to decrypt a PGP file using Public Key #288
Comments
You can't; public keys can only be used for encryption and signature verification. Decryption and signing require the private key. |
Thanks @Commod0re for the quick reply. Is this how PGP generally works or basically based on the scope of the PGPy module? Please advise. Thanks. |
Yes, this is generally how public-key cryptography works |
Thanks @Commod0re |
Sorry to bring out an old issue. From my understanding of PGP, it requires 2 sets of key for encrypting and 2 sets of key for decrypting. So for example, when a sender encrypt a file for me: Sender will need to use his private key and my public key to encrypt. You can see in this guide: https://www.howtogeek.com/427982/how-to-encrypt-and-decrypt-files-with-gpg-on-linux/ |
I have an issue, also highlighted here > https://stackoverflow.com/questions/57807242/how-to-decrypt-a-pgp-file-using-public-key-in-pgpy
I have a Public shared to me and I'm loading it as shown below:
I try to decrypt the file using this key
It doesn't work and I get this error instead
pgpy.errors.PGPError: Expected: is_public == False. Got: True
Any idea on how to decrypt an PGP file in Python with only the Public Key.
Thanks
The text was updated successfully, but these errors were encountered: