Skip to content
/ CryptoFL Public

Cryptographically Secure Aggregation for Federated Learning

License

Notifications You must be signed in to change notification settings

Ye-D/CryptoFL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoFL: Cryptographically Secure Aggregation for Federated Learning

Table of Contents

Warning


This codebase is released solely as a reference for other developers, as a proof-of-concept, and for benchmarking purposes. In particular, it has not had any security review, has a number of implementational TODOs, has a number of known bugs (especially in the ABY-based Secure Aggregation), and thus, should be used at your own risk. You can contribute to this project by creating pull requests and submitting fixes and implementations.

Requirements


  • The code should work on most Linux distributions (It has been developed and tested with Ubuntu 16.04 and 18.04).

  • Required packages for CryptoFL:

    Install these packages with your favorite package manager, e.g, sudo apt-get install <package-name>.

Source Code


Repository Structure

  • Common/Grpc - The grpc proto defined, generated by Common/Grpc/grpc.sh

  • Common/Handler - Class Handler for Secure Aggregation.

  • Common/Model - Neural Network definitions.

  • Common/Node - Base Class for Client (a.k.a., Worker).

  • Common/Server - Base Class for Server.

  • Common/Utils - data loader, split, and some other basic algorithms.

  • Data - The distributed splitted dataset.

  • log - logs.

  • Model - The initilized and frozen Neural Networks.

  • SA_Lib - The Secure Aggregation Library, and is implemeted on the top of ABY and pybind.

  • Clear-Agg-Eva - The cleartext aggregation methods for FL:

    • s
  • TPC_SS_Dense - Implemtation of the semi-honest Secure Aggregation of DCS'19.

Building the code

To build your SA, run the following commands:

Implement your own ABY-based 2PC Secure Aggregation protocols. Then, run

cd SA_Lib
./build.sh

Next, bind your 2PC protocols with py in cryptofl_handler.py.

Running the code

To run the code, simply choose one of the following options:

  • Server: run 2 python xx_server.py for Secure Aggregation. Need only one server for cleartext aggregation;
  • Client: run each python xx_client.py independently. start.sh gives a bash shell.

Bugs

Note that there might be bugs in ABY and some py import path on your machine.

TODO

  • Fix the bugs in Secure Aggregation protocols.
  • Add more MPC libraries for Secure Aggregation in addition to ABY.
  • Implement secure FL protocols, including EaSTFLy and FLOD.

For questions, please create git issues; for eventual replies, you can also reach out to 19950512dy@gmail.com

About

Cryptographically Secure Aggregation for Federated Learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published