This project presents a secure and efficient approach for food supply chain management by integrating homomorphic Message Authentication Codes (MACs) with Merkle tree data structures.
-
Merkle Tree Layer: Frequently updated sensor data (temperature, humidity, location) is stored in a Merkle tree, where each node is augmented with homomorphic MACs to allow authenticated updates and tamper-evident integrity verification.
-
Aggregate Verification Layer: Critical aggregate metrics (minimum, maximum, average temperatures) computed during data collection are verified directly using homomorphic MACs, eliminating the need to retrieve and recompute underlying raw data—improving verification efficiency and privacy.
This dual-layer system ensures fine-grained traceability alongside efficient, privacy-preserving verification of key metrics, making it ideal for scalable, secure food supply chain applications.
- Secure storage and verification of sensor data with Merkle trees
- Homomorphic MAC-based authentication for frequent data updates
- Efficient verification of aggregate values (min, max, average) without full data retrieval
- Tamper-evident mechanisms to detect data manipulation
- Benchmarked performance comparison between Merkle tree and homomorphic MAC approaches
data/— Sample sensor data in JSON formatmerkle_tool/— Implementation of Merkle tree construction, hashing, and proof verificationhmac_tool/— Homomorphic MAC generation and verification functionscomparison/benchmark.py— Script for performance benchmarking of both approachesmain.py— End-to-end demonstration of data authentication and update verification
- Python 3.8+
- Dependencies:
hashlib,json, and other standard Python libraries
- Place sensor data in
data/sensor_values.json. - Run
main.pyto:- Build and verify Merkle tree for sensor data
- Generate and verify homomorphic MACs for aggregates
- Simulate frequent data updates and verify integrity
- Use
comparison/benchmark.pyto compare performance of Merkle tree vs. homomorphic MAC approaches.
- Merkle Tree: Data entries are hashed into leaves; internal nodes store combined hashes to form the root. Proofs verify inclusion of any leaf efficiently.
- Homomorphic MACs: Allow algebraic operations on authentication tags so aggregate values can be verified without exposing raw data.
- Update Simulation: Demonstrates integrity checks after sensor data changes, ensuring tamper evidence.
Mithun, Jei Akash
Email: mithuncsegvsraja@gmail.com