npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mp-psi

v0.1.8

Published

The package contains the APIs to build a multi party private set intersection web-app. Note that the package is not compatible with a node environment.

Downloads

4

Readme

MP-PSI

The package contains the APIs to build a multi party private set intersection web-app. Note that the package is not compatible with a node environment.

PSI stands for Private Set Intersection. It allows two parties to compute the intersection of their sets without revealing anything else about their sets.

BFV is a fully homomorphic encryption scheme. It allows to perform addition and multiplication on encrypted data. The PSI protocol made available in this library uses the BFV scheme to perform the encryption of the sets, compute the intersection and decrypt the result. In particular, the multiparty protocol is based on the paper Mouchet, Christian, et al. "Multiparty homomorphic encryption from ring-learning-with-errors.".

The source code for the npm package is available at https://github.com/gaussian-dev/MP-PSI/tree/main/pkg

Security Notice

This is a research project and is not meant to be used in production. The code has not been audited.

Install

Install the mp-psi package with npm:

npm i mp-psi

or yarn:

yarn add mp-psi

Usage in web-app

import init, { state0_bindgen, state1_bindgen, state2_bindgen, state3_bindgen, state4_bindgen } from "mp-psi";

init().then(() => {
const state0 = state0_bindgen();        
const bit_vector_a = [0, 1, 0, 0, 1, 0, 1, 0, 1, 1];
const state1 = state1_bindgen(state0.message_a_to_b, bit_vector_a);
const bit_vector_b = [1, 1, 1, 1, 1, 0, 1, 0, 0, 0];
const state2 = state2_bindgen(state0.private_output_a, state0.public_output_a, state1.message_b_to_a, bit_vector_b);
const state3 = state3_bindgen(state1.private_output_b, state1.public_output_b, state2.message_a_to_b);
const psi_output_a = state4_bindgen(state2.public_output_a, state3.message_b_to_a);
const psi_output_b = state3.psi_output;
});

A web-app example is available inside the pkg/index.html file here. You can test it by:

  • Cloning the repo
  • Serving the pkg directory with a local web server, (e.g. python3 -m http.server)
  • Visit http://localhost:8000 in your browser
  • Open the console. It will show you the result of the PSI protocol.