FYP 1 | SecurityDec 31, 2025

Anti counterfeit Medicine using MERN.

Combatting Counterfeit Medicine with Encryption

CATEGORYFYP 1 | Security
SHIPPEDDec 31, 2025
KEY METRICS
SecurityQR RSA
ReachWebsite
Anti counterfeit Medicine using MERN

Developed a secure validation system for pharmaceuticals using encrypted QR codes and automated verification pipelines.

This Anti-Counterfeit Pharmaceutical Verification System is a high-security, full-stack application developed using React Native, Node.js/Express, and MongoDB. The platform combats drug duplication and counterfeiting by leveraging dynamically generated cryptographic QR codes printed at the manufacturing stage and validated on-demand via mobile scans.

๐ŸŽฏ The Problem

Global distribution systems suffer from counterfeit pharmaceutical leakage, where cloned or fake packaging containing dangerous substances enters the supply chain. Standard barcodes and regular QR codes are easily photocopied or duplicated, meaning physical authentication methods alone cannot verify authenticity.

๐Ÿ’ก The Security Concept

I engineered a one-time validation protocol combining physical packaging markers and database check states:

  1. 1.Manufacturer Generation: The admin dashboard generates a unique cryptographic payload containing salted hashes for each medicine batch and package, encoding them into secure QR codes ready for printing.
  2. 2.First-Scan Authentication: The first time a consumer scans the package via their mobile app, the system verifies the hash signature, registers the user, increments the verification count, and marks the medicine as Authentic.
  3. 3.Double-Scan Detection: If the QR code is photocopied and scanned again, the database detects the incremented verification state ($count > 0$). Instead of confirming authenticity, it displays a warning that the product may be compromised and presents a masked, GDPR-compliant partial email (e.g., t***@e***.com) of the account that completed the original scan.
  4. 4.Invalid Hash Rejection: If the scanned payload's cryptographic signature is modified or invalid, the system instantly flags it as Fabricated/Counterfeit.

๐Ÿ› ๏ธ Technical Implementation

  • โ–ธCryptographic Engine: Implemented backend-level hashing (SHA-256 with dynamic salt strings) to wrap item serials and manufacturer metadata into un-spoofable signature strings.
  • โ–ธAdmin Printing Pipeline: Built a high-performance admin portal rendering dynamic SVG-based QR codes, ready for high-resolution thermal printing systems.
  • โ–ธVerification Mobile Scanner (React Native): Developed a fast scanner interface using device camera controllers, making verification requests asynchronously to the Express API.
  • โ–ธData Masking Middleware: Engineered standard string regex masks (e.g., masking the domain and local parts of user emails) in Express responses to protect user privacy while presenting indisputable proof of previous scans.

๐Ÿš€ Key Results & Metrics

  • โ–ธ๐Ÿ”’ Zero-Trust Replication Protection: Photocopied packaging copies are instantly caught on the second scan attempt.
  • โ–ธโšก Sub-100ms Verifications: Optimized database index checks on the cryptographic serial strings.
  • โ–ธ๐Ÿ“ฑ Frictionless Consumer Scanning: Consumers scan QR codes instantly without needing complex technical configurations.

Inspired by Anti counterfeit Medicine using MERN?

Let's discuss how we can build a similarly scalable and high-performance solution for your next big idea.

Start a Conversation