You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-dijkhuis-cfrg-hdkeys.md
+44-17
Original file line number
Diff line number
Diff line change
@@ -227,15 +227,18 @@ The parameters of an HDK instantiation are:
227
227
- `Ns`: The amount of bytes of a salt value with sufficient entropy.
228
228
- `H`: A cryptographic hash function.
229
229
- H1(msg): Outputs `Ns` bytes.
230
-
- `D`: An digital signature algorithm or shared secret creation algorithm based on public key cryptography, consisting of the functions:
231
-
- D-Generate-Key-Pair(): Outputs a key pair `(sk, pk)`.
232
-
- `BL`: An asymmetric key blinding scheme for `D` as defined in [I-D.draft-irtf-cfrg-signature-key-blinding-07], with opaque blinding factors and algebraic properties, consisting of the functions:
230
+
- `DSA`: A digital signature algorithm, consisting of the functions:
231
+
- DSA-Generate-Key-Pair(): Outputs a key pair `(sk, pk)`.
232
+
- DSA-Sign(sk, msg): Outputs the signature created using private signing key `sk` over byte string `msg`.
233
+
- DSA-Verify(signature, pk, msg): Outputs whether `signature` is a signature over `msg` using public verification key `pk`.
234
+
- `BL`: A key blinding scheme for `DSA` as defined in [I-D.draft-irtf-cfrg-signature-key-blinding-07], with opaque blinding factors and algebraic properties, consisting of the functions:
233
235
- BL-Derive-Blind-Key(ikm): Outputs a blind key `bk` based on input keying material `ikm`.
234
236
- BL-Derive-Blinding-Factor(bk, ctx): Outputs a blinding factor `bf` based on a blind key `bk` and an application context byte string `ctx`.
235
-
- BL-Blind-Public-Key(pk, bk, ctx): Outputs the result `pk'` of blinding public key `pk` with blind key `bk` and application context byte string `ctx`. This again is a public key in `D`.
236
-
- BL-Blind-Private-Key(sk, bf): Outputs the result `sk'` of blinding private key `sk` with blinding factor `bf`. This result is a private key in `D`, such that if `bf = BL-Derive-Blinding-Factor(bk, ctx)` for some `bk` and `ctx`, the associated public key in `D` equals `BL-Blind-Public-Key(pk, bk, ctx)`.
237
-
- BL-Combine(bf1, bf2): Outputs a blinding factor `bf` such that for all key pairs `(pk, sk)` in `D`:
- BL-Blind-Public-Key(pk, bk, ctx): Outputs the result public key `pk'` of blinding public key `pk` with blind key `bk` and application context byte string `ctx`.
238
+
- BL-Blind-Private-Key(sk, bf): Outputs the result private key `sk'` of blinding private key `sk` with blinding factor `bf`. This result `sk'` is such that if `bf = BL-Derive-Blinding-Factor(bk, ctx)` for some `bk` and `ctx`, `(sk', pk')` forms a key pair for `pk' = BL-Blind-Public-Key(pk, bk, ctx)`.
239
+
- BL-Combine(bf1, bf2): Outputs a blinding factor `bf` such that for all key pairs `(sk, pk)`:
- BL-Blind-Sign(sk, bf, msg): Outputs a `signature` for which `DSA-Verify(signature, pk', msg)` where `(sk', pk')` form the key pair with `sk' = BL-Blind-Private-Key(sk, bf)`.
239
242
- `KEM`: A key encapsulation mechanism [RFC9180], consisting of the functions:
240
243
- KEM-Derive-Key-Pair(ikm): Outputs a key encapsulation key pair `(sk, pk)`.
241
244
- KEM-Encap(pk): Outputs `(k, c)` consisting of a shared secret `k` and a ciphertext `c`, taking key encapsulation public key `pk`.
@@ -349,7 +352,7 @@ Whenever the unit requires the HDK with some `index` at level `n > 0` based on a
349
352
sk' = BL-Blind-Private-Key(sk, bf') # optional
350
353
~~~
351
354
352
-
Now the unit can use the blinded key pair `(sk', pk')` or derive child HDKeys.
355
+
Now the unit can use the blinded key pair `(sk', pk')`, sign using BL-Blind-Sign, or derive child HDKeys.
353
356
354
357
## The remote HDK protocol
355
358
@@ -406,7 +409,7 @@ Instantiations of HDK using elliptic curves require the following cryptographic
406
409
- hash_to_field(msg, count): Outputs `count` EC Elements based on the result of cryptographically hashing `msg` (see [RFC9380], Section 5.2).
407
410
408
411
~~~
409
-
def D-Generate-Blinding-Key-Pair():
412
+
def DSA-Generate-Key-Pair():
410
413
sk = EC-Random()
411
414
pk = EC-Scalar-Base-Mult(sk)
412
415
return (sk, pk)
@@ -479,20 +482,44 @@ def BL-Combine(bf1, bf2):
479
482
Such instantiations of HDK use EC multiplicative blinding (see [Using EC multiplicative blinding](#using-ec-multiplicative-blinding)) and require the following cryptographic construct:
480
483
481
484
- `ECDH`: An Elliptic Curve Key Agreement Algorithm - Diffie-Hellman (ECKA-DH) [TR03111] with elliptic curve `EC`, consisting of the functions:
482
-
- ECDH-Create-Shared-Secret(sk_self, pk_other): Outputs a shared secret byte string representing an Element.
485
+
- ECDH-Create-Shared-Secret(sk_self, pk_other): Outputs a shared secret byte string `Z_AB` representing the x-coordinate of the Element `EC-Scalar-Mult(pk_other, sk_self)`.
486
+
487
+
Note that ECDH enables an alternative way of authenticating a DSA key pair `(sk, pk)` without creation or verification of a signature:
488
+
489
+
~~~
490
+
# 1. Unit shares with reader: pk
483
491
484
-
In such instantiations, the reader provides an ephemeral public key `reader_data`. The Authenticate function returns shared secret `device_data` consisting of a binary encoded x-coordinate `Z_AB` of an ECDH operation with the blinded private key. Subsequently, the unit creates a message authentication code (MAC), such as in ECDH-MAC authentication defined in [ISO18013-5]. The reader verifies this MAC by performing an ECDH operation with its ephemeral private key and the blinded public key.
492
+
# 2. Reader computes:
493
+
(sk_reader, pk_reader) = DSA-Generate-Key-Pair()
485
494
486
-
These instantiations instantiate the following:
495
+
# 3. Reader shares with unit: pk_reader
487
496
497
+
# 4. Unit computes:
498
+
Z_AB = ECDH-Create-Shared-Secret(sk, pk_reader)
499
+
500
+
# 5. Reader computes:
501
+
Z_AB = ECDH-Create-Shared-Secret(sk_reader, pk)
488
502
~~~
489
-
def Authenticate(sk_device, reader_data, bf):
490
-
P' = EC-Scalar-Mult(reader_data, bf)
491
503
492
-
# Compute Z_AB within the secure cryptographic device.
493
-
Z_AB = ECDH-Create-Shared-Secret(sk_device, P')
504
+
Now with the shared secret `Z_AB`, the unit and the reader can compute a secret shared key. The unit can convince the reader that it possesses `sk` for example by sharing a message authentication code created using this key. The reader can verify this by recomputing the code using its value of `Z_AB`. This is for example used in ECDH-MAC authentication defined in [ISO18013-5].
505
+
506
+
In this example, step 1 can be postponed in the interactions between the unit and the reader if a trustworthy earlier commitment to `pk` is available, for example in a sealed document.
494
507
495
-
return Z_AB
508
+
Similarly, ECDH enables authentication of a DSA key pair `(sk', pk')` blinded from an original key pair `(sk, pk)` using a blinding factor `bf` such that:
509
+
510
+
~~~
511
+
sk' = BL-Blind-Private-Key(sk, bf)
512
+
= sk * bf mod EC-Order()
513
+
pk' = EC-Scalar-Mult(pk, bf)
514
+
~~~
515
+
516
+
In this case, the computation in step 4 can be performed as such:
517
+
518
+
~~~
519
+
# 4. Unit computes:
520
+
Z_AB = ECDH-Create-Shared-Secret(sk', pk_reader)
521
+
= ECDH-Create-Shared-Secret(sk * bf mod EC-Order(), pk_reader)
0 commit comments