Re: Remote signing of large files



Please don't CC me on replies, unless I request one. It is against debian-*
list policy.

On Friday 2008 December 05 15:49, you wrote:
Boyd Stephen Smith Jr. wrote:
On Thursday 04 December 2008, "Magnus Therning" <magnus@xxxxxxxxxxxx>
wrote
about 'Remote signing of large files':
So, my idea was to somehow separate the two steps that GnuPG performs
under the hood when signing, creating the message digest (hash) and
the signing of this message digest. I've found `--print-md` which
looks promising, but there doesn't seem to be any `--sign-md`.

A detached signature is, mathematically, the message digest run thorough
the encrypt() function. [Encrypting with the private key allows anyone
with the public key to decrypt to the digest "plaintext" which they can
compare to a locally calculated message digest, thus verifying the
signature. They can also be assured that the signature is from the owner
of the private key, or that the private key has been compromised.]

So, you might try --encrypt'ing the output of --print-md.

AFAIU it wouldn't work:

1. Encrypting is actually using a symmetric algorithm for the bulk of
the data and asymmetric crypto is only used to encrypt the symmetric
key. In any case I don't think I can get `--encrypt` to use the private
key.

That's only true in active protocols with a handshake, e.g. SSL or TLS. The
only reason active protocols do this is because symmetric ciphers are
generally faster.

For "offline" encryption, using an asymmetric keys directly works fine. If
you encrypt something with gpg it uses the public key of the chosen recipient
or their public subkey designated for encryption.

2. AFAIU signing always signs a message digest, no matter what type of
data I stick in. So signing the output of `--print-md` wouldn't do
since verification would require a manual step.

Um, sort of. sign(data, privkey) == encrypt(digest(data), privkey), by
definition. So, you should be able to take the output of --print-md,
then --encrypt it, specifying your private key. It's a bit more complex then
that, because of data encoding issues, but it should be possible with the
command-line tools. If not, it's definitely possible with some custom C
code -- I forget what the C binding for gpg are called, but you'll probably
need that and libgcrypt.
--
Boyd Stephen Smith Jr.                     ,= ,-_-. =.
bss03@xxxxxxxxxxxxxx                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-'
http://iguanasuicide.org/                      \_/    

Attachment: pgpNXxapzBUJn.pgp
Description: PGP signature



Relevant Pages

  • Re: Remote signing of large files
    ... signing could be done on a separate server. ... the signing of this message digest. ... the encrypt() function. ... of the private key, or that the private key has been compromised.] ...
    (Debian-User)
  • Re: Remote signing of large files
    ... about 'Remote signing of large files': ... the signing of this message digest. ... [Encrypting with the private key allows anyone ... of the private key, or that the private key has been compromised.] ...
    (Debian-User)
  • Re: Remote signing of large files
    ... signing could be done on a separate server. ... detached signatures should be relatively small. ... the signing of this message digest. ... of the private key, or that the private key has been compromised.] ...
    (Debian-User)
  • Re: RSACryptoServiceProvider decrypt with public key
    ... key/decrypt with the private key and encrypt with the private key/decrypt ... encrypt data and send it back to Alice. ... only she can decrypt Bob's data. ... see the public key and the encrypted data, but she could not decrypt Bob's ...
    (microsoft.public.dotnet.security)
  • Re: Copy protection for a .NET application
    ... is stored in a flash memory of the smartcard, ... Hawill you reveal a private key, that's known by just one party. ... > 2) Encrypt the secret and IV with the public key. ... > 4) HL decrypts the stringusing private RSA key stored in the lock. ...
    (microsoft.public.dotnet.languages.csharp)

Loading