/REDsec

Primary LanguageC++MIT LicenseMIT

REDsec: Running Encrypted Discretized Neural Networks in Seconds

REDsec is an end-to-end framework for encrypted neural network inference using the CGGI cryptosystem. The TFHE and (RED)cuFHE libraries are utilized as cryptographic backends. A video presentation of REDsec is available here.

Prerequisites

Encrypted Inference with CPUs

Install TFHE v1.1 with the packaged SPQLIOS-FMA FFT engine.

Encrypted Inference with NVIDIA GPUs

Install (RED)cuFHE

Core Library Build Instructions

  1. Clone the repo: git clone https://github.com/TrustworthyComputing/REDsec.git
  2. Navigate to library source directory: cd REDsec/lib
  3. Build one (or more) of the desired library variants: make ptxt && make cpu-encrypt && make gpu-encrypt

Creating and Training Networks (CLOUD)

REDsec has a BYON framework. The tutorial and compiler are located here.

Generating Keysets and Encryption/Decryption (CLIENT)

  1. Navigate to client directory: cd REDsec/client
  2. Generate FHE keypair by following the brief instructions printed by make keygen-help
  3. Encrypt an image (in CSV format) by following instructions printed by make encrypt-image-help
  4. After the inference procedure is run, follow the instructions printed by make decrypt-image-help

Getting Started with Encrypted Inference (CLOUD)

  1. Navigate to a network of your choice (e.g. cd REDsec/nets/mnist/sign1024x1)
  2. (Optional) Verify network accuracy: make ptxt
  3. Build and run one (or more) encrypted network variants : make cpu-encrypt for TFHE (CPU) backend and make gpu-encrypt for (RED)cuFHE (GPU) backend

Cite this work

This library was introduced in the REDsec paper, which presents a framework for privacy-preserving neural network inference and will appear in the NDSS Symposium 2023 (Cryptology ePrint Archive):

@inproceedings{folkerts2023redsec,
    author       = {Lars Folkerts and Charles Gouert and Nektarios Georgios Tsoutsos},
    title        = {{REDsec: Running Encrypted Discretized Neural Networks in Seconds}},
    booktitle = {{Network and Distributed System Security Symposium (NDSS)}},
    pages        = {1--17},
    year         = {2023},
}

Trustworthy Computing Group