lschoe / mpyc

MPyC: Multiparty Computation in Python
MIT License
367 stars 76 forks source link
bgw binder class-groups confidential-computing cryptography elliptic-curves finite-fields jupyter mpc multi-party-computation multiparty-computation privacy privacy-enhancing-technologies protocols python secret-sharing secure-multi-party-computation secure-multiparty-computation smpc threshold-cryptography

Binder Travis CI codecov Read the Docs PyPI

MPyC MPyC logo Multiparty Computation in Python

MPyC supports secure m-party computation tolerating a dishonest minority of up to t passively corrupt parties, where m ≥ 1 and 0 ≤ t < m/2. The underlying cryptographic protocols are based on threshold secret sharing over finite fields (using Shamir's threshold scheme and optionally pseudorandom secret sharing).

The details of the secure computation protocols are mostly transparent due to the use of sophisticated operator overloading combined with asynchronous evaluation of the associated protocols.

Documentation

Read the Docs for Sphinx-based documentation, including an overview of the demos.\ GitHub Pages for pydoc-based documentation.

See demos for Python programs and Jupyter notebooks with lots of example code. Click the "launch binder" badge above to view the entire repository and try out the Jupyter notebooks from the demos directory in the cloud, without any install.

The MPyC homepage has some more info and background.

Installation

Pure Python, no dependencies. Python 3.10+ (following SPEC 0 -- Minimum Supported Dependencies).

Run pip install . in the root directory (containing file pyproject.toml).\ Or, run pip install -e ., if you want to edit the MPyC source files.

Use pip install numpy to enable support for secure NumPy arrays in MPyC, along with vectorized implementations.

Use pip install gmpy2 to run MPyC with the package gmpy2 for considerably better performance.

Use pip install uvloop (or pip install winloop on Windows) to replace Python's default asyncio event loop in MPyC for generally improved performance.

Some Tips

Copyright © 2018-2024 Berry Schoenmakers