I want to encrypt some plaintext in python using a key that's been generated through the gpg2 commandline. The application will only know the public key, and would encrypt the data before storage into a database.
I know there is python-gnupg, but that's only been tested on gpg 1.4.2. The latest stable is gpg 2.0.19, which adds some new bugfixes and features. There's pycrypto, but that seems bulky to use for a simple encryption step.
I could use the subprocess module and just use gpg2, but I am unsure about the security implications of running external programs from python.
Is there a pure python wrapper for gpg that I can use? Or would using the subprocess module to call gpg2 be sufficient?
Here are some other alternatives:
But, in my case, none of these will work. If I can find what I am looking for, I will be sure to update this post with a lot more information.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.