Skip to main content

A Framework for Machine Learning on Encrypted Data.

Project description

TF Encrypted

TF Encrypted is a framework for encrypted machine learning in TensorFlow. It looks and feels like TensorFlow, taking advantage of the ease-of-use of the Keras API while enabling training and prediction over encrypted data. Under the hood, TF Encrypted integrates state-of-the-art cryptography like secure multi-party computation, and homomorphic encryption. TF Encrypted aims to make privacy-preserving machine learning readily available, without requiring expertise in cryptography, distributed systems, or high performance computing.

TF Encrypted 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, explore the examples, or visit the documentation to learn more about how to use the library. You are also more than welcome to join our Slack channel for all questions around use and development.

Status License PyPI CircleCI Badge Documentation

Installation

TF Encrypted is available as a package on PyPI supporting Python 3.5+ and TensorFlow 1.12.0+ which can be installed using:

pip3 install tf-encrypted

Alternatively, installing from source can be done using:

git clone https://github.com/tf-encrypted/tf-encrypted.git
cd tf-encrypted
pip3 install -r requirements.txt
pip3 install -e .

This latter is useful on platforms for which the pip package has not yet been compiled but is also needed for development. Note that this will get you a working basic installation, yet a few more steps are required to match the performance and security of the version shipped in the pip package, see the installation instructions.

Usage

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():
    # normal 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 the documentation or the examples.

Roadmap

  • High-level APIs for combining privacy and machine learning. So far TF Encrypted is focused on its low-level interface but it's time to figure out what it means for interfaces such as Keras when privacy enters the picture.

  • Tighter integration with TensorFlow. This includes aligning with the upcoming TensorFlow 2.0 as well as figuring out how TF Encrypted can work closely together with related projects such as TF Privacy and TF Federated.

  • Support for third party libraries. While TF Encrypted has its own implementations of secure computation, there are other excellent libraries out there for both secure computation and homomorphic encryption. We want to bring these on board and provide a bridge from TensorFlow.

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 postponed 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.

Support

Please open an issue or feel free to reach out directly on Slack.

Contributing

Check out our contribution guide for more information!

Don't hesitate to send a pull request, open an issue, or ask for help! You can do so either via GitHub or by joining our Slack channel.

The project was originally started by Morten Dahl but has since benefitted enormously from the efforts of several contributors, most notably Dropout Labs and members of the OpenMined community:

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-encrypted-0.5.5.tar.gz (519.2 kB view details)

Uploaded Source

Built Distributions

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

tf_encrypted-0.5.5-py3-none-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded Python 3

tf_encrypted-0.5.5-py3-none-macosx_10_11_x86_64.whl (1.2 MB view details)

Uploaded Python 3macOS 10.11+ x86-64

File details

Details for the file tf-encrypted-0.5.5.tar.gz.

File metadata

  • Download URL: tf-encrypted-0.5.5.tar.gz
  • Upload date:
  • Size: 519.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.7

File hashes

Hashes for tf-encrypted-0.5.5.tar.gz
Algorithm Hash digest
SHA256 febcfd3286196b2df07ba4162f5f4b4096430dc2e1b682bb91f5bcc84315331a
MD5 0b3534875bee7454ca24f8acbfc8db2b
BLAKE2b-256 772ed03fa407cc5257ea5ab316fa13ce3d8c9b455ec35bc2f2fb7385578cec0b

See more details on using hashes here.

File details

Details for the file tf_encrypted-0.5.5-py3-none-manylinux1_x86_64.whl.

File metadata

  • Download URL: tf_encrypted-0.5.5-py3-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.7

File hashes

Hashes for tf_encrypted-0.5.5-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 708a68b8b540c597ff6ad759aec53b206c7e1700238915ef1425463eff91dcc9
MD5 50aa32e36c5d209854decc71be4aa232
BLAKE2b-256 c64fb785dd7286a7ebaf25af213dff11100ca09d6ff82d6186ffe0ba72e593ad

See more details on using hashes here.

File details

Details for the file tf_encrypted-0.5.5-py3-none-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: tf_encrypted-0.5.5-py3-none-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, macOS 10.11+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6

File hashes

Hashes for tf_encrypted-0.5.5-py3-none-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 976791adddc7897e9e5cdc9a87c4250b10190376f46a9e88ed2ba1c8ca44d858
MD5 965dfcb1e09cbdaf821336fb08a85ad4
BLAKE2b-256 d2f9785d1073aab47cafd6f7b0404b5e12f9df893eef7f541ef92fd2391f38b5

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