Skip to main content

Layer on top of TensorFlow for doing machine learning on encrypted data.

Project description

tf-encrypted

Status License PyPI CircleCI Badge Documentation

tf-encrypted is a Python library built on top of TensorFlow for researchers and practitioners to experiment with privacy-preserving machine learning. It provides an interface similar to that of TensorFlow, and aims at making the technology readily available without first becoming an expert in machine learning, cryptography, distributed systems, and high performance computing.

In particular, the library focuses on:

  • Usability: The API and its underlying design philosophy make it easy to get started, use, and integrate privacy-preserving technology into pre-existing machine learning processes.
  • Extensibility: The architecture supports and encourages experimentation and benchmarking of new cryptographic protocols and machine learning algorithms.
  • Performance: Optimizing for tensor-based applications and relying on TensorFlow's backend means runtime performance comparable to that of specialized stand-alone frameworks.
  • Community: With a primary goal of pushing the technology forward the project encourages collaboration and open source over proprietary and closed solutions.
  • Security: Cryptographic protocols are evaluated against strong notions of security and known limitations are highlighted.

See below for more background material or visit the documentation to learn more about how to use the library.

The project has benefitted enormously from the efforts of several contributors following its original implementation, most notably Dropout Labs and members of the OpenMined community. See below for further details.

Installation & Usage

tf-encrypted is available as a package on PyPI supporting Python 3.5+ which can be installed using pip:

$ pip install tf-encrypted

The following is an example of simple matmul on encrypted data using tf-encrypted:

import tensorflow as tf
import tf_encrypted as tfe

def provide_input():
    # local TensorFlow operations can be run locally
    # as part of defining a private input, in this
    # case on the machine of the input provider
    return tf.ones(shape=(5, 10))

# define inputs
w = tfe.define_private_variable(tf.ones(shape=(10,10)))
x = tfe.define_private_input('input-provider', provide_input)

# define computation
y = tfe.matmul(x, w)

with tfe.Session() as sess:
    # initialize variables
    sess.run(tfe.global_variables_initializer())
    # reveal result
    result = sess.run(y.reveal())

For more information, check out our full getting started guide in the documentation.

Background & Further Reading

The following texts provide further in-depth presentations of the project:

Project Status

tf-encrypted is experimental software not currently intended for use in production environments. The focus is on building the underlying primitives and techniques, with some practical security issues post-poned for a later stage. However, care is taken to ensure that none of these represent fundamental issues that cannot be fixed as needed.

Known limitations

  • Elements of TensorFlow's networking subsystem does not appear to be sufficiently hardened against malicious users. Proxies or other means of access filtering may be sufficient to mitigate this.
  • The pseudo-random generators provided in TensorFlow are not cryptographically strong. Custom ops could easily be used to remedy this.

Contributions

Don't hesitate to send a pull request, open an issue, or ask for help!

Several individuals have already had an impact on the development of this library (in alphabetical order):

and several companies have invested significant resources:

  • Dropout Labs continues to sponsor a large amount of both research and engineering
  • OpenMined was the breeding ground for the initial idea and continues to support discussions and guidance

License

Licensed under Apache License, Version 2.0 (see LICENSE or http://www.apache.org/licenses/LICENSE-2.0). Copyright as specified in NOTICE.

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

tf-encrypt-0.0.1.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

tf_encrypt-0.0.1-py3-none-any.whl (891.0 kB view details)

Uploaded Python 3

File details

Details for the file tf-encrypt-0.0.1.tar.gz.

File metadata

  • Download URL: tf-encrypt-0.0.1.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.6

File hashes

Hashes for tf-encrypt-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6679c78a603d8be62425c72b6d2085c4e8c0fac22c6d7d75e22c03d4bf082f76
MD5 778f84ad5a48295e2f256720e60111ad
BLAKE2b-256 7be24e13ea194adfeaa19b5ee5d62de32d3573eefe89b9e90809870d3946dc3c

See more details on using hashes here.

File details

Details for the file tf_encrypt-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tf_encrypt-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 891.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.6

File hashes

Hashes for tf_encrypt-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 075fd91c8a26888add8072ef7f197575f4397346e57af00b72e12d40a7efeba6
MD5 3dc6c4ac578f8c4eed9467442c73aae0
BLAKE2b-256 88cdca6b7c5b8a43dfd792561e1802e8523f97da6de1f294f63ddd3c72a57b44

See more details on using hashes here.

Supported by

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