Skip to content

0xTCG/sequre

Repository files navigation

Sequre (with Shechi)

Sequre and Shechi are an end-to-end, statically compiled and performance engineered, Pythonic framework for building efficient secure multiparty computation (MPC), homomorphic encryption (HE), and multiparty homomorphic encryption (MHE) pipelines in bioinformatics.

Installation

Note: Sequre/Shechi runs only on Linux at the moment.

Install Codon first:

mkdir $HOME/.codon && curl -L https://github.com/exaloop/codon/releases/download/v0.17.0/codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz | tar zxvf - -C $HOME/.codon --strip-components=1

Then install Sequre:

curl -L https://github.com/0xTCG/sequre/releases/download/v0.0.20-alpha/sequre-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz | tar zxvf - -C $HOME/.codon/lib/codon/plugins

Afterwards, add alias for sequre command:

alias sequre="find . -name 'sock.*' -exec rm {} \; && CODON_DEBUG=lt $HOME/.codon/bin/codon run --disable-opt="core-pythonic-list-addition-opt" -plugin sequre"

Run

Clone the repository:

git clone https://github.com/0xTCG/sequre.git && cd sequre

and check the code in the examples for quick insight into Sequre.

Local run

sequre examples/local_run.codon

This will simulate the run in a two-party setup with a trusted dealer.

Online run

At each party run:

SEQURE_CP_IPS=<ip1>,<ip2>,...,<ipN> sequre examples/online_run.codon <pid>

where <ipN> denotes the IP address of each party and <pid> denotes the ID of the party.

For example, in a two-party setup with a trusted dealer, run (IP addresses are random):

SEQURE_CP_IPS=192.168.0.1,192.168.0.2,192.168.0.3 sequre examples/online_run.codon 0

at a trusted dealer (CP0).

SEQURE_CP_IPS=192.168.0.1,192.168.0.2,192.168.0.3 sequre examples/online_run.codon 1

at the first party (CP1).

SEQURE_CP_IPS=192.168.0.1,192.168.0.2,192.168.0.3 sequre examples/online_run.codon 2

at the second party (CP2).

Release mode

For (much) better performance but without debugging features such as backtrace, add -release flag immediatelly after sequre command:

sequre -release examples/local_run.codon --skip-mhe-setup

Note: --skip-mhe-setup flag disables the homomorphic encryption setup since examples/local_run.codon runs only Sequre (SMC).

Benchmarks (USENIX Security 2025)

Note: We generate all data at random for easier testing. For the original data (from dbGaP under accession phs000716.v1.p1), please consult the authors.

Run all USENIX Security 2025 benchmarks after cloning Sequre repository:

git clone https://github.com/0xTCG/sequre.git && cd sequre

Local run (single machine)

sequre -release scripts/invoke.codon run-benchmarks --local --jit --stdlib-builtin --king --pca --gwas-without-norm

Online run

Set each <ipN> to the respective IP address and <pid> to the respective ID. Please see the online run example above.

SEQURE_CP_IPS=<ip1>,<ip2>,...,<ipN> sequre -release scripts/invoke.codon run-benchmarks --jit --stdlib-builtin --king --pca --gwas-without-norm <pid>

Check accuracy

Check the accuracy of all solutions against the ground truth:

python scripts/accuracy.py