Giter Site home page Giter Site logo

merlinb / opaque Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nthparty/opaque

0.0 1.0 0.0 120 KB

JavaScript implementation of the OPAQUE asymmetric PAKE protocol

Home Page: https://www.npmjs.com/package/@nthparty/opaque

JavaScript 100.00%

opaque's Introduction

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).

opaque's People

Contributors

frederickjansen avatar wyatt-howe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.