Skip to content

Final project demo of the CS 5920 class. Title: Homomorphic Encryption: What Is It and How Can It Help Secure Healthcare Systems

Notifications You must be signed in to change notification settings

cetorres/cs5920-project-demo

Repository files navigation

CS 5920 - Intro to Applied Cryptography

Class Project

This is final class project of CS 5920 - Intro to Applied to Cryptography attended at UCCS for my PhD in Computer Science program during the Spring of 2023 and presented on 04/26/2023. This project has:

Title: Homomorphic Encryption: What Is It and How Can It Help Secure Healthcare Systems

An introductory discussion about homomorphic encryption, what it is, how it works, and how it can help secure healthcare systems and protect patient data privacy.

System Model

System Model

Demo

Demo

On this demo we implemented the Elgamal Cryptosystem Scheme of Partially Homomorphic Encryption and simulate the behavior of a real-world application, where patients send their health information to a healthcare system to be used in some computation and receive the result back. But the healthcare system never can see the plaintext of the patient information and is still able to compute on the ciphertext and return, thanks to the homomorphic properties of this scheme. We implemented two, the encryption server and the healthcare system API server.

  • Encryption server (server_enc folder):

    • Receives the data from the frontend (entered by the end user)
    • Generate public and private keys based on the Elgamal scheme
    • Encrypt the data received
    • Send the encrypted data along with the public key to the healthcare system server
    • Receives the computed result encrypted
    • Decrypt the result using the private key
    • Sends back to the frontend
  • Healthcare system (server_health folder):

    • Receives the ciphertext from the encryption server
    • Compute using the encrypted data received
    • Return the encrypted result to the encryption server

How to run

Each application (server_enc, server_health) is a Python Flask web application. Inside each folder there is a requirements.txt file with all Python libraries necessary to be installed to be able to run the applications.

It is strongly advised to create a virtual environment to be able to run each Flask application properly. Reference can be found here. To create a venv, go to each folder and run:

python3 -m venv .venv
. venv/bin/activate

The run the following command inside each folder to install all requirements:

pip install -r requirements.txt

Once everything is installed you can run the applications. Open two separate terminal windows, go to each folder, and run the following command to start the application:

For server_enc

flask --app app run --port=5050 

For server_health

flask --app app run --port=5051 

If you need to change the server_health port, you need also to update the HEALTH_API_URL inside the script server_enc/he_enc.py.

Then open http://localhost:5050 on your browser.

References

This demo used the following reference to help the implementation of the Elgamal Cryptosystem Scheme in Python:

More information

About

Final project demo of the CS 5920 class. Title: Homomorphic Encryption: What Is It and How Can It Help Secure Healthcare Systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published