CrypTen

CrypTen

  • GitHub
  • Docs

CrypTenA research tool for secure machine learning in PyTorch

GitHub
Docs
Get Started

Secure Machine Learning

CrypTen is a new framework built on PyTorch to facilitate research in secure and privacy-preserving machine learning. CrypTen enables machine learning researchers, who may not be cryptography experts, to easily experiment with machine learning models using secure computing techniques. CrypTen lowers the barrier for machine learning researchers by integrating with the common PyTorch API.

Installation Script

Please see the CrypTen Docs.


pip install crypten

CrypTensors

CrypTensors encrypt data using familiar PyTorch syntax. For example:

 # PyTorch 
 x = torch.tensor([1, 2, 3])
 y = torch.tensor([4, 5, 6])
 z = x + y

 # CrypTen
 x_enc = crypten.cryptensor([1, 2, 3])
 y_enc = crypten.cryptensor([4, 5, 6])
 z_enc = x_enc + y_enc```

For more, checkout the Tutorials



How CrypTen Works

Overview

CrypTen currently implements a cryptographic method called secure multiparty computation (MPC), and we expect to add support for homomorphic encryption and secure enclaves in future releases. It works in the “honest but curious” model (assumes the absence of malicious and adversarial agents) that is usedfrequently in cryptographic research, but additional safeguards must be added before Crypten is ready to be used in production settings

Multi-Party Compute: An Example

MPC encrypts information by dividing data between multiple parties, who can each perform calculations on their share (in this example, 5 and 7) but are not able to read the original data (12).

Each party then computes (“multiply by 3”). When the outputs are combined, the result (36) is identical to the result of performing the calculation on the data directly. Since Party A and Party B do not know the end result (36) they can not deduce the original data point (12).

Facebook Open Source
Copyright © 2019 Facebook