This above all: to thine own self be true,
And it must follow, as the night the day,
Thou canst not then be false to any man.

William Shakespeare, Hamlet, Act I, Scene III, line 78


Coming out of my work on News::Gateway, this is a small and fairly simple module that generates and verifies detached PGP signatures using either PGP or GnuPG, accepting data in a wide variety of ways. It is not a general PGP module; generation and verification of signatures is the only thing that it supports. It was originally written to support PGPMoose signing of postings to moderated groups and it also works for signing Usenet control messages.

While I use this module extensively for signing control messages and generating PGPMoose signatures (via News::Article), I've not done significant work on this module in quite some time. I'm not particularly happy with its interface and with the horrid hacks required to support PGP 2.6.x. Any future work on it is likely to focus on making it work better with GnuPG.

The interface to this module should be considered unstable and subject to change if I ever get a chance to rework it, which is why it's not yet been given a 1.x version number.


Perl 5.003 or later is required, as is some implementation of PGP. I strongly recommend GnuPG, which is freely available, free software, and of considerably higher quality on Unix than PGP, Inc.'s implementations.


The module:

PGP::Sign 0.20 2007-04-28 Download PGP signature

An archive of older releases is also available.


A Debian package is available from my personal repository and from Debian proper as of Debian 5.0 (lenny) as libpgp-sign-perl.


Copyright 1997, 1998, 2000, 2002, 2004, 2007 by Russ Allbery <>.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. This means that you may choose between the two licenses that Perl is released under: the GNU GPL and the Artistic License. Please see your Perl distribution for the details and copies of the licenses.

Last spun 2019-03-07 from thread modified 2013-01-04