Signing a file given its hash only

Werner Koch wk at gnupg.org
Tue May 20 10:11:48 CEST 2025


On Mon, 19 May 2025 15:40, Richard Stoughton said:

> creates the final signatures. This could be done in a much more
> efficient way if GnuPG would be able to create signatures with hashes
> instead of  the complete file content as input.

Many years ago we pondered wit this idea.  However it is complicated
because *PGP does not simpluy sign a hash but has a prefix and a suffix
to append.  Thus for signing we would need to provide a tool which takes
some internal hash context, continue to has the file, and let gpg
finalize the hashing.  This is a bit ugly and would raise problems with
certifications etc.

Our solution was to to implement remote signing.  This allows to do the
private key operations on your machines while the actual hashing and
signing is done on the server.  From a security POV this is the same as
running only the bulk hashing on the server.

If you don't like that, take the easy way and sign a manifest file with
the hash values.


Shalom-Salam,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20250520/7807c0a0/attachment.sig>


More information about the Gnupg-users mailing list