Template::Plugin::GnuPG -- PGP encrypt your TT output

dlc on 2004-10-12T01:19:14

I recently released Template::Plugin::GnuPG, which integrates the Template Toolkit and gnupg via the GnuPG module. I wrote it (over the course of an hour or so) because I had an odd need: I needed to encrypt the body of a web page to a specific GPG key. The encrypted page is simply a PGP message (with the -----BEGIN PGP MESSAGE-----) wrapped in headers and footers.

Because no browser supports PGP-encrypted content (though they should!), there are a couple of ways to view the content. The first is to use something that can decrypt the contents of a window, such as WinPT (if you're using windows). Since WinPT doesn't run on my OS of choice, I would most likely do something like:

$ wget -qO- http://example.com/encrypted.html | gpg --output - | lynx -force_html -stdin

(Though that would run any formatting within the encrypted part of the document.)

Anyway, it will be interesting to see if anyone else has a use for this plugin. I can see it being useful for automatically generated email, in addition to web pages, but I don't know how often people have a need to do this kind of thing.