Skip to content

structured-id/opaque

Repository files navigation

@structured-id/opaque

CI/CD codecov npm

OPAQUE (RFC 9807) client library for browser and Node.js environments.

Installation

npm install @structured-id/opaque

Usage

import { OpaqueClient } from '@structured-id/opaque';

const client = new OpaqueClient({ serverId: 'auth.example.com' });

// Registration
const reg = await client.registrationStart(password);
// Send `reg.request` to server, receive `serverResponse`
const { record, exportKey } = await client.registrationFinish(password, serverResponse, reg.state);

// Login
const login = await client.loginStart(password);
// Send `login.request` to server, receive `serverResponse`
const { finalization, sessionKey, exportKey: loginExportKey } = await client.loginFinish(
  password,
  serverResponse,
  login.state,
);

Features

  • RFC 9807 OPAQUE — Standard password-authenticated key exchange (PAKE)
  • Zero-Knowledge Password Policy (ZKPP) — Cryptographic proof that password meets policy constraints without revealing the password
  • WASM support — Core cryptographic operations compiled to WASM binary for performance and security
  • Fallback support — Systems without WASM support fall back to standard RFC 9807

Status

Production-ready for RFC 9807. WASM-compiled core crypto operations require modern browsers with WebAssembly support.

License

Apache-2.0

About

OPAQUE (RFC 9807) client library for TypeScript — pure JS, WebCrypto, zero WASM

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors