My Google Summer of Code 2020 Journey with OpenMined

Published on: August 27, 2020

#GSoC#Openmined#Homomorphic-Encryption#Cryptography#Open-source

In the summer of 2020, I had the amazing opportunity to contribute to open-source through Google Summer of Code (GSoC). I worked with OpenMined on a project that combined cryptography and machine learning: implementing the Fan-Vercauteren Homomorphic Encryption scheme in PySyft.

🔍 Project Overview

  • Name: Ravikant Singh
  • Organization: OpenMined
  • Project: Implement Fan-Vercauteren Homomorphic Encryption Scheme in PySyft
  • Mentor: Ayoub Benaissa

🧠 Goal

The aim was to implement the Fan-Vercauteren (FV) Homomorphic Encryption scheme in Python within PySyft and build a new tensor type (BFVTensor) that leverages this scheme for privacy-preserving computation in deep learning.

💻 What I Worked On

🔐 Implemented the FV encryption scheme from scratch

Building the full scheme — parameter generation, key generation, encoding, encryption, decryption, and arithmetic operations — in pure Python for flexibility and transparency.

🧮 Introduced a new tensor type (`BFVTensor`)

The tensor integrates the encryption scheme with PyTorch-like interfaces to make encrypted computation more accessible.

📦 Key Pull Requests

Here's a list of major contributions during GSoC:

  1. Parameter generation, keygen, encoder, encrypt/decrypt
  2. Addition operation
  3. Multiplication operation
  4. Negation operation
  5. Subtraction operation
  6. Relinearization
  7. Parameter validation
  8. Refactoring context structure
  9. Tensor support (in progress)

📖 A Quick Intro to Homomorphic Encryption

Homomorphic Encryption (HE) allows computation on encrypted data, preserving confidentiality throughout the process. This is crucial for privacy-preserving AI and secure data collaboration.

✅ Current Status

The FV scheme is functional and well-tested. You can check:

The tensor integration is in progress, and I aim to make it fully compatible with PyTorch workflows soon.

🚀 What's Next?

  • Better parameter tuning
  • Use cryptographically secure RNG
  • Polynomial computation optimization (maybe NTT)
  • Performance improvements inside PySyft

❤️ Reflections

GSoC was an incredible journey. I deepened my understanding of cryptography, open source, and collaborative software development. It taught me how to break down complex problems and contribute meaningfully to a global codebase.

Huge thanks to my mentor Ayoub Benaissa and the OpenMined Crypto team — their guidance was invaluable.

I'm excited to keep working on this project and make privacy-preserving AI more usable and efficient.