Gabes: Garbled Circuits in Python
Introduction
Garbled Circuits allow two distrusting parties to compute a joint function while keeping their inputs private. More precisely, it allows Alice with input x and Bob with input y to compute a function f(x, y) without Alice ever knowing y and without Bob knowing x. The way it does so is by first translating f to a boolean circuit from which it will cleverly obfuscate or garble the circuit to allow the computation of f while keeping the inputs private.
The classical example is that of two millionaires who wish to find out who is richer without revealing their wealth. In that case, f becomes the “>” (greater than) function, and x and y are their wealth.
Gabes implements garbled circuits in Python. The application runs as a command line interface but the functions required to run garbled circuits can be used without the command line (see gabes).
Installation
At the command line either via pip:
$ pip install gabes
Or, if you have virtualenvwrapper installed:
$ mkvirtualenv gabes $ pip install gabes
Usage
Each party will run their own instance of the program on their computer as a CLI app. The garbler will provide the IP and port number to establish the connection with the evaluator.
Garbler’s Side:
gabes -g -grr3 -c Desktop/my-circuit.circuit -a localhost:5000
Evaluator’s Side:
gabes -e -grr3 -a localhost:5000
Flags
usage: gabes [-h] [-g] [-e] [-b bits] [-i identifier [identifier ...]]
[-c file] -a ip:port [-cl] [-pp] [-grr3] [-free] [-grr2]
[-fle] [-half]
Program to garble and evaluate a circuit.
optional arguments:
-h, --help show this help message and exit
-g, --garbler Set this flag to become the garbler
-e, --evaluator Set this flag to become the evaluator
-b bits, --bits bits Include your private input bitstring to the circuit
(e.g. 001011)
-i identifier [identifier ...], --identifiers identifier [identifier ...]
Indicate which input wires you supply to the circuit
(e.g. -i A C D)
-c file, --circuit file
Path of the file representing the circuit. Only the
garbler needs to supply the file
-a ip:port, --address ip:port
IP address followed by the port number
-cl, --classical Set this flag for classical garbled circuits
-pp, --point-and-permute
Set this flag to include point-and-permute
-grr3, --grr3 Set this flag for GRR3 garbled circuits
-free, --free-xor Set this flag for free-xor garbled circuits
-fle, --flexor Set this flag for flexor garbled circuits
-half, --half-gates Set this flag for half gates garbled circuits
Documentation
All the documentation can be found in https://gabes.readthedocs.io/en/latest/
Metadata
Release files for gabes 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gabes-0.1.5.tar.gz | 22.2 kB | Without provenance | Details for gabes-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gabes-0.1.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for gabes-0.1.5-py2.py3-none-any.whl |
Total release size: 45.7 kB
Release files / gabes-0.1.5.tar.gz
| Download URL | gabes-0.1.5.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c32a917b8060f0556ff597f882af0523a6b6b93ef048247c72a73ee6c7160d06
|
|
BLAKE2b-256 checksum How to use checksums |
82521cce07cd2bc2c5888314086489a70e213327bf6236acf74635305c616873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / gabes-0.1.5-py2.py3-none-any.whl
| Download URL | gabes-0.1.5-py2.py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
81660c43ecec7d37612b94275aa3e7786c924ab3223e76978a611af7d1936033
|
|
BLAKE2b-256 checksum How to use checksums |
218bcb6432a39350267e43106729598bf79b3281f085a86fca846c749f114af5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for gabes 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.