v133 ยท miscellaneous

X25519 algorithm of the Web Cryptography API

The "X25519" algorithm provides tools to perform key agreement using the X25519 function specified in [RFC7748]. The "X25519" algorithm identifier can be used in the SubtleCrypto interface to access the implemented operations: generateKey, importKey, exportKey, deriveKey and deriveBits.

concepts

  1. X25519

    X25519 key agreement in Web Crypto. Modern, fast curve for ECDH on the web.

  2. Two-party ECDH handshake

    Alice and Bob each generate X25519 keypairs in WebCrypto and derive a shared secret over their public keys — with the secrets compared side by side.

  3. JWK / SPKI round-trip

    Export an X25519 public key as JWK and SPKI, re-import, derive bits against another party. The interop pattern libraries like libsodium-bridge and MLS need.

  4. End-to-end encrypted message

    Alice and Bob generate X25519 keypairs, exchange public keys, derive a shared AES-GCM key, and send an encrypted message โ€” all using real SubtleCrypto calls, no library.

why it shipped

The lack of a native implementation of the X25519 key agreement algorithm in Chrome's WebCrypto APIs forces web developers to rely on external libraries in order to get the advantages of the secure curves like Curve25519.

references