@zippie/opaque-wasm
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-pre.2 • Public • Published

opaque-wasm-js

An implementation of the OPAQUE key exchange protocol in WASM(WebAssembly) hosted by the browser. The library was founded on the basis of opaque-ke.

Note: This package will be published in npm when version 0.3.x of opaque-ke has been stable.

Build ES6 package

wasm-pack build

Build for NodeJs

wasm-pack build --target nodejs

JS simple example of usage

import { Registration, Login } from "opaque-wasm";

const password = "asdf123";
const email = "myawesomeapp@seerv.dev";

try {
  const registration = new Registration();
  const firstMessage = registration.start(password);
  const secondMessage = await sendMessageToServer(firstMessage);
  const thirdMessage = registration.finish(secondMessage);
  const { status } = await sendMessageToServer(thirdMessage, { email });

  console.log(status); // 204 - Server Return ok, user account has been created

  const login = new Login();
  const firstLoginMessage = login.start(password);
  const secondLoginMessage = await sendMessageToServer(firstLoginMessage, email);
  const thirdLoginMessage = login.finish(secondLoginMessage);
  const sessionKey = login.get_session_key();
  await sendMessageToServer(thirdLoginMessage);

  console.log(sessionKey); // eyhojo55....
} catch (e) {
  console.error(e);
}

Readme

Keywords

none

Package Sidebar

Install

npm i @zippie/opaque-wasm

Weekly Downloads

1

Version

0.1.0-pre.2

License

none

Unpacked Size

230 kB

Total Files

5

Last publish

Collaborators

  • stskeeps-zippie
  • tswindell
  • p4ker
  • cosmin.ionascu