Skip to content

arnavgupta03/infracrypt

Repository files navigation

Infracrypt

License Uptime

With Infracrypt, secure your Flask APIs and servers without any hassle! Infracrypt takes a Flask file and replaces any data returned with data encrypted using AES-256. Further, the data needed for decryption is put into an easy-to-access JSON file so that decryption can be done on any frontend or by any user of the API.

The private key for the AES-256 encryption is generated using a password that is created by the near random motion created by the hardware module. This module consists of an ESP32 microcontroller, infrared sensor, ultrasonic sensor, servo motor, as well as LEDs and resistors and a cardboard chassis. When motion is detected, the distance between the ultrasonic sensor and the cardboard is calculated, which is used with a random generator to move the motor again as well as generate a password for the AES-256 procedure.

The Infracrypt package communicates over WiFi to get this password, which is also encrypted using a 256-bit private key known to the Infracrypt package. Infracrypt then uses this to conduct the encryption and replacement procedure.

Here is a video of the random motion of the hardware module:

20230305_023400.mp4

How to use it

python -m infracrypt {flask-file-name}

Currently supports string, dict, int, and list return types. Any other types can be put into these types to be encrypted.