- GPG SUITE HOW TO GET A PUBLIC KEY FULL
- GPG SUITE HOW TO GET A PUBLIC KEY CODE
- GPG SUITE HOW TO GET A PUBLIC KEY WINDOWS
Further more the output format of all commands is undefined and can and does change whenever the underlying commands change. For this reason alone the programmatic usage (especially in package maintainer scripts!) is strongly discouraged. But you still do need PGP installed, or PyPgp won't do anything -).Is desired the additional installation of the GNU Privacy Guard suite (packaged in PyPgp is also a very old project, though its simplicity means that making it work with modern Python (e.g., subprocess instead of now-deprecated os.popen2) would not be hard. I.e., write the encrypted cyphertext to the standard input of pgpv -f, read pgpv's standard output as the decrypted plaintext. "Decrypt a string - if you have the right key." For example, decryption is just: def decrypt(data): PyPgp has a much simpler approach - that's why it's a single, simple Python script: basically it does nothing more than "shell out" to command-line PGP commands. I'm not sure why you say "it doesn't seem to be compatible with Python 2.4 which I have to use" - specifics please?Īnd yes it does exist as a semi-Pythonic (SWIGd) wrapper on GPGME - that's a popular way to develop Python extensions once you have a C library that basically does the job.
GPG SUITE HOW TO GET A PUBLIC KEY FULL
PyMe does claim full compatibility with Python 2.4, and I quote: Particular key object has the private information required to Return a Boolean value recording whether this algorithm can Obj2=ciph.new(password, ciph.MODE_PGP, IV)ĭie('Error in resulting plaintext from PGP mode')įuthermore, PublicKey/pubkey.py provides for the following relevant methods: def encrypt(self, plaintext, K) Obj1=ciph.new(password, ciph.MODE_PGP, IV) P圜rypto supports PGP - albeit you should test it to make sure that it works to your specifications.Īlthough documentation is hard to come by, if you look through Util/test.py (the module test script), you can find a rudimentary example of their PGP support: if verbose: print ' PGP mode:', Not tested with other versions, though I don't foresee any problems. It works with Python 2.4 as well as Python 2.5 and later. I've used the same ( gpg.exe/ iconv.dll) approach with systems written in other languages, e.g. SWIG-based solutions, or solutions which require building with MinGW/ MSYS), which I considered and experimented with. This approach was a lot less painful than the others (e.g. If you can't wait, go with Traugott's module and modify it yourself - it wasn't too much work to make it work with the subprocess module.
At some point, perhaps in the next couple of weeks, I hope to be able to tidy it up, add some more unit tests (I don't have any unit tests for sign/verify, for example) and release it (either under the original P圜rypto licence or a similar commercial-friendly license). The module I've got is not ideal to show right now, because it includes some other stuff which shouldn't be there - which means I can't release it as-is at the moment. public keys received from a partner company)
GPG SUITE HOW TO GET A PUBLIC KEY WINDOWS
It's available here, but as-is it's not suitable for Windows because it uses os.fork(). There's a module GPG.py which was originally written by Andrew Kuchling, improved by Richard Jones and improved further by Steve Traugott. No changes to the registry are needed, and everything (executables and data files) can be confined to a single folder if you want.
GPG SUITE HOW TO GET A PUBLIC KEY CODE
You don't need to do a full installation on end-user machines - just gpg.exe and iconv.dll from the distribution are sufficient, and you just need to have them somewhere in the path or accessed from your Python code using a full pathname. Instead, why not avoid the rabbit-holes and do what I did? Use gnupg 1.4.9. You don't need P圜rypto or PyMe, fine though those packages may be - you will have all kinds of problems building under Windows.