VexaHub
France

@vexahub/opaque-client (0.0.1-alpha.0)

Published 2026-05-14 09:49:51 +02:00 by breakingbread

Installation

@vexahub:registry=https://dev.unebaguette.fr/api/packages/vexahub/npm/
npm install @vexahub/[email protected]
"@vexahub/opaque-client": "0.0.1-alpha.0"

About this package

OPAQUE (RFC 9807) client (WASM)

@vexahub/opaque-client

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

Built in Rust, compiled to WASM.

Part of the @vexahub/opaque project.

Install

npm install @vexahub/opaque-client

Usage

import { startRegistration, finishRegistration, startLogin, finishLogin } from '@vexahub/opaque-client';

// Registration
const { clientRegistrationState, registrationRequest } = startRegistration({ password });

// ... send registrationRequest to server, receive registrationResponse ...

const { registrationRecord, exportKey, serverStaticPublicKey } = finishRegistration({
  password,
  registrationResponse,
  clientRegistrationState,
});

// Login
const { clientLoginState, startLoginRequest } = startLogin({ password });

// ... send startLoginRequest to server, receive loginResponse ...

const result = finishLogin({
  clientLoginState,
  loginResponse,
  password,
});

if (!result) throw new Error('Login failed');
const { finishLoginRequest, sessionKey, exportKey, serverStaticPublicKey } = result;

Key Stretching

The default KSF preset is MemoryConstrained (Argon2id, 64 MiB, t=3, p=4).

Pass keyStretching to finishRegistration and finishLogin to override:

finishRegistration({
  password,
  registrationResponse,
  clientRegistrationState,
  keyStretching: 'vexahub', // 128 MiB, t=3, p=4
});

Available presets: high, memory-constrained, vexahub, or custom:

keyStretching: { custom: { memory: 131072, iterations: 3, parallelism: 4 } }

Memory limit for custom is 1 GiB (1048576 KiB) otherwise it will throw an error.

We recommended that you use high preset if you reach that limit.

Package Description
@vexahub/opaque Client + server combined
@vexahub/opaque-server Server only

License

This package is dual-licensed under the MIT License or Apache-2.0 License.

Keywords

opaque pake authentication wasm
Details
npm
2026-05-14 09:49:51 +02:00
0
MIT OR Apache-2.0
109 KiB
Assets (1)
Versions (5) View all
0.0.1-alpha.4 2026-06-14
0.0.1-alpha.3 2026-06-14
0.0.1-alpha.2 2026-05-14
0.0.1-alpha.1 2026-05-14
0.0.1-alpha.0 2026-05-14