<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged qr-authentication</title>
<link>https://coderlegion.com/tag/qr-authentication</link>
<description>Powered by Question2Answer</description>
<item>
<title>How I Designed an Anti-Proxy Attendance System Using Dynamic QR Authentication</title>
<link>https://coderlegion.com/22897/how-i-designed-an-anti-proxy-attendance-system-using-dynamic-qr-authentication</link>
<description>&lt;p&gt;&quot;Anyone can generate a QR code. Designing one that actually prevents misuse is the hard part.&quot;&lt;/p&gt;
&lt;p&gt;When people hear &quot;QR-based attendance,&quot; the first question is usually:&lt;/p&gt;
&lt;p&gt;&quot;Can't someone just take a photo of the QR code and send it to their friend?&quot;&lt;/p&gt;
&lt;p&gt;The answer is: yes, if the system is designed poorly.&lt;/p&gt;
&lt;p&gt;That question became one of the biggest engineering challenges while building my attendance platform.&lt;/p&gt;
&lt;p&gt;Instead of thinking about QR codes as images, I started thinking about them as temporary authentication tokens.&lt;/p&gt;
&lt;p&gt;The Problem&lt;br&gt;
Most QR attendance systems work like this:&lt;/p&gt;
&lt;p&gt;Teacher generates a QR code.&lt;br&gt;
Students scan it.&lt;br&gt;
Attendance is marked.&lt;br&gt;
Simple.&lt;/p&gt;
&lt;p&gt;Unfortunately, it's also vulnerable.&lt;/p&gt;
&lt;p&gt;A student can:&lt;/p&gt;
&lt;p&gt;Photograph the QR code.&lt;br&gt;
Send it through WhatsApp.&lt;br&gt;
Another student scans it from somewhere else.&lt;br&gt;
Attendance gets recorded.&lt;br&gt;
The QR code itself becomes the vulnerability.&lt;/p&gt;
&lt;p&gt;Rethinking the QR Code&lt;br&gt;
Instead of creating a QR code that simply points to an attendance page, I designed it to behave more like a short-lived authentication token.&lt;/p&gt;
&lt;p&gt;Every QR code is generated dynamically and remains valid only for a limited period (in my implementation, I set this to 11 seconds).&lt;/p&gt;
&lt;p&gt;Once it expires, the system rejects it.&lt;/p&gt;
&lt;p&gt;This dramatically reduces the opportunity for someone to reuse an older QR code.&lt;/p&gt;
&lt;p&gt;Authentication Beyond the QR&lt;br&gt;
Scanning the QR code alone isn't enough.&lt;/p&gt;
&lt;p&gt;The backend performs additional validation before marking attendance.&lt;/p&gt;
&lt;p&gt;Rather than trusting the client, the server becomes the source of truth.&lt;/p&gt;
&lt;p&gt;This reduces opportunities for client-side manipulation and keeps the attendance workflow under server control.&lt;/p&gt;
&lt;p&gt;Designing for the Real World&lt;br&gt;
One challenge I encountered was balancing security with usability.&lt;/p&gt;
&lt;p&gt;If the QR expires too quickly, students may struggle to scan it in time.&lt;/p&gt;
&lt;p&gt;If it stays active for too long, it becomes easier to misuse.&lt;/p&gt;
&lt;p&gt;Finding the right balance required thinking about actual classroom conditions rather than only technical implementation.&lt;/p&gt;
&lt;p&gt;Lessons Learned&lt;br&gt;
One lesson stood out throughout this project:&lt;/p&gt;
&lt;p&gt;Security isn't usually one big feature.&lt;/p&gt;
&lt;p&gt;It's the result of multiple smaller decisions working together.&lt;/p&gt;
&lt;p&gt;A dynamic QR code helps.&lt;/p&gt;
&lt;p&gt;Server-side validation helps.&lt;/p&gt;
&lt;p&gt;Short-lived sessions help.&lt;/p&gt;
&lt;p&gt;Each layer reduces risk.&lt;/p&gt;
&lt;p&gt;What's Next?&lt;br&gt;
This article only covers one piece of the system.&lt;/p&gt;
&lt;p&gt;In future posts, I'll explore:&lt;/p&gt;
&lt;p&gt;Backend architecture&lt;br&gt;
Firestore data modeling&lt;br&gt;
Authentication flow&lt;br&gt;
Scaling the platform&lt;br&gt;
Engineering decisions behind the project&lt;br&gt;
Building software has taught me that writing code is only part of engineering.&lt;/p&gt;
&lt;p&gt;Designing systems that continue to work under real-world conditions is where the interesting problems begin. In this project, I used libraries like qrcode on the backend to generate dynamic QR codes and html5-qrcode on the frontend to scan and verify them efficiently, while SHA-256 hashing was used on the backend to securely generate and validate the QR token payloads.&lt;/p&gt;
&lt;p&gt;⭐ GitHub: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/siddarthpatelkama&quot;&gt;https://github.com/siddarthpatelkama&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;💼 LinkedIn: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.linkedin.com/in/siddarthpatelkama&quot;&gt;https://www.linkedin.com/in/siddarthpatelkama&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/22897/how-i-designed-an-anti-proxy-attendance-system-using-dynamic-qr-authentication</guid>
<pubDate>Fri, 17 Jul 2026 16:39:51 +0000</pubDate>
</item>
</channel>
</rss>