Skip to content

PROPOSAL: Add support for general (hardware backed) cryptographic signatures and key exchange #263

@ghost

Description

BACKGROUND AND CONTEXT

TECHNICAL TL;DR

  • WebAuthn currently supports cryptographic signatures only for authentication. The signed data are challenges randomly generated by relying parties (RPs).
  • WebAuthn is unique in that the cryptography it supports can leverage secure hardware — both hardware embedded in devices through platform authenticators and external hardware keys. This is different than all other web cryptography options like WebCrypto, which provide no standardized access to hardware. Hardware provides far stronger security guarantees than cryptography done in the browser.
  • There's a desire from the community for general hardware backed cryptographic signatures and key exchange, which could be used for a wide range of applications far beyond authentication (see below for examples). It's conceivable to use WebAuthn as it stands to enable some version of this (e.g. by passing a hashed document instead of a random challenge to be signed, to enable document signing), but such use is far from what the spec was intended for and complicates the security model (e.g. because the hashed document is deterministic, not random).
  • Hardware backed key exchange (e.g. ECDH) can enable more secure encryption, since a symmetric encryption key can be encrypted with an asymmetric key stored in hardware.
  • In terms of leveraging device hardware (e.g. the Secure Enclave in an iPhone), there's a puzzling gap between mobile and web. Mobile apps can easily leverage the hardware for general cryptography (including general signatures and key exchange) using the device OS. But web apps have no such ability. Achieving feature parity between cryptography on mobile and web would greatly simplify development of new apps and make achieving widespread adoption far easier.

PROPOSAL
Add support for general cryptographic signatures and key exchange, backed by either hardware native to the device or an external hardware key. Since WebCrypto already standardizes general cryptographic operations, this would be a straightforward extension of the curreny spec and could likely repurpose material from the WebAuthn spec. In a simple sense, this proposal is "WebAuthn + WebCrypto", i.e. the hardware access WebAuthn standardizes with the general crytpographic signatures (and key exchange?) WebCrypto standardizes.

The user experience can closely match both current WebAuthn implementations and mobile app cryptography flows:

  • The user is prompted to pass a platform authenticator check (e.g. Face ID on an iPhone) or insert a security key (e.g. a Yubikey). The check can create a "session" during which the user doesn't have to pass additional checks (e.g. 10 minutes od not needing to do Face ID again), with the limiting case being a session of zero duration so the user has to pass a check for every cryptographic function call.
  • (Behind the scenes:) The RP triggers the hardware to create an asymmetric key pair (ideally with some control over the algorithm/curve).
  • (Behind the scenes:) The RP passes data to the hardware to be signed. The hardware signs the data with the private key, never exposing it to the RP, and returns the result. Or, the RP triggers key exchange (e.g. using ECDH).

So, from the user's perspective, it's as simple as e.g. passing a biometric check. Everything else is invisible. This is exactly how mobile apps leverage hardware backed cryptography today.

USE CASES
This proposal amounts to enabling more secure cryptographic signatures and key exchange, so the use cases include the vast array of applications of those cryptographic methods! For example:

  • All current and future Web3 dApps, which rely on signatures for every operation (@cybercent has pointed this out in their comments here and in their proposal here)
  • Document signing
  • Encrypted cloud data storage
  • Secure peer-to-peer messaging
  • Data integrity protection
  • Transaction non-repudiation
  • Symmetric encryption protected by asymmetric signing

And on and on...

DIFFICULTIES

  • The WebAuthn WG decided against purusing this, and I can understand why. The name "WebAuthn" and the group's charter reflect WebAuthn's current, more narrow scope (authentication). It would be difficult to extend the spec to include use cases beyond authentication without changing the name.
  • Previous, somewhat similar efforts stalled out about five years ago. For example, see Hardware Based Secure Services features and the now dormant Hardware Based Secure Services Community Group

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions