Re: [openpgp] Disadvantages of Salted Signatures

"Neal H. Walfield" <> Sat, 09 December 2023 11:37 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E04E3C151073 for <>; Sat, 9 Dec 2023 03:37:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.905
X-Spam-Status: No, score=-1.905 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 3SbwZqWlA_nN for <>; Sat, 9 Dec 2023 03:37:08 -0800 (PST)
Received: from ( []) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by (Postfix) with ESMTPS id D00E0C14CE51 for <>; Sat, 9 Dec 2023 03:37:07 -0800 (PST)
Received: from ([] by with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <>) id 1rBvdp-0003D4-CZ; Sat, 09 Dec 2023 12:37:05 +0100
Date: Sat, 09 Dec 2023 12:37:04 +0100
Message-ID: <>
From: "Neal H. Walfield" <>
To: Stephan Verbücheln <>
In-Reply-To: <>
References: <>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Archived-At: <>
Subject: Re: [openpgp] Disadvantages of Salted Signatures
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sat, 09 Dec 2023 11:37:13 -0000

Hi Stephan,

On Sat, 09 Dec 2023 10:04:14 +0100,
Stephan Verbücheln wrote:
> 1. A malicious blackbox implementation (e.g. PGP smartcard) can choose
> the nonce in a way that allows the attacker to compute the secret key
> from two signatures.

As I understand it, OpenPGP signatures are generated in two steps.

  - The data including the salt (which I think you are calling the
    nonce) is hashed.
  - The hash is signed.

From the draft:

  > The body of a v4 or v6 Signature packet contains:
  >   - ...
  >   - Only for v6 signatures, a variable-length field containing:
  >     - A one-octet salt size. The value MUST match the value
  >       defined for the hash algorithm as specified in Table 23.
  >     - The salt; a random value of the specified size.

  > The concatenation of the data being signed, the signature data from
  > the version number through the hashed subpacket data (inclusive),
  > and (for signature versions later than 3) a six-octet trailer (see
  > Section 5.2.4) is hashed. The resulting hash value is what is
  > signed.

OpenPGP smartcards, as I understand it, only do the second step.  And,
for what it is worth, this is how we designed the low-level signing
interface in Sequoia:

That is, OpenPGP smartcards are handed the computed hash and asked to
sign that; AIUI, the smartcard does not generate, nor can it influence
the value of the salt that was generated in the previous step.  So,
from the perspective of the card, I think the signing operation is

Am I misunderstanding something?  If you agree, does your attack still

I'm sorry if I'm missing something obvious; I'm not a cryptographer.