Socket
Book a DemoInstallSign in
Socket

@nthparty/opaque

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nthparty/opaque

JavaScript implementation of the OPAQUE asymmetric password authenticated key exchange (aPAKE) protocol

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
7
133.33%
Maintainers
3
Weekly downloads
 
Created
Source

OPAQUE.js

JavaScript implementation of the OPAQUE asymmetric PAKE (aPAKE) protocol

Protocol

Implementation of this Internet Draft proposal.

Installation

You may also install this module from npm.

npm install @nthparty/opaque

Calling the API

The process generally works as follows:

// Each party includes the 1-out-of-n module with IO:
const OT = require('@nthparty/opaque')(IO);

// Login credentials never reaches the server in plaintext
const user_id = 'newuser';
const password = 'correct horse battery staple';

// Sign up
OPAQUE.client_register(password, user_id).then(console.log.bind(null, 'Registered:'));

// Log in for the first time and receive a session token
OPAQUE.client_authenticate(password, user_id).then(console.log.bind(null, 'Shared secret:'));

// Register a new user
let user = OPAQUE.server_register();

// Handle a login attempt
OPAQUE.server_authenticate(user.id, user.pepper);

// Result:
'Registered: true'
'Login for newuser succeeded with: 4ccdf3b8cacf08273a085c952aaf3ee83633e6afcedf4f86c00497e862f43c78'
'Shared secret: 4ccdf3b8cacf08273a085c952aaf3ee83633e6afcedf4f86c00497e862f43c78'

Please read opaque.test.js for a more detailed example, and run npm test to test it (requires npm ci -also=dev first to install dependencies).

Keywords

asymmetric

FAQs

Package last updated on 14 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.