Clarify nonce entropy requirements#722
Conversation
fkj
left a comment
There was a problem hiding this comment.
I don't have a strong opinion on the actual entropy required, but I think this looks fine if nobody objects to 128 bits.
|
|
||
| `nonce`: | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh, cryptographically random number with sufficient entropy for every Authorization Request, store it with its current session, and pass it in the `nonce` Authorization Request Parameter to the Wallet. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh and unpredictable nonce using a secure cryptographically random number generator of at least 128 bits of entropy for every Authorization Request and store it with its current session. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). |
There was a problem hiding this comment.
I believe we should add a note here explaining that a self-contained nonce (e.g., HMACed) is fine as well provided the underlying algorithm (e.g., HMAC) provides enough entropy. I believe that is also roughly what was discussed 1-2 weeks ago when this was discussed in the WG?
There was a problem hiding this comment.
there is nothing that prevents you from putting a 128 bit random value into the self-contained nonce?
There was a problem hiding this comment.
Yes, we should just make that explicit/explain that
There was a problem hiding this comment.
Should we add this to 14.1. Preventing Replay of Verifiable Presentations rather than in this chapter?
There was a problem hiding this comment.
I think the consensus was that it would be great to add a description of how to do the HMAC approach correctly, but it could be moved into a separate issue/PR.
|
|
||
| `nonce`: | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh, cryptographically random number with sufficient entropy for every Authorization Request, store it with its current session, and pass it in the `nonce` Authorization Request Parameter to the Wallet. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh and unpredictable nonce using a secure cryptographically random number generator of at least 128 bits of entropy for every Authorization Request and store it with its current session. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). |
There was a problem hiding this comment.
This might cause some verifiers that are compliant with the current spec to become out of compliance I think, i.e. it's a breaking change.
I'm not sure how we address that. But it is a potential issue given 1.0 is intended to be named in EU law. One possibility is to make it a 'SHOULD' instead, perhaps with a note that it would have been made mandatory if not for backwards compliance.
There was a problem hiding this comment.
I suggest this to be a MUST, as this is just making "sufficient" more precise to current best practices
There was a problem hiding this comment.
if this breaks existing implementations, we can't make it a must. and need to find an alternative way
There was a problem hiding this comment.
I believe this is what errata is made for
There was a problem hiding this comment.
I agree that it's probably best to make it a RECOMMENDED 128 bits and keep the normative language the same.
|
|
||
| `nonce`: | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh, cryptographically random number with sufficient entropy for every Authorization Request, store it with its current session, and pass it in the `nonce` Authorization Request Parameter to the Wallet. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh and unpredictable nonce using a secure cryptographically random number generator of at least 128 bits of entropy for every Authorization Request and store it with its current session. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). |
There was a problem hiding this comment.
The use of 'at least' means we're not specifying an upper bound. The length of nonces that are supported has been an ongoing issue outside of the VP world - sometimes people want to use self contained JWTs as nonces/state, sometimes authorization servers limit the lengths they support. For interoperability we'd need to say something about an upper bound on the length.
There was a problem hiding this comment.
Don't confuse length and entropy. Also the upper limit for length may be a breaking change.
There was a problem hiding this comment.
Indeed, it could be a breaking change, but in practice the certification suites have to take a position. Which is currently ~23 characters, and the suite also tries a 43 character nonce I believe and requires that to work.
There generally is a link between entropy and length at least for the lower bound - 128bit means there's a minimum length.
|
During WG meeting today, the group preferred changing the 128-bit length to recommended in order to limit breaking changes. |
|
|
||
| `nonce`: | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh, cryptographically random number with sufficient entropy for every Authorization Request, store it with its current session, and pass it in the `nonce` Authorization Request Parameter to the Wallet. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). | ||
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh and unpredictable nonce using a secure cryptographically random number generator of at least 128 bits of entropy for every Authorization Request and store it with its current session. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). |
There was a problem hiding this comment.
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh and unpredictable nonce using a secure cryptographically random number generator of at least 128 bits of entropy for every Authorization Request and store it with its current session. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). | |
| : REQUIRED. A case-sensitive String representing a value to securely bind Verifiable Presentation(s) provided by the Wallet to the particular transaction. The Verifier MUST create a fresh, cryptographically random number with sufficient entropy for every Authorization Request and store it with its current session. The nonce SHOULD contain at least 128 bits of entropy. See (#preventing-replay) for details. Values MUST only contain ASCII URL safe characters (uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde). |
Closes #707