Skip to content

stef/liboprf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

liboprf

Overview

liboprf is a library for Oblivious Pseudorandom Functions (OPRFs), including support for Threshold OPRFs. It is designed to make advanced cryptographic protocols easy to integrate across applications.

What is an OPRF?

An Oblivious Pseudorandom Function (OPRF) is a two-party cryptographic primitive involving a sender and receiver who jointly compute a function, F, in such a way that:

  • The sender holds a secret key k
  • The receiver provides an input x
  • The receiver learns F(k, x) but nothing about k
  • The sender learns nothing about x or F(k, x)

OPRFs are the foundation for many privacy-preserving protocols including:

  • Password-based authentication without exposing passwords
  • Private set intersection, which allows two parties to find the intersection of their private sets without revealing the full sets
  • Privacy-preserving information retrieval, allowing users to get specific information from a database without revealing what information is being retrieved

Features

Basic OPRF

liboprf implements the basic OPRF(ristretto255, SHA-512) variant from the IRTF CFRG Draft, "Oblivious Pseudorandom Functions (OPRFs) using Prime-Order Groups".

Threshold OPRF

liboprf implements a threshold OPRF variant based on Krawczyk et al. (2017) which is compatible with the CFRG OPRF(ristretto255, SHA-512) variant. A threshold implementation distributes trust among multiple servers, requiring a minimum number (threshold) to cooperate for operation. It uses Distributed Key Generation (DKG) protocols, as described below, to distribute secret key shares among multiple servers.

3hashTDH

This library also implements the 3hashTDH from Gu, Jarecki, Kedzior, Nazarian, Xu (2024) "Threshold PAKE with Security against Compromise of all Servers". This implementation is compatible with the aforementioned IRTF CFRG OPRF(ristretto255, SHA-512) variant.

Distributed Key Generation (DKG)

For the threshold OPRF, liboprf provides:

Threshold OPRF Updates

To update a threshold OPRF instantiation, liboprf contains multi-party multiplication described in R. Gennaro, M. O. Rabin, and T. Rabin, "Simplified VSS and fast-track multiparty computations with applications to threshold cryptography" In B. A. Coan and Y. Afek, editors, 17th ACM PODC, pages 101–111. ACM, June/July 1998.

Installation

Dependencies

  • libsodium: You must install libsodium first. libsodium is a cryptographic library that provides a range of cryptographic operations including encryption, decryption, digital signatures, and secure password hashing.
  • pkgconf: Needed for building the library.

Building from source

git clone https://github.com/stef/liboprf.git
cd liboprf/src
make
sudo make install

Python Wrapper

A Python wrapper, pyoprf, is provided. Look at its README for installation and usage instructions.

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

About

library providing OPRF and Threshold OPRF based on libsodium

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •