/ README.md
README.md
1 # liboprf 2 3 ## Overview 4 5 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. 6 7 ## What is an OPRF? 8 9 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: 10 - The sender holds a secret key `k` 11 - The receiver provides an input `x` 12 - The receiver learns `F(k, x)` but nothing about `k` 13 - The sender learns nothing about `x` or `F(k, x)` 14 15 OPRFs are the foundation for many privacy-preserving protocols including: 16 - Password-based authentication without exposing passwords 17 - Private set intersection, which allows two parties to find the intersection of their private sets without revealing the full sets 18 - Privacy-preserving information retrieval, allowing users to get specific information from a database without revealing what information is being retrieved 19 20 ## Features 21 22 ### Basic OPRF 23 liboprf implements the basic OPRF(ristretto255, SHA-512) variant from the [IRTF CFRG Draft](https://github.com/cfrg/draft-irtf-cfrg-voprf/), "Oblivious Pseudorandom Functions (OPRFs) using Prime-Order Groups". 24 25 ### Threshold OPRF 26 liboprf implements a threshold OPRF variant based on [Krawczyk et al. (2017)](https://eprint.iacr.org/2017/363) which is compatible with the [CFRG OPRF(ristretto255, SHA-512) variant](#basic-oprf). 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. 27 28 ### 3hashTDH 29 This library also implements the 3hashTDH from [Gu, Jarecki, Kedzior, Nazarian, Xu (2024)](https://eprint.iacr.org/2024/1455) "Threshold PAKE with Security against Compromise of all Servers". This implementation is compatible with the aforementioned [IRTF CFRG OPRF(ristretto255, SHA-512)](#basic-oprf) variant. 30 31 ### Distributed Key Generation (DKG) 32 For the [threshold OPRF](#threshold-oprf), liboprf provides: 33 34 - **Trusted Party DKG**: An implementation based on Joint Feldman DKG (JF-DKG) from the paper "[Secure Distributed Key Generation for Discrete-Log Based Cryptosystems](https://link.springer.com/article/10.1007/s00145-006-0347-3)" by R. Gennaro, S. Jarecki, Hugo Krawczyk & T. Rabin. 35 36 - **Semi-trusted DKG**: Implements Fast-Track Joint Verifiable Secret Sharing (FT-Joint-DL-VSS) described in R. Gennaro, M. O. Rabin, and T. Rabin, "[Simplified VSS and fast-track multiparty computations with applications to threshold cryptography](https://dl.acm.org/doi/10.1145/277697.277716)" In B. A. Coan and Y. Afek, editors, 17th ACM PODC, pages 101–111. ACM, June/July 1998. 37 38 ### Threshold OPRF Updates 39 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](https://dl.acm.org/doi/10.1145/277697.277716)" In B. A. Coan and Y. Afek, editors, 17th ACM PODC, pages 101–111. ACM, June/July 1998. 40 41 ## Installation 42 43 ### Dependencies 44 - **libsodium**: You must install [libsodium](https://github.com/jedisct1/libsodium) first. libsodium is a cryptographic library that provides a range of cryptographic operations including encryption, decryption, digital signatures, and secure password hashing. 45 - **pkgconf**: Needed for building the library. 46 47 ### Building from source 48 49 ```bash 50 git clone https://github.com/stef/liboprf.git 51 cd liboprf/src 52 make 53 sudo make install 54 ``` 55 56 ### Python Wrapper 57 A Python wrapper, `pyoprf`, is provided. Look at [its README](/python/README.md) for installation and usage instructions. 58 59 60 ## Funding 61 62 This project is funded through [NGI0 Entrust](https://nlnet.nl/entrust), a fund 63 established by [NLnet](https://nlnet.nl) with financial support from the 64 European Commission's [Next Generation Internet](https://ngi.eu) program. Learn 65 more at the [NLnet project page](https://nlnet.nl/project/ThresholdOPRF). 66 67 [<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl) 68 [<img src="https://nlnet.nl/image/logos/NGI0_tag.svg" alt="NGI Zero Logo" width="20%" />](https://nlnet.nl/entrust)