Skip to content

CodeByAidan/Homomorphic-Encryption-Decryption-with-Strings

Repository files navigation

Homomorphic-Encryption-Decryption-with-Strings

This repository contains an updated version of the original code by Mădălina Bolboceanu (@mbolboceanu), Miruna Roșca (@MirunaRosca), and Radu Țițiu (@rtitiu).

Overview

This code demonstrates an updated version of a homomorphic encryption/decryption scheme. It allows you to perform operations on encrypted data while preserving privacy.

Getting Started

Prerequisites

  • Python 3.6 or higher is required.
  • Ensure you have the necessary dependencies installed. You can install them using pip and the requirements.txt file.

Installation

  1. Clone this repository:

    git clone https://github.com/CodeByAidan/Homomorphic-Encryption-Decryption-with-Strings.git
    cd Homomorphic-Encryption-Decryption-with-Strings
  2. Install the required dependencies using the provided requirements.txt:

    pip install -r requirements.txt

Usage

Run the main.py script to see an example usage of the updated homomorphic encryption/decryption scheme:

python main.py

The script demonstrates encryption, decryption, and operations on encrypted data using the "updated scheme".

API

Dockerfile (Two Commands!)

Go to api/ folder, open up Docker Desktop. Then build the Dockerfile image into a container:

cd api/
docker build -t homomorphic-encryption-api .

Then run it!

docker run homomorphic-encryption-api:latest

Sockets - Python (Two Commands!)

Go to api/ folder (in 2 different terminals), on one run the server.py:

cd api/
python server.py

Then on the other run the client.py:

python client.py

Additional Resources

For a deeper understanding of the concepts and techniques used in this code, you can refer to the associated research paper: Paper.pdf as well as the original blogpost about this: https://bit-ml.github.io/blog/post/homomorphic-encryption-toy-implementation-in-python/