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:

  1. Cryptography, How AES-CBC works: 𝐶𝑖 = 𝐸𝑘(𝑃𝑖⊕𝐶𝑖−1)Ci = Ek(Pi⊕Ci−1)
  2. Why static keys are risky and how key rotation helps SHA-256 for integrity: H=SHA256(data)
  3. 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:

  1. Handling IVs, padding, and key management in AES-CBC
  2. Ensuring consistent hashing during tamper tests
  3. Realizing the security limitations of using a static AES key

Final Outcome

  1. We built a secure EHR system that:
  2. Encrypts records
  3. Stores their hashes on blockchain
  4. Detects tampering reliably
  5. Provides a simple UI for verification

It strengthened our skills in cryptography, blockchain, and secure system design while solving a real-world problem.

Built With

Share this project:

Updates