federated-approx-boolean

command module
v0.0.0-...-a299d89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

This code is associated with the following manuscript: Leighton, Alexander T., and Yu, Yun William. "Secure federated Boolean count queries using fully-homomorphic cryptography." In International Conference on Research in Computational Molecular Biology, pp. 54-67. Cham: Springer Nature Switzerland, 2024. https://link.springer.com/chapter/10.1007/978-1-0716-3989-4_4

Update 2026-09-18

This code was written as a research prototype. Do NOT use it for production. The underlying libraries have known security vulnerabilities.

Requirements

  • Golang 1.21.1
  • Lattigo v4.0
  • Golang iter library
  • Python v3 (and "pip3 install mmh3 scikit-learn numpy")

Please go to https://go.dev/doc/install for Golang install requirements.

Quick-start simulation

Once Golang and the necessary Python libraries are installed, clone this Git repo and run the following:

python3 generate_samples.py [num_parties] [num_conditions] [num_buckets]

[num_buckets] is only used for the initial LogLog sketch in the simulation, to determine the downsampling rate. That LogLog union-count query can also be done in a homomorphic encryption framework using the code at https://github.com/atleighton/rlwe-hll which is implemented in the alternate homomorphic encryption framework Palisade.

Note that generate_samples.py will also run the full Boolean count query sampling in plaintext, so that we can later verify the results of running the same computation in ciphertext. It will also output a samples.txt which contains the bitvectors that the Go program will union and intersect in ciphertext.

We will then run the Go benchmarking program twice, once to get unions, and the other time to get intersections.

go run main.go u [num_parties] [num_conditions] [num_buckets] samples.txt
go run main.go i [num_parties] [num_conditions] [num_buckets] samples.txt

The respective outputs can be checked against the plaintext computation earlier.

Note that for prototyping purposes, num_parties, num_conditions, and num_buckets should all be powers of 2.

Acknowledgements

Code is heavily modified, but based off code at https://github.com/tuneinsight/lattigo/blob/master/examples/dbfv/psi/main.go, with modifications made by yunwilliamyu.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址