Inspiration:
Medical data is highly sensitive, yet often stored in centralized and vulnerable systems. We wanted to build a platform where patients own their records and tampering becomes impossible. This inspired us to combine AES encryption, SHA hashing, and blockchain immutability to protect EHRs end-to-end.
What We Learned:
- Cryptography, How AES-CBC works: 𝐶𝑖 = 𝐸𝑘(𝑃𝑖⊕𝐶𝑖−1)Ci = Ek(Pi⊕Ci−1)
- Why static keys are risky and how key rotation helps SHA-256 for integrity: H=SHA256(data)
- Blockchain Basics of Solidity smart contracts Storing and verifying hashes on-chain Importance of immutability for medical data 4.Full-Stack Skills Integrating blockchain with backend Managing encrypted data Building verification workflows
How We Built It:
AES-CBC Encryption: Each EHR is encrypted with an AES key and IV, ciphertext is stored in SQLite. SHA-256 Hashing: H=SHA256(EncryptedData) This hash becomes the integrity signature.
Solidity Smart Contract: Stores hashes Verifies if a record exists Ensures tamper-proof history
Integration: Backend encrypts → hashes → sends hash to blockchain.
Tampering Detection: Any change in SQLite produces a new hash ≠ on-chain hash → tampering detected instantly.
Challenges:
- Handling IVs, padding, and key management in AES-CBC
- Ensuring consistent hashing during tamper tests
- Realizing the security limitations of using a static AES key
Final Outcome
- We built a secure EHR system that:
- Encrypts records
- Stores their hashes on blockchain
- Detects tampering reliably
- Provides a simple UI for verification
It strengthened our skills in cryptography, blockchain, and secure system design while solving a real-world problem.
Log in or sign up for Devpost to join the conversation.