Skip to content

kratess/FHE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FHE: Fully Homomorphic Encryption

This repository contains the codebase and experimental results for my thesis focused on the benchmarking and performance evaluation of Fully Homomorphic Encryption (FHE) schemes. The project utilizes the OpenFHE library to conduct systematic analysis across various encryption paradigms.

Thesis Context

The primary goal of this research is to evaluate the practical performance overheads of different FHE schemes, specifically CKKS, BGV, and BFV under varying security parameters and circuit depths. This suite serves as the empirical foundation for the comparative analysis presented in my thesis.

Key Features

  • Benchmarking: Comprehensive benchmarking of homomorphic encryption schemes, including BGV (integer), BFV (integer), and CKKS (floating point). Experiments systematically sweep multiplicative depths and ring dimensions, while profiling execution time and peak heap memory usage. An automated python pipeline generates comparative performance graphs for analysis.
  • Linear Regression: Test of linear regression model. WORK IN PROGRESS.

Project Structure

.
├── benchmark/      # Core C++ benchmark suite
│   ├── bfv/        # BFV (Brakerski-Fan-Vercauteren) benchmarks
│   ├── bgv/        # BGV (Brakerski-Gentry-Vaikuntanathan) benchmarks
│   ├── ckks/       # CKKS (Cheon-Kim-Kim-Song) benchmarks
│   └── results/    # Benchmark results
└── README.md

Benchmark Results

Below are the performance trends observed during the benchmark sweeps.

BGV (Brakerski-Gentry-Vaikuntanathan)

Execution Time Memory Usage
Encrypt Encrypt Memory
Decrypt Decrypt Memory
EvalAdd EvalAdd Memory
EvalMult EvalMult Memory
KeyGen KeyGen Memory
EvalKeyGen EvalKeyGen Memory
Context Creation Context Memory

BFV (Brakerski-Fan-Vercauteren)

Execution Time Memory Usage
Encrypt Encrypt Memory
Decrypt Decrypt Memory
EvalAdd EvalAdd Memory
EvalMult EvalMult Memory
KeyGen KeyGen Memory
EvalKeyGen EvalKeyGen Memory
Context Creation Context Memory

CKKS (Cheon-Kim-Kim-Song)

Execution Time Memory Usage
Encrypt Encrypt Memory
Decrypt Decrypt Memory
EvalAdd EvalAdd Memory
EvalMult EvalMult Memory
KeyGen KeyGen Memory
EvalKeyGen EvalKeyGen Memory
Context Creation Context Memory
Bootstrap Bootstrap Memory
Bootstrap KeyGen Bootstrap KeyGen Memory

Getting Started

Prerequisites

  • CMake >= 3.14
  • C++17 compliant compiler (GCC 11+, Clang 12+)
  • OpenFHE (Latest stable)
  • Python 3 (for visualization)

Installation, Build and Running

Test Environment

Benchmarks were performed on the following hardware/software stack:

  • CPU: AMD Ryzen 9800X3D
  • Memory: 48GB DDR5 @ 6000MHz (12GB Swap)
  • OS: Windows Subsystem for Linux (WSL)
  • Optimization: -march=native enabled.
  • Parallelism:
    • GenCryptoContext, used in BM_ContextCreation as test and also in the other cases to create the context without being accounted in execution time, is a single-core operation.
    • All other benchmark operations leverage multi-threading via OpenMP for maximum performance.

Important

Memory Disclaimer: Reported peak memory usage is obtained from the system allocator and reflects heap usage only. Values are indicative and may vary across environments (e.g., WSL vs bare metal); swap memory is not included.


Note: Benchmarks were performed on a local workstation using hardware optimization (-march=native). Results may vary based on CPU architecture and available memory.

License

This project is licensed under the BSD 2-Clause License - see the LICENSE file for details.

About

Fully Homomorphic Encryption - Benchmarks and Projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors