Skip to main content

MPyC -- Secure Multiparty Computation in Python

Project description

Binder Travis CI codecov Read the Docs PyPI

MPyC MPyC logo Secure 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 as well as 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.

See the MPyC homepage for more info and background.

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.

Installation:

Just run: python setup.py install (pure Python, no dependencies).

See demos for Python programs and Jupyter notebooks with lots of example code.

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

Notes:

  1. Python 3.6+ (Python 3.5 or lower is not sufficient).

  2. Installing package gmpy2 is optional, but will considerably enhance the performance of mpyc. As of December 12, 2021 with the release of gmpy2 2.1, installation has been simplified greatly: pip install gmpy2 is now supported on all major Linux/MacOS/Windows platforms via prebuilt wheels. If you use the conda package and environment manager, conda install gmpy2 should do the job.

  3. Use run-all.sh or run-all.bat in the demos directory to have a quick look at all pure Python demos. Demos bnnmnist.py and cnnmnist.py require NumPy, demo kmsurvival.py requires pandas, Matplotlib, and lifelines, and demo ridgeregression.py (and therefore demo multilateration.py) even require Scikit-learn. Also note the example Linux shell scripts and Windows batch files in the docs and tests directories.

  4. Directory demos\.config contains configuration info used to run MPyC with multiple parties. Also, Windows batch file gen.bat shows how to generate fresh key material for SSL. To generate SSL key material of your own, first run pip install cryptography (alternatively, run pip install pyOpenSSL, which will also install the cryptography package).

  5. To use the Jupyter notebooks demos\*.ipynb, you need to have Jupyter installed, e.g., using pip install jupyter. The latest version of Jupyter will come with IPython 7.x, which supports top-level await. For example, instead of mpc.run(mpc.start()) one can now simply write await mpc.start() anywhere in a notebook cell, even outside a coroutine.

  6. For Python 3.8+, you also get top-level await by running python -m asyncio to launch a natively async REPL. By running python -m mpyc instead you even get this REPL with the MPyC runtime preloaded!

Copyright © 2018-2021 Berry Schoenmakers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpyc-0.8.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpyc-0.8-py3-none-any.whl (82.9 kB view details)

Uploaded Python 3

File details

Details for the file mpyc-0.8.tar.gz.

File metadata

  • Download URL: mpyc-0.8.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for mpyc-0.8.tar.gz
Algorithm Hash digest
SHA256 ceb008382858201dff44bc6e26bee22fe763df7760da81769fcc0bf3d86096fb
MD5 61b6eb1e45f6ff7291ebc77fc359c47b
BLAKE2b-256 7a9576a800552c620d2c61eec6532673c9ea5dab8c7708e67c2be066a6942d3f

See more details on using hashes here.

File details

Details for the file mpyc-0.8-py3-none-any.whl.

File metadata

  • Download URL: mpyc-0.8-py3-none-any.whl
  • Upload date:
  • Size: 82.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for mpyc-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e08f3b01c61f035b89edfb8a3a125caddca2625ea29182f2801cb4d6c1aa8365
MD5 92c7aaac230d35102414b073c4a9e264
BLAKE2b-256 7adf2d431bdde3401aa75eadbebc771907962ee57ff93641e90f6d99d23ea991

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page