Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify cryptographic hash expression formats #1489

Closed
msporny opened this issue May 26, 2024 · 4 comments
Closed

Unify cryptographic hash expression formats #1489

msporny opened this issue May 26, 2024 · 4 comments
Assignees
Labels
CR1 This item was processed during CR1 normative The PR is a normative change to the CR specification pr exists

Comments

@msporny
Copy link
Member

msporny commented May 26, 2024

The specification currently contains a section related to the integrity of related resources. There are two approaches that the WG is considering: digestSRI and digestMultibase.

This issue tracks the benefits and drawbacks of using either approach, or both approaches simultaneously, in the hope of unifying the approach taken across all specifications produced by the Working Group.

@msporny msporny added normative The PR is a normative change to the CR specification CR1 This item was processed during CR1 labels May 26, 2024
@msporny msporny self-assigned this May 26, 2024
@msporny
Copy link
Member Author

msporny commented May 28, 2024

The following is an attempt to summarize the arguments for and against the three options the group is contemplating:

Option A: Use digestSRI

This option chooses to use the same subresource integrity syntax that is used in the Subresource Integrity specification, which re-uses the primitives in Content Security Policy Level 2.

Benefits

  • The syntax is already defined in SRI and CSP2.
  • The algorithm header is human readable.

Drawbacks

  • No support for SHA-3, which is being strongly advised for new protocols by government standards bodies such as NIST.
  • No support for hash algorithms other than SHA-2.
  • Encoding is not URL safe (uses base64 instead of base64-url-nopad) so digest values cannot be expressed in URLs.
  • Not upgrade-able to newer hash algorithms without revising SRI, which this group has no authority over, and which hasn't been updated since 2016 (and is not likely to be updated anytime soon).

Option B: Use digestMultibase

This option chooses to use the newer Multibase-encoded Multihash syntax defined by Data Integrity.

Benefits

  • Defined in Data Integrity, which this Working Group has control over (so we can modify it as needed)
  • Supports both SHA-2 and SHA-3
  • Usable in URLs (via base64-url-nopad)
  • Self-describing, so automatically binary-compressible via compression formats that work with Multibase such as CBOR-LD
  • Ability to support "newer" hash formats such as Blake, Skein, and other variable hash length schemes
  • Useful outside of Verifiable Credentials (provides a generalized primitive for use elsewhere)
  • Encodeable in ways that makes it easier for humans to read (base58-btc encoding)

Drawbacks

  • Requires use of new libraries and conversion software.

Option C: Allow use of both digestSRI and digestMultibase

This option allows developers to choose to use either digestSRI and/or digestMultibase.

Benefits

  • All benefits of Option A and Option B.
  • Allows issuers to choose the option that best suits them.

Drawbacks

  • All drawbacks of Option A and Option B.
  • Requires verifiers to implement both options because some issuers will choose digestSRI while others choose digestMultibase.

@msporny
Copy link
Member Author

msporny commented May 28, 2024

PR #1490 has been raised to address this issue. This issue will be closed if PR #1490 is merged.

@msporny
Copy link
Member Author

msporny commented Jun 1, 2024

PR #1490 and #1492 has been raised to address this issue. This issue will be closed if PR #1490 or #1492 is merged.

@msporny
Copy link
Member Author

msporny commented Jun 9, 2024

PR #1492 has been merged, resulting in PR #1490 being closed, closing.

@msporny msporny closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 This item was processed during CR1 normative The PR is a normative change to the CR specification pr exists
Projects
None yet
Development

No branches or pull requests

1 participant