
GitHub Stats
Stars
52
Forks
1
Release Date
4/26/2025
about 2 months ago
Detailed Description
FHE Image Processing Server
This project demonstrates a server-based application for applying image filters using Fully Homomorphic Encryption (FHE). It allows for secure image processing where the server never sees the unencrypted image content.
Overview
The system consists of two main components:
- FHE Server: Processes encrypted images without decrypting them
- MCP Server: Client interface that handles image preparation, encryption, and decryption
Features
- Apply various image filters to encrypted images
- Complete FHE workflow: encryption, processing, and decryption
- Process images while preserving privacy through homomorphic encryption
- RESTful API for client integration
Architecture
The system follows a client-server architecture:
- The client sends an image URL to the MCP server
- MCP server:
- Downloads the image
- Generates encryption keys
- Encrypts the image
- Sends the encrypted image to the FHE server
- FHE server:
- Processes the encrypted image without decryption
- Returns the encrypted result
- MCP server:
- Stores the encrypted output
- Can decrypt the result when requested
Setup
Prerequisites
- Python 3.11.4
- uv package installer (faster alternative to pip)
Installation
-
Clone the repository
-
Install MCP CLI:
uv add "mcp[cli]"
-
Initialize filters:
uv run generate_dev_files.py
-
Install MCP server to Claude Desktop:
uv run mcp install mcp_server.py
If
uv run mcp install mcp_server.py
doesn't work in your Claude Desktop, you can try to configbash {project_path}/mcp_server.exmaple.sh
and replace{project_path}
with your project path.
Usage
Starting the Servers
-
Start the FHE server:
uv run fhe_server.py
This will run on http://localhost:8000 by default
-
You can now access the MCP server through Claude Desktop
API Endpoints
FHE Server Endpoints:
GET /
: Welcome messageGET /available_filters
: List available filtersPOST /send_input
: Upload encrypted image and evaluation keyPOST /run_fhe
: Execute FHE computationPOST /get_output
: Retrieve encrypted outputPOST /fhe_full
: Complete FHE workflow in a single requestGET /test/image/{image_name}
: Test endpoint for viewing images
MCP Server Tools:
get_available_filters()
: Get list of available FHE filtersprocess_image_with_fhe(image_url, filter_name)
: Process an image through the FHE pipelinedecrypt_output_image(user_id, filter_name, output_id)
: Decrypt processed image
Notes
- The system resizes images to 100x100 pixels for processing
- Encryption/decryption keys are generated per session
- Processed images are temporarily stored in the configured temp directories
Security Considerations
This demo implements FHE for educational purposes. In a production environment, additional security measures should be implemented:
- Secure key management
- HTTPS for all API communication
- Authentication and authorization
- Proper data retention policies
Star History
Star History
About the Project
This app has not been claimed by its owner yet.
Claim OwnershipReceive Updates
Security Updates
Get notified about trust rating changes
to receive email notifications.