PGPy is a Python library for implementing Pretty Good Privacy into Python programs, conforming to the OpenPGP specification per RFC 4880.
Currently, PGPy can load keys and signatures of all kinds in both ASCII armored and binary formats.
It can create and verify RSA, DSA, and ECDSA signatures, at the moment. It can also encrypt and decrypt messages using RSA and ECDH.
To install PGPy, simply:
$ pip install PGPyPGPy Documentation on Read the Docs
Please report any bugs found on the issue tracker
You can also join #pgpy on Freenode to ask questions or get involved
Python >= 3.6
Tested with: 3.10, 3.9, 3.8, 3.7, 3.6
This fork uses PyCryptodomex as its cryptographic backend instead of python-cryptography. As a result, the following symmetric ciphers are not supported for encryption:
- Camellia (128/192/256) - not available in PyCryptodomex
- Twofish256 - not available in PyCryptodomex
- IDEA - insecure; only available for decryption of legacy messages
PGPy can still parse and recognize keys and messages that reference these algorithms, but cannot perform encryption operations with them. All other algorithms (AES, TripleDES, CAST5, Blowfish) are fully supported.
BSD 3-Clause licensed. See the bundled LICENSE file for more details.