title: "Designated Verifier Signatures for JOSE" abbrev: "DVS for JOSE" category: info
docname: draft-bastian-dvs-jose-latest submissiontype: IETF # also: "independent", "editorial", "IAB", or "IRTF" number: date: consensus: true v: 3 area: "Security" workgroup: "Javascript Object Signing and Encryption" keyword:
- JOSE
- JWS
- designated verifier signature
- HPKE venue: group: "Javascript Object Signing and Encryption" type: "Working Group" mail: "[email protected]" arch: "https://mailarchive.ietf.org/arch/browse/jose/" github: "paulbastian/draft-bastian-dvs-jose" latest: "https://paulbastian.github.io/draft-bastian-dvs-jose/draft-bastian-dvs-jose.html"
fullname: Paul Bastian
organization: Bundesdruckerei GmbH
email: [email protected]
- fullname: Micha Kraus organization: Bundesdruckerei GmbH email: [email protected]
normative: RFC7515: RFC7515 RFC7517: RFC7517 RFC7518: RFC7518 RFC9180: RFC9180
informative: HPKE-IANA: title: Hybrid Public Key Encryption (HPKE) IANA Registry target: https://www.iana.org/assignments/hpke/hpke.xhtml date: October 2023
--- abstract
This specification defines designated verifier signatures for JOSE and defines algorithms that use a combination of key agreement and MACs.
--- middle
Designated verifier signatures (DVS) are signature schemes in which signatures are generated, that can only be verified a particular party. Unlike conventional digital signature schemes like ECDSA, this enables repudiable signatures.
This specification describes a general structure for designated verifier signature schemes and specified a set of instantiations that use a combination of an ECDH key exchange with an HMAC.
This specification and all described algorithms should respect the efforts for Fully Specified Algorithms.
This algorithm is intended for use with digital credentials ecosystems, including the Issuer-Holder-Verifier model described by W3C VCDM or IETF SD-JWT-VC.
{::boilerplate bcp14-tagged}
The draft uses "JSON Web Signature", "JOSE Header", "JWS Signature", "JWS Signing Input" as defined by {{RFC7515}}.
Signing Party: : The Party that performs the key agreement first and generates the MAC. Similar to a Signer.
Verifying Party: : The Party that performs the key agreement second, generates the MAC and compares it to a given value. Similar to a Verifier.
DVS rely on the following primitives:
-
A Diffie-Hellman Key Agreement (DHKA)
DH(skX, pkY)
: Perform a non-interactive Diffie-Hellman exchange using the private keyskX
and public keypkY
to produce a Diffie-Hellman shared secret of length Ndh. This function can raise a ValidationError.Ndh
: The length in bytes of a Diffie-Hellman shared secret produced byDH()
.Nsk
: The length in bytes of a Diffie-Hellman private key.
-
A key derivation function (KDF):
Extract(salt, ikm)
: Extract a pseudorandom key of fixed length Nh bytes from input keying materialikm
and an optional byte stringsalt
.Expand(prk, info, L)
: Expand a pseudorandom keyprk
using optional stringinfo
intoL
bytes of output keying material.Nh
: The output size of the Extract() function in bytes.
-
A Message Authentication Code algorithm (MAC)
MacSign(k, i)
: Returns an authenticated tag for the given inputi
and keyk
.Nk
: The length in bytes of keyk
.
-
An HPKE algorithm (for the HPKE variants):
SealAuth(pkR, info, aad, pt, skS)
: encrypts and authenticates single plaintextpt
with associated dataaad
and contextinfo
using a private sender keyskS
and public receiver keypkR
.OpenAuth(enc, skR, info, aad, ct, pkS)
: decrypts ciphertext and tagct
with associated dataaad
and contextinfo
using a private receiver keyskR
and public sender keypkS
.
A designated verifier signature requires three components for an algorithm:
- a Diffie-Hellman Key Agreement (DHKA)
- a Key Derivation Function (KDF)
- a Message Authentication Code algorithm (MAC)
In general, these parameters are chosen by the Signing Party. These parameters need to be communicated to the Verifying Party before the generation of a Designated Verifier Signature.
The following functions are defined to describe a generic, composable Designated Verifier Signature Scheme:
def dvsSign(pkR, skS, msg, salt= "", info = "DVS-1")
dh = DH(skS, pkR)
prk = Extract(salt, dh)
k = Expand(prk, info, Nk)
mac = MacSign(k, msg)
return mac
def dvsVerify(skR, pkS, msg, salt = "", info = "DVS-1", mac)
dh = DH(skR, pkS)
prk = Extract(salt, dh)
k = Expand(prk, info, Nk)
mac' = MacSign(k, msg)
if mac != mac':
raise Exception("Designated Verifier Signature invalid")
return
The generation of the Designated Verifier Signature takes the private key of the Signing Party, the public key of the Verifying Party and the message as inputs. The retrieval and communication of the Verifying Party's public key is out of scope of this specification and subject to the implementing protocols.
Input:
skS
: private key of the Signing PartypkR
: public key of the Verifying Partymsg
: JWS Signing Inputsalt
: Salt for key derivationinfo
: optional info for key derivation
Steps:
- TODO
The generation of the Designated Verifier Signature takes the private key of the Signing Party, the public key of the Verifying Party and the message as inputs. The retrieval and communication of the Verifying Party's public key is out of scope of this specification and subject to the implementing protocols.
Input:
skR
: private key of the Verifying PartypkS
: public key of the Signing Partymsg
: JWS Signing Inputsalt
: Salt for key derivationinfo
: optional info for key derivationsignature
: the Message Authentication Code
Steps:
- TODO
Algorithms MUST follow the naming DVS-<DHKA>-<KDF>-<MAC>
.
This section describes a simple designated verifier signature scheme based on Hybrid Public Key Encryption (HPKE) {{RFC9180}} in auth mode. It reuses the authentication scheme underlying the AEAD algorithm in use, while using the KEM to establish a one-time authentication key from a pair of KEM public keys. This scheme was described in early specification drafts of HPKE {{RFC9180}}
To create a signature, the sender simply calls the single-shot Seal()
method with an empty plaintext value and the message to be signed as AAD.
This produces an encoded key enc and a ciphertext value that contains only the AAD tag. The signature value is the concatenation of the encoded key and the AAD tag.
Input:
skS
: private key of the Signing PartypkR
: public key of the Verifying Partymsg
: JWS Signing Inputinfo
: optional info for key derivation
Steps:
- Call
enc
,ct
=SealAuth(pkR, info, aad, pt, skS)
withaad
=msg
pt
= ""
- JWS Signature is the octet string concatenation of (
enc
||ct
)
To verify a signature, the recipient extracts encoded key and the AAD tag from the signature value and calls the single-shor Open()
with the provided ciphertext.
If the AEAD authentication passes, then the signature is valid.
Input:
skR
: private key of the Verifying PartypkS
: public key of the Signing Partymsg
: JWS Signing Inputinfo
: optional info for key derivationsignature
: JWS Signature octet string
Steps:
- Decode
enc
||ct
=signature
by length ofenc
andct
. See {{HPKE-IANA}} for length of ct and enc. - Call
pt
=OpenAuth(enc, skR, info, aad, ct, pkS)
withaad
= msg
- the signature is valid, when
OpenAuth()
returnspt
= "" with no authentication exception
NOTE: ct
contains only a tag. It's length depends on the AEAD algorithm (see Nt values in RFC9180 chapter 7.3.)
Algorithms MUST follow the naming DVS-HPKE-<Mode>-<KEM>-<KDF>-<AEAD>
.
"Mode" is Auth (PSKAuth could also be used).
The "KEM", "KDF", and "AEAD" values are chosen from the HPKE IANA registry {{HPKE-IANA}}.
Designated Verifier Signatures behave like a digital signature as described in Section 3 of {{RFC7518}} and are intended for use in JSON Web Signatures (JWS) as described in {{RFC7515}}. The Generating Party performs the Message Signature or MAC Computation
as defined by Section 5.1 of {{RFC7515}}. The Verifying Party performs the Message Signature or MAC Validation
as defined by Section 5.2 of {{RFC7515}}.
The following JWS headers are used to convey Designated Verifier Signatures for JOSE:
alg
: REQUIRED. The algorithm parameter describes the chosen signature suite, for example the ones described in (#generic_suites) and (#hpke_suites).rpk
: REQUIRED. Therpk
(recipient public key) parameter represents the encoded public key of the Verifying Party that was used in the DHKA algorithm as a JSON Web Key according to {{RFC7517}}. This parameter MUST be present.nonce
: OPTIONAL. Thenonce
may be provided by the Verifying Party additional to it's public key and ensure additional freshness of the signature. If provided, the Signing Party SHOULD add thenonce
to the header.
The Signing Party may use existing JWS header parameters like x5c
, jwk
or kid
to represent or reference it's public key according to {{RFC7517}}.
The JWT/JWS header:
{
"typ" : "JWT",
"alg" : "DVS-P256-SHA256-HS256",
"jwk" : <JWK of the Signing Party>,
"rpk" : <JWK of Verifying Party>
}
The JWT/JWS payload:
{
"iss" : "https://example.as.com",
"iat" : "1701870613",
"given_name" : "Erika",
"family_name" : "Mustermann"
}
The JWT/JWS signature:
base64-encoded MAC
This specification described instantiations of Designated Verifier Signatures using specific algorithm combinations:
+-----------------------+-----------------------------+----------------+
| Algorithm Name | Algorithm Description | |
| | | Requirements |
+-----------------------+-----------------------------+----------------+
| DVS-P256-SHA256-HS256 | ECDH using NIST P-256, | Optional |
| | HKDF using SHA-256 and | |
| | HMAC using SHA-256 | |
+-----------------------+-----------------------------+----------------+
| DVS-HPKE-Auth-X25519 | DVS based on HPKE using | |
| -SHA256 | DHKEM(X25519, HKDF-SHA256) | Optional |
| -ChaCha20Poly1305 | HKDF-SHA256 KDF and | |
| | ChaCha20Poly1305 AEAD | |
+-----------------------+-----------------------------+----------------+
| DVS-HPKE-Auth-P256 | DVS based on HPKE using | |
| -SHA256-AES128GCM | DHKEM(P-256, HKDF-SHA256) | Optional |
| | HKDF-SHA256 KDF and | |
| | AES-128-GCM AEAD | |
+-----------------------+-----------------------------+----------------+
- Verifying Party MUST ensure the freshness of signatures by utilizing ephemeral keys in
rpk
or by providing a nonce fornonce
.
Define:
- define new
rpk
header parameter - alg values for DVS-P256-SHA256-HS256 and some more
--- back
Thanks to:
- Brian Campbell
- John Bradley