<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Data:Algo on Medium]]></title>
        <description><![CDATA[Stories by Data:Algo on Medium]]></description>
        <link>https://medium.com/@dataalgo?source=rss-52a93e9ae85f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pRUCFaEKnkERoNjZmhHoEg.png</url>
            <title>Stories by Data:Algo on Medium</title>
            <link>https://medium.com/@dataalgo?source=rss-52a93e9ae85f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:09:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dataalgo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a home SIEM, Part 2: The environment setup (or: the boring stuff that isn’t boring)]]></title>
            <link>https://dataalgo.medium.com/building-a-home-siem-part-2-the-environment-setup-or-the-boring-stuff-that-isnt-boring-caebf731a967?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/caebf731a967</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 05:53:28 GMT</pubDate>
            <atom:updated>2026-07-26T06:15:20.456Z</atom:updated>
            <content:encoded><![CDATA[<p>This is part 2 of my home SIEM build series. <a href="https://blog.devgenius.io/im-building-myself-a-home-siem-and-i-don-t-fully-know-what-i-m-doing-yet-3f296882316e?sharedUserId=dataalgo">Part 1</a> was the pitch: here’s what I’m building and why. This post is about what I actually did to get ready before touching any security tools.</p><p>I know “environment setup” sounds like the skippable chapter in a textbook. But honestly, some of the most useful things I learned in this sprint were things I didn’t expect to learn at all.</p><h3><strong>The architecture decision I almost overthought</strong></h3><p>The first thing I had to decide was: am I running this 24/7, or spinning it up when I need it?</p><p>I went with <strong>demo-snapshot</strong>. Meaning I bring up the Docker stack when I’m working on it or want to show it to someone, and shut it down when I’m done. I don’t want to commit to keeping a home lab running around the clock. This is a learning project and a portfolio piece, not a production SOC.</p><p>I almost talked myself into buying a mini PC and leaving it on all the time. Glad I didn’t. My laptop has 16GB of RAM and Docker Desktop already installed. That’s more than enough for a single-node Wazuh deployment.</p><h3><strong>Docker was the easy part</strong></h3><p>I was expecting at least one Docker headache. There wasn’t one. Docker Engine 29.2.1 and Compose v5.1.0 were already on my machine. I ran <em>docker run -- rm alpine echo “hello”</em> and it worked. That’s it. No socket permission errors, no daemon issues. I’m on a Mac with Apple Silicon, and Docker Desktop handles all the Linux VM stuff behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkRun_fJlsvcmkCRy3A5gA.png" /></figure><p>If you’re on Linux, this step is probably even simpler. If you’re on Windows, I genuinely don’t know; I haven’t tried.</p><h4><strong>The vm.max_map_count thing</strong></h4><p>This one caught me off guard.</p><p>The Wazuh indexer is OpenSearch under the hood, and OpenSearch needs a kernel parameter called <em>vm.max_map_count</em> set to at least 262144. On Linux, you’d just run <em>sysctl -w vm.max_map_count=262144</em> and be done. On macOS, that parameter doesn’t exist at the host level. It lives inside Docker Desktop’s hidden Linux VM.</p><p>The fix is weirdly elegant:</p><pre>docker run --rm --privileged alpine sysctl -w vm.max_map_count=262144</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30S-LTfO7ADALek_04kbQA.png" /></figure><p>This spins up a throwaway Alpine container with privileged access to the Docker VM’s kernel, sets the value, and exits. I verified it stuck:</p><pre> docker run --rm alpine sysctl vm.max_map_count</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*X2WAbiBWvD9ImXYhWACaIg.png" /></figure><p>The catch: <strong>this doesn’t survive Docker Desktop restarts. </strong>Every time you restart Docker, you need to run that command again. I’ll probably script this eventually, but for now I just remember to do it before bringing up the stack. Not ideal, but fine for a demo setup.</p><p>This is exactly the kind of thing I wouldn’t have known about if I hadn’t tried it myself. The Wazuh docs mention `vm.max_map_count` but mostly assume you’re on Linux.</p><h3><strong>Cloning the Wazuh Docker repo</strong></h3><p>I cloned the official <em>wazuh-docker</em> repo at tag v4.14.6 (the latest stable release as of July 2026):</p><pre>git clone https://github.com/wazuh/wazuh-docker.git -b v4.14.6 --depth 1</pre><p>The <em>--depth 1</em> keeps it small; I don’t need the full commit history, just the config files. The single-node directory has everything I need:</p><pre>wazuh-docker/single-node/<br>├── config/<br>├── docker-compose.yml<br>└── generate-indexer-certs.yml</pre><p>Three containers will come out of this: the Wazuh manager (the brain), the indexer (stores everything), and the dashboard (the thing I’ll actually look at). There’s also a separate compose file for generating TLS certificates the indexer needs. That’s a Sprint 1 problem.</p><h3><strong>What I have right now</strong></h3><p>Nothing running yet. But everything is staged and ready:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mc-9JcWFJjewDvQpU3yOA.png" /></figure><p>It’s a clean starting point. No half-configured services, no leftover containers from previous experiments. Just a cloned repo and a verified Docker install.</p><h3><strong>What’s next</strong></h3><p><strong>Sprint 1: </strong>actually bringing Wazuh to life. I’ll generate the TLS certificates, run <em>docker compose up</em>, and try to log into the dashboard for the first time. I’m expecting the certificate step to be the part that trips me up — certificate stuff always is.</p><p>If anything goes spectacularly wrong, you’ll hear about it. That’s the deal with writing in public.</p><p>#CyberSecurity #Wazuh #SOCAnalyst #HomeLab #BlueTeam</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caebf731a967" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m building myself a home SIEM (and I don’t fully know what I’m doing yet)]]></title>
            <link>https://blog.devgenius.io/im-building-myself-a-home-siem-and-i-don-t-fully-know-what-i-m-doing-yet-3f296882316e?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f296882316e</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[wazuh]]></category>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 21:01:01 GMT</pubDate>
            <atom:updated>2026-07-07T21:01:01.000Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve spent the last few years doing security and data science coursework, building an NDIS invoicing system, and putting together a MITRE ATT&amp;CK recommender system for a uni project. Lots of it has been academic or client-facing. What I haven’t done much of is the actual day-to-day work a SOC analyst does: watching logs, tuning alerts, figuring out what’s noise and what’s a real problem.</p><p>So I’m building a home SIEM. Wazuh, Pi-hole, a small Python script to keep an eye on my network, all glued together, running on my own devices. I’m calling it LAN Watchmen, because someone has to watch the LAN, and it might as well be me.</p><p>I want to be upfront: I don’t know exactly how this is going to go. I’ve read the docs, I’ve seen other people’s write-ups, but I haven’t stood up a Wazuh cluster before. There’s a real chance the first week is just me staring at a dashboard that shows nothing, or fighting with certificate generation, or realising my router doesn’t give me the log access I assumed it would. That’s fine. That’s kind of the point of writing this as I go instead of after I’ve cleaned it all up.</p><p>Here’s roughly what I’m trying to build:</p><figure><img alt="Diagram of a home network security setup. Home network devices connect to two things: Pi-hole, which filters DNS traffic, and a device inventory script, which watches for new devices on the network. Both send data to a Wazuh manager, which applies rules to detect problems. Wazuh then stores the events in an indexer and shows them on a dashboard." src="https://cdn-images-1.medium.com/max/1024/1*6fyJ5F3ROEQs1M_-PiE-cQ.png" /><figcaption>Here’s the rough plan. Home devices go through Pi-hole (for DNS) and a little script I wrote (for spotting new devices), both feed into Wazuh, and Wazuh does the actual detecting.</figcaption></figure><ul><li><strong>Wazuh</strong> as the central brain, running single-node in Docker. It’ll ingest logs and raise alerts.</li><li><strong>Pi-hole</strong> sitting in front of my DNS traffic, blocking known-bad domains and logging every query.</li><li><strong>A small device-inventory script</strong> that watches my network’s ARP table and flags anything that shows up that I don’t recognise.</li><li><strong>A handful of custom detection rules</strong> on top of all that, tuned so they tell me something real instead of just being noisy.</li></ul><p>Why this and not something flashier? A few reasons. First, it’s close to what the job actually looks like. Log aggregation, alert triage, tuning false positives, these are the daily mechanics of SOC work, and I’d rather learn them by doing than by reading about them. Second, it’s honest about scope. I’m not trying to build a commercial product here. I’m trying to build something real enough that I understand it end to end, and can talk about it in an interview without hand-waving.</p><p>I’m scoping this deliberately small. No full packet inspection, no agents on every device in the house, no custom dashboard UI. Just DNS-level visibility, a device baseline, and a few rules that actually mean something when they fire. If it grows from there, it grows from there.</p><p>I’ll be writing about each piece as I build it, including the parts that don’t work on the first try. Next post is getting Wazuh actually running, which given some of what I’ve read about indexer memory requirements, might not be entirely painless.</p><p>If you’ve built something like this before and know where I’m about to get stuck, I’d genuinely like to hear about it.</p><p>#CyberSecurity #Wazuh #SOCAnalyst #HomeLab #BlueTeam</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f296882316e" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/im-building-myself-a-home-siem-and-i-don-t-fully-know-what-i-m-doing-yet-3f296882316e">I’m building myself a home SIEM (and I don’t fully know what I’m doing yet)</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Smart Home Speaks Five Languages (And Why That’s Finally Changing)]]></title>
            <link>https://dataalgo.medium.com/why-your-smart-home-speaks-five-languages-and-why-thats-finally-changing-e53f2be1f16c?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e53f2be1f16c</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Sun, 18 Jan 2026 02:40:01 GMT</pubDate>
            <atom:updated>2026-01-18T02:40:01.345Z</atom:updated>
            <content:encoded><![CDATA[<p>You have seventeen smart devices in your home. Ask them to work together, and they’ll stare at you like strangers at a bus stop.</p><p>This wasn’t inevitable.</p><p>Remember buying a smart bulb, only to discover you needed a Hue hub, which wouldn’t talk to your SmartThings hub, which didn’t support your new Thread doorbell? That mess has a history — and it’s surprisingly human.</p><p>If the Internet of Things were a dinner party, Wi-Fi would be the loud guest talking to everyone at once, Bluetooth would be chatting across the table, Zigbee and Thread would be quietly coordinating behind the scenes, and Matter would be the host making sure everyone follows the same rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCxGAjFI21sF7OCKW7cppg.png" /><figcaption>If the Internet of Things were a dinner party, Wi-Fi would be the loud guest, while Matter acts as the conductor, bringing harmony to the different communication protocols</figcaption></figure><p>IoT did not appear fully formed. It evolved the same way human communication did. First, we shouted. Then we whispered. Then we formed groups. And finally, we agreed on a common language.</p><p>Let’s walk through that journey.</p><p>⸻</p><h3>Act 1: Wi-Fi</h3><h3>“Just connect it to the internet”</h3><p>Wi-Fi was the default choice for early smart devices for one simple reason: it was already everywhere.</p><p>Routers were installed. Phones supported it. Cloud services expected it.</p><p><strong>Why Wi-Fi dominated early IoT</strong></p><ul><li>High bandwidth supported cameras, speakers and displays</li><li>Direct internet access simplified cloud control</li><li>No extra hubs meant lower upfront friction</li></ul><p><strong>The trade-off</strong></p><p>Wi-Fi was never designed for tiny, sleepy devices.</p><p>A Wi-Fi door sensor checking in every hour would drain a coin cell battery in weeks. It’s constantly shouting “I’M STILL HERE” to stay connected to your router, burning energy even when nothing is happening.</p><p>That’s why:</p><ul><li>Smart cameras are plugged in</li><li>Video doorbells need regular charging</li><li>Battery-powered sensors avoid Wi-Fi entirely</li></ul><p>Wi-Fi is excellent when devices talk often and send lots of data. It’s inefficient when devices just need to say “door opened” and go back to sleep for hours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsceFZRtHS9JyrCRpLudeg.png" /><figcaption>A visual comparison showing how Wi-Fi devices are like power-hungry shouters, while Zigbee and Thread devices are energy-efficient whisperers, ideal for battery-operated sensors.</figcaption></figure><p>This limitation opened the door for something quieter.</p><p>⸻</p><h3>Act 2: Bluetooth</h3><h3>“Let’s talk nearby”</h3><p>Bluetooth was built for headphones and keyboards, not home networking.</p><p>Then Bluetooth Low Energy changed the game by making wireless communication cheap in terms of power. Instead of staying constantly connected, devices could wake up, send a quick message, and sleep for hours.</p><p><strong>Where Bluetooth shines</strong></p><ul><li>Wearables and fitness trackers</li><li>Smart locks and setup flows</li><li>Accessories that talk directly to phones</li></ul><p>Bluetooth works best when:</p><ul><li>Devices are close (usually within 10 meters)</li><li>Communication is occasional</li><li>A phone or hub acts as the gateway</li></ul><p>Bluetooth Mesh later extended this idea, letting devices relay messages to each other. But it added complexity and never became the backbone of most smart homes.</p><p>As the number of devices grew, proximity alone was no longer enough. Your phone couldn’t be the universal remote if you wanted your motion sensor in the hallway to turn on the bedroom lights.</p><p>⸻</p><h3>Act 3: Zigbee</h3><h3>“Let’s build a neighborhood”</h3><p>Zigbee introduced a powerful idea to smart homes: mesh networking.</p><p>Instead of every device talking to a central router, devices helped relay messages for each other. Your light switch could pass messages to your door sensor, which could reach your hub three rooms away.</p><p><strong>Why mesh mattered</strong></p><ul><li>Low-power devices could sleep most of the time</li><li>Coverage improved as more devices were added</li><li>Networks became more resilient — if one path failed, messages found another route</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zjg4orv3Fyu24OaOO1yLkA.png" /><figcaption>A diagram illustrating a resilient mesh network, where a broken connection doesn’t stop the signal; it simply finds a new path through other devices to reach the hub.</figcaption></figure><p>Mental model: More devices often meant better reliability, not worse. Each new light or sensor became part of the communication infrastructure.</p><p><strong>The downside</strong></p><p>Zigbee required:</p><ul><li>A central coordinator or hub (another box on your network)</li><li>Careful ecosystem choices</li><li>Vendor-specific implementations</li></ul><p>Lights from one brand might behave differently from another, even though both used “Zigbee.” Want to add a switch from Brand A to control lights from Brand B? Sometimes it worked. Sometimes it didn’t. And troubleshooting meant diving into forums and debug logs.</p><p>This fragmentation was not fatal, but it was frustrating enough to keep smart homes from going mainstream.</p><p>⸻</p><h3>Act 4: Thread</h3><h3>“Mesh networking, modernized”</h3><p>Thread took the good ideas from Zigbee and rebuilt them with modern internet principles.</p><p>Thread is:</p><ul><li>Low power (similar to Zigbee)</li><li>Mesh-based (devices relay for each other)</li><li>IP-native (speaks the language of the internet)</li></ul><p>Each Thread network still needs a Border Router, but that router speaks standard internet protocols instead of proprietary ones.</p><p><strong>Why IP-native matters</strong></p><p>This isn’t just technical elegance. It means:</p><ul><li><strong>Better security defaults</strong> — Thread uses the same encryption standards as banking websites</li><li><strong>Future-proofing</strong> — Devices can receive security updates over standard internet protocols</li><li><strong>Easier integration</strong> — Your Thread network can talk to cloud services without translation layers</li></ul><p>Thread fixed the transport layer — how messages travel through your home. But it didn’t solve how devices behave. A Thread light switch and a Thread door lock both use Thread, but what happens when you press the switch? What commands does it send? What does “locked” actually mean?</p><p>That problem remained.</p><p>⸻</p><h3>Act 5: Matter</h3><h3>“Let’s agree on the rules”</h3><p>Matter does not replace Wi-Fi, Zigbee, or Thread.</p><p>It sits above them.</p><p>Matter defines:</p><ul><li>How devices identify themselves</li><li>How commands behave</li><li>What “on,” “off,” or “locked” actually mean across all brands</li></ul><p>It runs over:</p><ul><li>Wi-Fi</li><li>Thread</li><li>Ethernet</li></ul><p>For the first time, device makers agreed on a shared application language. A Matter-certified light from Philips behaves the same way as a Matter-certified light from IKEA. Not “similar.” The same.</p><p><strong>This is why Matter feels boring.</strong></p><p>There’s no flashy new radio technology. No revolutionary mesh algorithm. Just companies agreeing that “turn on the light” should mean the same thing everywhere.</p><p>And boring is exactly what smart homes need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0aEo-MvwZKDMheFzILUtA.png" /><figcaption>Matter acts as a universal language, allowing smart devices from different brands, like Google, Amazon, Apple, and Philips Hue, to finally work together seamlessly.</figcaption></figure><p>⸻</p><h3>What This Means for Your Home</h3><p>The practical impact is quiet but profound:</p><p><strong>That Philips bulb can finally talk to your Google speaker and Apple HomePod</strong> — The same bulb. No bridge hacks or workarounds.</p><p><strong>Set up flows that take seconds, not debug sessions</strong> — Scan a QR code. Choose your ecosystem. Done.</p><p><strong>Devices that outlive their original ecosystems</strong> — When a company goes under or abandons a product line, Matter devices can migrate to new platforms.</p><p>The mess is not completely gone. Matter is still rolling out. Not every device is certified. Legacy products will linger for years.</p><p>But the direction is clear. We’ve moved from a world where seventeen different protocols competed to a world where they can coexist under a common language.</p><p>⸻</p><h3>The Pattern</h3><p>Looking back, the evolution makes sense:</p><p><strong>2000s: Wi-Fi everywhere</strong> — Use what exists, optimise later<br> <strong>2010s: Bluetooth LE, Zigbee mesh</strong> — Optimise for power and coverage<br> <strong>2020s: Thread, Matter standardisation</strong> — Agree on standards</p><p>We shouted across the house with Wi-Fi. We whispered efficiently with Bluetooth and Zigbee. We built neighbourhoods with mesh networks. And finally, we agreed on a common language with Matter.</p><p>It’s the same pattern human communication followed, compressed into two decades instead of millennia.</p><p>Your smart home is still learning to talk. But at least now, it’s learning the same language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e53f2be1f16c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Server Components Face New Security Challenges: What Developers Need to Know]]></title>
            <link>https://dataalgo.medium.com/react-server-components-face-new-security-challenges-what-developers-need-to-know-447d5837b370?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/447d5837b370</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 12:19:34 GMT</pubDate>
            <atom:updated>2025-12-15T12:19:34.633Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>December 15, 2025</strong></p><p>Just one week after React’s team patched a critical remote code execution vulnerability, security researchers have discovered two additional security issues in React Server Components. While these new vulnerabilities don’t allow attackers to take control of your server, they can still cause significant problems for applications using this technology.</p><p>If you updated React last week, you’ll need to update again. Here’s everything you need to know.</p><h3>The Quick Summary (For Everyone)</h3><p><strong>What happened?</strong> Two new security vulnerabilities were found in React Server Components:</p><ul><li><strong>High Severity</strong>: Attackers can crash your server by sending a specially crafted request</li><li><strong>Medium Severity</strong>: Attackers can potentially see your server-side source code</li></ul><p><strong>Who’s affected?</strong> If you’re using React 19 (versions 19.0.0 through 19.2.2) with Server Components or frameworks like Next.js, your application is vulnerable.</p><p><strong>What should you do?</strong> Update immediately to React 19.0.3, 19.1.4, or 19.2.3.</p><p><strong>The good news</strong>: These vulnerabilities don’t allow remote code execution (the most serious kind of attack). The earlier critical patch remains effective.</p><h3>Understanding the Two Vulnerabilities</h3><h3>1. Denial of Service: Crashing Your Server (High Severity)</h3><p><strong>CVEs: </strong><a href="https://www.cve.org/CVERecord?id=CVE-2025-55184"><strong>CVE-2025–55184</strong></a><strong> and </strong><a href="https://www.cve.org/CVERecord?id=CVE-2025-67779"><strong>CVE-2025–67779</strong></a><br> <strong>Severity Score: 7.5 (High)</strong></p><h4>What It Means in Plain English</h4><p>Imagine someone sends a poisoned letter to your office that, when opened, causes the mail room to get stuck in an endless loop of processing it. That’s essentially what happens here — an attacker sends a malicious HTTP request to your React application that causes the server to hang indefinitely, consuming CPU resources and making your app unavailable to legitimate users.</p><h4>Why This Matters</h4><p>This type of attack is called a Denial of Service (DoS). Even though the attacker can’t steal data or run malicious code, they can:</p><ul><li>Make your website or app completely unavailable</li><li>Cause server resources to max out</li><li>Potentially increase your hosting costs</li><li>Frustrate your users who can’t access your service</li></ul><p><strong>Important note</strong>: You’re vulnerable even if you don’t have any Server Functions explicitly defined, as long as your app uses React Server Components.</p><h4>The Technical Details</h4><p>When React deserialises certain malicious HTTP requests sent to Server Function endpoints, it triggers an infinite loop in the server process. The patches in versions 19.0.3, 19.1.4, and 19.2.3 prevent this infinite loop from occurring.</p><p><strong>A critical twist</strong>: The initial fix published in versions 19.0.2, 19.1.3, and 19.2.2 was incomplete. A third CVE (<a href="https://www.cve.org/CVERecord?id=CVE-2025-67779">CVE-2025–67779</a>) was filed to address the remaining cases. This is why updating to the latest versions is crucial.</p><h3>2. Source Code Exposure: Leaking Your Server Logic (Medium Severity)</h3><p><strong>CVE: </strong><a href="https://www.cve.org/CVERecord?id=CVE-2025-55183"><strong>CVE-2025–55183</strong></a><br> <strong>Severity Score: 5.3 (Medium)</strong></p><h4>What It Means in Plain English</h4><p>Under specific conditions, an attacker can trick your server into revealing its own implementation code. It’s like asking a magician to perform a trick and having them accidentally explain how the trick works — including showing you the secret compartments in their hat.</p><h4>How It Happens</h4><p>This vulnerability requires a very specific pattern in your code. Consider this example of a vulnerable Server Function:</p><pre>&#39;use server&#39;;<br><br>export async function serverFunction(name) {<br>  const conn = db.createConnection(&#39;SECRET KEY&#39;);<br>  const user = await conn.createUser(name);<br>  <br>  return {<br>    id: user.id,<br>    message: `Hello, ${name}!`<br>  }<br>}</pre><p>Normally, when you call this function with name: &quot;Alice&quot;, you&#39;d expect to get back:</p><pre>{<br>  &quot;id&quot;: &quot;123&quot;,<br>  &quot;message&quot;: &quot;Hello, Alice!&quot;<br>}</pre><p>But with a specially crafted malicious request, an attacker might receive:</p><pre>{<br>  &quot;id&quot;: &quot;tva1sfodwq&quot;,<br>  &quot;message&quot;: &quot;Hello, async function(a){let b=i.createConnection(\&quot;SECRET KEY\&quot;);return{id:(await b.createUser(a)).id,message:`Hello, ${a}!`}}!&quot;<br>}</pre><p>Notice what happened? The message field now contains the actual source code of the function, including the hardcoded SECRET KEY.</p><h4>Why This Matters</h4><p>Even if you don’t hardcode secrets (and you shouldn’t), leaked source code reveals:</p><ul><li><strong>Business logic</strong>: How your app makes decisions</li><li><strong>Validation rules</strong>: What checks you perform on data</li><li><strong>Internal assumptions</strong>: What your code expects to be true</li><li><strong>Feature behaviour</strong>: How your features actually work</li></ul><p>This information makes it significantly easier for attackers to find other vulnerabilities or understand how to exploit your system more effectively.</p><h4>The Specific Conditions Required</h4><p>The vulnerability only occurs when a Server Function:</p><ol><li>Takes user-controlled input as an argument</li><li>Explicitly or implicitly converts that input to a string</li><li>Includes that stringified value in its response</li></ol><p>In the example above, name is used in a template literal (Hello, ${name}!), which triggers the issue.</p><h4>What Gets Exposed (and What Doesn’t)</h4><p><strong>Potentially exposed:</strong></p><ul><li>Hardcoded secrets in your source code (like &#39;SECRET KEY&#39; in the example)</li><li>The implementation logic of your Server Function</li><li>Other functions if your bundler inlines them</li></ul><p><strong>Not exposed:</strong></p><ul><li>Runtime environment variables like process.env.SECRET</li><li>Data from your database</li><li>Code outside the specific Server Function</li></ul><p><strong>Important</strong>: The scope depends on your bundler configuration. Always test against your actual production bundles to verify what’s exposed.</p><h3>Why These Vulnerabilities Exist</h3><p>These issues aren’t simply coding mistakes — they stem from the fundamental architecture of React Server Components.</p><h3>The Convenience-Security Tradeoff</h3><p>React Server Components were designed to make full-stack development easier by blurring the traditional boundary between client and server. Instead of creating separate REST or GraphQL APIs, you can call server functions directly from your React components:</p><pre>// Client component<br>import { getUser } from &#39;./actions&#39;;<br><br>function UserProfile({ userId }) {<br>  const user = await getUser(userId); // Looks like a regular function call!<br>  return &lt;div&gt;{user.name}&lt;/div&gt;;<br>}</pre><p>Behind the scenes, React:</p><ul><li>Serialises the function call into an HTTP request</li><li>Sends it to the server</li><li>Executes the function</li><li>Serialises the response back to the client</li><li>Deserialises it into JavaScript objects</li></ul><p>This automatic serialisation/deserialisation is where the vulnerabilities lie. When user-controlled data crosses these boundaries in unexpected ways, the serialisation logic can be exploited.</p><h3>A Pattern in Security History</h3><p>As the React team notes in their advisory, this pattern of follow-up vulnerabilities is common across the industry. When a critical security issue is discovered and patched, researchers intensively scrutinise the surrounding code to find similar issues.</p><p>This happened with the famous Log4Shell vulnerability in 2021, which led to multiple follow-up CVEs as the community probed the initial fix. While frustrating for developers who must update repeatedly, this is actually a sign of a healthy security response process.</p><h3>Who Is Affected?</h3><h3>Affected Versions</h3><p>You’re vulnerable if you’re using React versions <strong>19.0.0 through 19.2.2</strong> with any of these packages:</p><ul><li>react-server-dom-webpack</li><li>react-server-dom-parcel</li><li>react-server-dom-turbopack</li></ul><h3>Affected Frameworks and Tools</h3><p>Several popular frameworks depend on these packages:</p><ul><li><strong>Next.js</strong></li><li><strong>React Router</strong></li><li><strong>Waku</strong></li><li><strong>Parcel</strong> (@parcel/rsc)</li><li><strong>Vite</strong> (@vitejs/plugin-rsc)</li><li><strong>rwsdk</strong></li></ul><h3>Who Is NOT Affected</h3><p>Your application is safe if:</p><ul><li>You’re not using React Server Components at all</li><li>You’re on React 18 or earlier</li><li>You don’t use any framework, bundler, or plugin that supports React Server Components</li><li>You’ve already updated to versions 19.0.3, 19.1.4, or 19.2.3</li></ul><p><strong>React Native users</strong>: If you’re not using a monorepo, your React version is typically pinned, and you don’t need to take action. If you are in a monorepo, only update the affected server packages (not react or react-dom to avoid version mismatch errors.</p><h3>What You Should Do Right Now</h3><h3>1. Update Immediately</h3><p>Upgrade to the patched versions:</p><ul><li><strong>19.0.3</strong> (if you’re on 19.0.x)</li><li><strong>19.1.4</strong> (if you’re on 19.1.x)</li><li><strong>19.2.3</strong> (if you’re on 19.2.x)</li></ul><p>If you updated to 19.0.2, 19.1.3, or 19.2.2 after last week’s advisory, those versions are also vulnerable. You must update again.</p><h3>2. Check Your Framework</h3><p>If you’re using Next.js or another framework, check for updated framework versions that include the patched React versions. Framework maintainers are releasing updates in parallel.</p><h3>3. Don’t Rely on Hosting Provider Mitigations</h3><p>Some hosting providers (like Vercel) have applied temporary mitigations, but the React team emphasises you should not depend on these. They are temporary measures, and your application remains vulnerable until you update.</p><h3>Long-Term Security Practices for React Server Components</h3><p>These vulnerabilities offer important lessons for working with React Server Components:</p><h3>1. Treat Server Functions Like Public APIs</h3><p>Even though Server Functions look like regular JavaScript functions in your code, they are network-accessible endpoints. Apply the same security practices you would to any backend API:</p><ul><li><strong>Validate all inputs</strong>: Never trust data from the client</li><li><strong>Authenticate access</strong>: Verify user identity and permissions</li><li><strong>Rate limit requests</strong>: Prevent abuse</li><li><strong>Log suspicious activity</strong>: Monitor for attack patterns</li></ul><h3>2. Be Careful with User Input</h3><p>Avoid patterns where user-controlled input is directly stringified and returned in responses. The vulnerable pattern looks like:</p><pre>// Vulnerable pattern<br>export async function greet(name) {<br>  return { message: `Hello, ${name}!` };<br>}</pre><p>Consider alternatives:</p><pre>// Safer pattern<br>export async function greet(name) {<br>  const sanitizedName = sanitize(name);<br>  return { message: `Hello, ${sanitizedName}!` };<br>}</pre><h3>3. Never Hardcode Secrets</h3><p>This has always been a best practice, but these vulnerabilities underscore why:</p><pre>// DON&#39;T do this<br>const apiKey = &#39;sk-abc123&#39;;<br><br>// DO this instead<br>const apiKey = process.env.API_KEY;</pre><p>Environment variables don’t get exposed by this vulnerability, but hardcoded strings in your source code can.</p><h3>4. “Server-Only” Isn’t a Security Boundary</h3><p>The &#39;use server&#39; A directive tells React where code should run, but it doesn&#39;t guarantee what can be serialised or returned to the client. Never rely on code location alone as a security measure.</p><h3>5. Test Against Production Bundles</h3><p>The scope of what gets exposed depends on your bundler configuration and how it inlines code. Always verify security in production bundles, not just development environments.</p><h3>The Timeline: How This Unfolded</h3><p>Understanding the disclosure timeline helps illustrate how security vulnerabilities are responsibly handled:</p><ul><li><strong>December 3</strong>: Source code leak reported by Andrew MacPherson</li><li><strong>December 4</strong>: Initial DoS reported by RyotaK from GMO Flatt Security</li><li><strong>December 6</strong>: Issues confirmed by React team, investigation begins</li><li><strong>December 7</strong>: Initial fixes created</li><li><strong>December 8</strong>: Affected parties notified privately</li><li><strong>December 10</strong>: Hosting mitigations deployed, patches verified</li><li><strong>December 11</strong>: Second DoS variant reported by Shinsaku Nomura</li><li><strong>December 11</strong>: All patches published and vulnerabilities publicly disclosed</li></ul><p>This coordinated disclosure allowed hosting providers to prepare mitigations and framework maintainers to release updates before the vulnerabilities became public knowledge. This is standard practice in security research and helps minimise the window where users are vulnerable.</p><h3>Looking Forward: What This Means for React</h3><p>These vulnerabilities don’t represent a fundamental flaw in React’s design, but they do highlight the security challenges of new abstractions that blur traditional boundaries.</p><h3>The Broader Pattern</h3><p>Server Components are part of a wider industry trend toward “full-stack frameworks” that aim to simplify web development by reducing the distinction between client and server code. While this makes development more productive, it also creates new attack surfaces that developers must understand.</p><h3>The Ongoing Security Investment</h3><p>The React team’s response — quick patches, coordinated disclosure, and transparent communication — demonstrates a mature approach to security. The discovery of follow-up vulnerabilities, while inconvenient, shows that the security community is actively scrutinising the code, which ultimately makes the ecosystem more secure.</p><h3>For Developers: Stay Vigilant</h3><p>As the React team notes, new abstractions don’t eliminate old security principles:</p><ul><li>User input is still untrusted</li><li>Serialisation is still dangerous</li><li>Server boundaries still matter, even when hidden by frameworks</li></ul><p>The lesson for all developers, whether you’re a senior architect or just starting out: whenever user input interacts with server logic, assume it could behave in ways you didn’t expect. That principle has survived every framework, and it will survive this one too.</p><h3>Additional Resources</h3><ul><li><a href="https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-components">Official React Advisory</a></li><li><a href="https://www.cve.org/CVERecord?id=CVE-2025-55183">CVE-2025–55183 (Source Code Exposure)</a></li><li><a href="https://www.cve.org/CVERecord?id=CVE-2025-55184">CVE-2025–55184 (Denial of Service)</a></li><li><a href="https://www.cve.org/CVERecord?id=CVE-2025-67779">CVE-2025–67779 (Additional DoS)</a></li><li><a href="https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components">Previous Critical Vulnerability Advisory</a></li></ul><h3>Acknowledgments</h3><p>Security vulnerabilities are discovered through the efforts of dedicated researchers. This disclosure was made possible by:</p><ul><li><strong>Andrew MacPherson</strong> (<a href="https://github.com/AndrewMohawk">@AndrewMohawk</a>) for discovering the source code exposure</li><li><strong>RyotaK</strong> from GMO Flatt Security Inc. for discovering the initial denial of service vulnerability</li><li><strong>Shinsaku Nomura</strong> of Bitforest Co., Ltd., for discovering the additional DoS variant</li></ul><p>Their responsible disclosure allowed the React team to patch these issues before they were publicly known, protecting the React community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=447d5837b370" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JWT Authentication in Web Apps: Cookies, CSRF, Refresh Tokens (Done Right)]]></title>
            <link>https://dataalgo.medium.com/jwt-authentication-in-web-apps-cookies-csrf-refresh-tokens-done-right-042c99e305ec?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/042c99e305ec</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 12:38:05 GMT</pubDate>
            <atom:updated>2025-12-13T12:38:05.667Z</atom:updated>
            <content:encoded><![CDATA[<p>Authentication in modern web apps <em>looks</em> simple on the surface. Grab a JWT library, protect some routes, ship it. Done, right?</p><p>Not quite.</p><p>In practice, most implementations fall into one of two traps: tokens stored in localStorage that are sitting ducks for XSS attacks, or short-lived tokens with no refresh flow that force users to re-authenticate constantly.</p><p>I’ve seen both. Neither is fun to debug at 2 AM when your auth system is melting down.</p><p>This post walks through a production-grade authentication setup for browser-based apps — one that actually holds up in the real world. More importantly, I’ll explain <em>why</em> each layer exists, because blindly copying patterns without understanding them is how we end up with security theatre instead of actual security.</p><h3>The Core Problem: Browsers Are Different</h3><p>Here’s the thing about building auth for APIs versus browsers: APIs are usually stateless. Browsers are decidedly not.</p><p>Browsers come with their own set of… let’s call them “quirks”:</p><ul><li>They automatically send cookies with every request</li><li>They execute JavaScript from multiple sources (including that analytics script you added last Tuesday)</li><li>They’re exposed to both XSS and CSRF attacks simultaneously</li></ul><p>Your auth design needs to assume the worst: requests can be forged, JavaScript can be compromised, and tokens will leak if you’re careless. Plan accordingly.</p><h3>Common Approach #1: JWT in localStorage</h3><p>This is still incredibly common, and I get why.</p><p><strong>How it works:</strong></p><ul><li>Store your JWT in localStorage</li><li>Send it with every request using Authorization: Bearer &lt;token&gt;</li><li>No cookies, no fuss</li></ul><p><strong>Why developers like it:</strong></p><ul><li>Zero CSRF concerns (no cookies = no CSRF)</li><li>Clean mental model</li><li>Works great for mobile apps and server-to-server APIs</li><li>Feels modern and “stateless”</li></ul><p><strong>The problem nobody talks about until it’s too late:</strong></p><p>If an attacker gets JavaScript execution on your site — whether through a compromised dependency, a misconfigured CDN, or an XSS vulnerability you didn’t know existed — they can read that token and reuse it anywhere until it expires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bek_li-RUvud9TLsh-Hs6A.png" /><figcaption><strong>The localStorage Trap.</strong> Storing your JWT in localStorage is like leaving your house key under the mat. Any malicious script running on your page can easily steal it.</figcaption></figure><p>This isn’t theoretical. This is how real breaches happen.</p><p>Once stolen, that token:</p><ul><li>Works from any device</li><li>It is virtually impossible to revoke</li><li>Often has a long expiry (because nobody wants to log in every 5 minutes)</li></ul><p>For public-facing web apps, this trade-off isn’t worth it.</p><h3>Common Approach #2: JWT in HttpOnly Cookies</h3><p>This is the safer, browser-first approach.</p><p><strong>How it works:</strong></p><ul><li>JWT stored in an HttpOnly cookie</li><li>JavaScript literally cannot read it</li><li>The browser sends it automatically with every request</li></ul><p><strong>What this fixes:</strong></p><ul><li>Tokens can’t be stolen via XSS</li><li>Your attack surface shrinks dramatically</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_hB4j18VnP4P_QlorsLnRw.png" /><figcaption><strong>The HttpOnly Cookie Shield.</strong> By using an HttpOnly cookie, you lock your JWT away from JavaScript. Even if an attacker injects a script, they cannot access the token.</figcaption></figure><p><strong>What it introduces:</strong></p><ul><li>CSRF risk</li></ul><p>Because cookies are sent automatically, your API now has a new job: verifying that requests actually came from <em>your</em> frontend, not some random, malicious site.</p><h3>CSRF Protection: Why It’s Still Needed</h3><p>Let’s clear up a common misconception: CSRF is not about stealing tokens. It’s about abusing trust.</p><p>Picture this: a user logs into your app, then visits a malicious site while still logged in. That malicious site can make requests to your API, and your server will happily accept them because the browser automatically sends the auth cookie.</p><p>Your server can’t tell the difference between a legitimate request from your frontend and a forged one from evil.example.com.</p><h3>The Double Submit Cookie Pattern</h3><p>Here’s a clean solution that actually works:</p><ol><li>Server sets a <strong>non-HttpOnly</strong> cookie (e.g., XSRF-TOKEN)</li><li>Frontend reads this cookie and sends its value in a custom header (e.g., X-XSRF-TOKEN)</li><li>Server verifies that the cookie value matches the header value</li></ol><p>Why does this work? An attacker’s site cannot read your cookies due to the same-origin policy. No cookie value = no matching header = request rejected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDuRZoWcrP_SFX8A9ykVTg.png" /><figcaption><strong>CSRF Attack &amp; Protection.</strong> Without protection, a malicious site can forge requests using your user’s session. With the Double Submit Cookie pattern, a custom header that the attacker cannot provide is required, blocking the attack.</figcaption></figure><p>This protects all state-changing requests while keeping your auth cookies secure.</p><h3>Where Many Apps Go Wrong: The Refresh Token Gap</h3><p>Let’s say you’ve followed best practices so far:</p><ul><li>One JWT</li><li>Stored in an HttpOnly cookie</li><li>Expires in 15 minutes</li></ul><p>Great! Solid security posture.</p><p>Then you add an /refresh endpoint to avoid constant logins. Also great!</p><p>But here’s where I see teams mess up: they make the /refresh endpoint require a valid JWT.</p><p>See the problem?</p><p><strong>If a user is inactive for 16 minutes:</strong></p><ul><li>Access token expires</li><li>/refresh call fails with 401</li><li>User gets kicked to the login screen</li></ul><p>This is secure but creates terrible UX. Your users will hate you, and honestly, they’d have a point.</p><h3>The Gold Standard: Access + Refresh Tokens</h3><p>This is the pattern used by GitHub, Google, Auth0, and basically every platform that takes auth seriously.</p><h3>Token Roles</h3><p><strong>Access Token:</strong></p><ul><li>Short-lived (5–15 minutes)</li><li>Used on every single API request</li><li>Contains user identity and permissions</li></ul><p><strong>Refresh Token:</strong></p><ul><li>Long-lived (7–30 days)</li><li>Used <em>only</em> to obtain new access tokens</li><li>Never sent with normal API requests</li></ul><h3>The Flow</h3><ol><li>User logs in successfully</li><li>Server issues two tokens:<br>- Access token cookie (15 min expiry)<br>- Refresh token cookie (7-day expiry)</li><li>Frontend makes API requests using an access token</li><li>Access token expires after 15 minutes</li><li>Frontend automatically calls /refresh with the refresh token</li><li>Server validates the refresh token and issues fresh tokens</li><li>The user never even notices</li></ol><p><strong>The critical rule:</strong> The refresh endpoint must NOT require a valid access token. That’s the whole point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlS_srtCmHH6eFyVJbZXKg.png" /><figcaption><strong>The Access + Refresh Token Flow.</strong> This flowchart shows the complete lifecycle: login, normal API usage with an access token, and the automatic refresh process when the access token expires, ensuring both security and a smooth user experience.</figcaption></figure><h3>Storing Refresh Tokens Safely</h3><p>Here’s something I wish more tutorials mentioned: <strong>do not store refresh tokens in plaintext</strong>.</p><p>Seriously. Don’t.</p><p><strong>Recommended approach:</strong></p><ul><li>Hash refresh tokens before storing them (treat them like passwords)</li><li>Store one token per user or per device</li><li>Rotate refresh tokens on every use</li></ul><p><strong>If an old refresh token is ever used again:</strong></p><ul><li>Assume the session is compromised</li><li>Immediately revoke everything</li><li>Force re-authentication</li></ul><p>This prevents replay attacks and stops stolen tokens from being useful for very long.</p><h3>Cookie Settings That Actually Matter</h3><p>For browser-based apps, get these flags right or go home:</p><ul><li><strong>HttpOnly</strong>: Prevents JavaScript access (XSS protection)</li><li><strong>Secure</strong>: HTTPS only (no cleartext transmission)</li><li><strong>SameSite=Lax</strong>: Blocks most CSRF while preserving normal UX</li></ul><p>If you need cross-site cookies (usually a code smell, but sometimes necessary):</p><ul><li>Use SameSite=None</li><li>Implement strong CSRF protection</li><li>Be extra careful about everything</li></ul><h3>Defense in Depth Still Matters</h3><p>Auth is not just about tokens. It’s a system.</p><p>You should also:</p><ul><li>Use Helmet or similar security middleware</li><li>Configure a real Content Security Policy (not just the default)</li><li>Avoid inline scripts wherever possible</li><li>Regularly audit third-party dependencies</li></ul><p>Remember: CSRF protection does not prevent XSS. HttpOnly cookies do not fix bad JavaScript. Each layer exists for a specific reason, and skipping any of them leaves you vulnerable.</p><h3>Final Takeaway</h3><p>For browser-based web apps, here’s your checklist:</p><p>✅ Avoid storing JWTs in localStorage<br>✅ Use HttpOnly cookies for tokens<br>✅ Implement CSRF protection<br>✅ Use access + refresh token pattern<br>✅ Rotate refresh tokens on use<br>✅ Keep access tokens short-lived</p><p>This setup isn’t trendy. It’s not particularly exciting. It’s actually pretty boring.</p><p>And that’s exactly why it works.</p><p>Security shouldn’t be about clever hacks or cutting-edge techniques. It should be about boring, well-tested patterns that make it hard to screw up.</p><p>Your users won’t notice good auth — they’ll just keep using your app. And honestly? That’s the best compliment your authentication system can get.</p><p><em>Have questions or war stories about auth implementations? I’d love to hear them in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=042c99e305ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phase 1 — How We Built a Content-Based Exercise Recommender Using MITRE ATT&CK]]></title>
            <link>https://dataalgo.medium.com/phase-1-how-we-built-a-content-based-exercise-recommender-using-mitre-att-ck-d18d23f45328?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d18d23f45328</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[recommender-systems]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 05:09:35 GMT</pubDate>
            <atom:updated>2025-11-14T05:09:35.988Z</atom:updated>
            <content:encoded><![CDATA[<h3>Phase 1 — How We Built a Content-Based Exercise Recommender Using MITRE ATT&amp;CK</h3><p>This project started with a simple question:</p><blockquote><strong>“If an organisation completed one exercise, can we automatically find others that teach similar skills?”</strong></blockquote><p>To explore this, we built a content-based recommender that compares cyber-exercises through their MITRE ATT&amp;CK techniques and threat descriptions. This became the baseline before we moved on to collaborative filtering and deep learning.</p><p>Here’s how Phase 1 came together.</p><h3>1. Cleaning the exercise metadata</h3><p>The exercise dataset had descriptive fields like:</p><ul><li><strong>ExThreat</strong></li><li><strong>ExTTPs</strong> (MITRE techniques)</li></ul><p>But these columns weren’t tidy. Many cells had:</p><ul><li>commas</li><li>semicolons</li><li>inconsistent spacing</li><li>multiple items inside one cell</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*goaf0zyL_Qp3E-ucP_xnHw.png" /><figcaption>excercise dataset</figcaption></figure><p>Before we could build anything, we had to normalise all this. So we wrote helper functions to normalise everything. The cleaning steps:</p><ul><li>Split the raw text correctly, even with mixed separators</li><li>lowercase everything</li><li>replace spaces with underscores</li><li>remove duplicates</li><li>prefix items (e.g., threat: or ttp:) so categories don’t mix</li></ul><p>For example:</p><pre>&quot;Randsomeware; Access Token Manipulation&quot;</pre><p>Became:</p><pre>threat:ransomware<br>ttp:access_token_manipulation</pre><p>This ensured that every exercise had a clean set of tokens.</p><h3>2. Turning exercises into numbers using TF-IDF</h3><p>Once we had consistent tokens, we joined them into a single string per exercise:</p><pre>threat:ransomware ttp:access_token_manipulation ttp:credential_dumping ttp:defense_evasion ttp:process_injection</pre><p>Then we passed this through <strong>TF-IDF</strong>.</p><p>Why TF-IDF?</p><ul><li>It converts text into numeric vectors.</li><li>It highlights uncommon but meaningful TTPs.</li><li>It downweights very common tokens that appear everywhere.</li></ul><p>After this step, every exercise became a high-dimensional vector describing its technical content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*p5e10PT8DyJaoykrl23PAQ.png" /><figcaption>High-dimensional vector (converted exercises into numerical vectors so we can calculate similarity mathematically.)</figcaption></figure><h3>3. Comparing every exercise to every other exercise</h3><p>With TF-IDF vectors ready, we measured similarity using <strong>cosine similarity</strong>.<br> This gave us a square matrix where:</p><ul><li>each row = one exercise</li><li>each column = another exercise</li><li>each value = similarity score from 0 to 1</li></ul><p>We also scaled each row so the highest number equals 1. This makes comparisons easier to interpret.</p><p>This similarity matrix is the core of the whole recommender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqpaw2r55YLLSMD8Rpqzjg.png" /></figure><h3>4. Extracting the Top-K similar exercises</h3><p>Once the similarity matrix was ready, we wrote a simple function:</p><pre>topk_similar_exercises(EXID, K=5)</pre><p>For each exercise:</p><ul><li>remove itself (similarity = 1)</li><li>Sort all others by similarity score</li><li>return the top five closest ones</li></ul><p>An example result might look like:</p><pre>[(22, 0.278), (28, 0.217), (5, 0.204), (9, 0.192), (8, 0.154)]</pre><p>This forms the baseline recommendation:</p><blockquote><em>“If you completed Exercise 1, the next best five drills to run are 22, 28, 5, 9 and 8.”</em></blockquote><p>The simple logic already felt meaningful because everything was grounded in a real MITRE technique overlap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ChtHnNnPrw4UnarlGudng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUoWWZBUY5mQKZttuNjTag.png" /></figure><h3>What Phase 1 Achieved</h3><p>By the end of this phase, we had:</p><ol><li>A clean, structured representation of each cyber-exercise.</li><li>A TF-IDF feature space capturing MITRE TTP relationships.</li><li>A cosine similarity matrix linking every exercise to every other one.</li><li>A working <strong>exercise-to-exercise recommender</strong>.</li></ol><p>Most importantly, Phase 1 gave us a strong <strong>baseline</strong>.<br> No machine learning yet — just pure content similarity.</p><p>This became the foundation for Phase 2 (collaborative filtering) and Phase 3 (deep-learning TTP prediction).</p><p>Github: <a href="https://github.com/sumanxcodes/COS70008-cybersec-recsys/blob/main/notebooks/Phase%201%20-%20Content%20based%20ItemxItem%20Recommender.ipynb">https://github.com/sumanxcodes/COS70008-cybersec-recsys/blob/main/notebooks/Phase%201%20-%20Content%20based%20ItemxItem%20Recommender.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d18d23f45328" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Cybersecurity Exercises Need Recommender Systems]]></title>
            <link>https://dataalgo.medium.com/why-cybersecurity-exercises-need-recommender-systems-8c5637c8b1de?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c5637c8b1de</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 01:46:13 GMT</pubDate>
            <atom:updated>2025-11-14T05:14:50.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATInStkmDXVWokRKPsPG6A.png" /><figcaption>Illustration inspired by <a href="https://realpython.com/build-recommendation-engine-collaborative-filtering/">Real Python.</a></figcaption></figure><p>Hi, I’m Suman. I recently started a project focused on <strong>cybersecurity exercise recommendation systems</strong>. In this blog series, I’ll share my progress step by step as I build the system and explain what I learn along the way.</p><h3>The Problem</h3><p>Organisations run cybersecurity exercises all the time — things like phishing simulations, incident response drills, or red-team vs blue-team activities. These exercises are meant to test how ready a company is against real-world attacks.</p><p>But here’s the issue:</p><ul><li>Once the exercise is done, deciding <strong>what comes next</strong> is often manual and inconsistent.</li><li>Security teams might repeat the same drill, even if they’ve already mastered it.</li><li>Or worse, they may skip exercises that would actually prepare them for the threats they face most.</li></ul><p>This means a lot of effort goes in, but the learning outcomes aren’t always maximised.</p><h3>Where MITRE ATT&amp;CK Comes In</h3><p>If you’re not familiar, the <strong>MITRE ATT&amp;CK framework</strong> is basically a giant knowledge base of hacker tactics and techniques. Think of it as a detailed map of how attackers break in, move around, steal data, or disrupt systems.</p><p>By tagging exercises with ATT&amp;CK techniques, we can align training directly to <strong>real-world adversary behaviour</strong>. This makes exercises less random and more relevant.</p><h3>The Project Idea</h3><p>The goal is to build a <strong>recommender system, much like</strong> how Netflix suggests movies, but in this case, it will recommend cybersecurity exercises.</p><p>Instead of guessing, the system will suggest:</p><ul><li>“If you just ran this exercise, the next most relevant one is…”</li><li>Or, “Based on your threat profile, here are the top exercises you should run.”</li></ul><p>This saves time and ensures that training paths actually build resilience, not just check a box.</p><h3>Phase 1 Focus</h3><p>The project has three phases, but right now I’m focusing on <strong>Phase 1: the baseline recommender</strong>.</p><p>Here’s what it means:</p><ul><li>Take each exercise and break it down into descriptive tags (e.g., threat type, ATT&amp;CK techniques, complexity, length).</li><li>Convert those into numbers so a computer can compare them.</li><li>Calculate similarities between exercises.</li><li>Recommend the “closest” exercises as next steps.</li></ul><p>In the upcoming blogs, I’ll explain how this works with examples, visuals, and results. Don’t worry — I’ll keep it light on the coding side and focus more on interpreting what the results mean.</p><h3>Why This Matters</h3><p>Cybersecurity training isn’t just about doing drills — it’s about doing the <strong>right drills</strong> at the <strong>right time</strong>. A recommender system can guide organisations to build smarter, more tailored training plans.</p><p>This is just the starting point. In the next post, I’ll dive into the dataset we’re working with and what kind of exercises and organisations it covers.</p><p>Stay tuned 👋</p><h3>Further Reading</h3><p>If you’d like to explore some of the background behind this project:</p><ul><li><a href="https://attack.mitre.org/">MITRE ATT&amp;CK® Framework </a>— a detailed knowledge base of adversary tactics and techniques.</li><li>Ferreira, L. et al. (2023). <em>Recommender Systems in Cybersecurity Exercises</em> (Computers &amp; Security journal) — a great overview of how recommendation methods are being adapted for cyber training.</li><li><a href="https://www.learndatasci.com/glossary/tf-idf-term-frequency-inverse-document-frequency/">TF-IDF Explained (LearnDataSci) </a>— simple guide to Term Frequency–Inverse Document Frequency, the method we’ll use to encode exercise data.</li><li><a href="https://realpython.com/build-recommendation-engine-collaborative-filtering/">Real Python: Build a Recommendation Engine With Collaborative Filtering</a> — the original post where the inspiration for the illustration style came from.</li></ul><h3>Link for next part</h3><p><a href="https://dataalgo.medium.com/phase-1-how-we-built-a-content-based-exercise-recommender-using-mitre-att-ck-d18d23f45328">Phase 1 — How We Built a Content-Based Exercise Recommender Using MITRE ATT&amp;CK</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c5637c8b1de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Context Engineering Is the New Vibe Coding]]></title>
            <link>https://dataalgo.medium.com/context-engineering-is-the-new-vibe-coding-d0df30f68bf0?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0df30f68bf0</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 02:55:37 GMT</pubDate>
            <atom:updated>2025-07-13T02:56:44.480Z</atom:updated>
            <content:encoded><![CDATA[<p>Remember when we used to <em>vibe code</em>? You’d throw together colours, animations, interactions — whatever made the moment feel good. No style guide, no rigid plan. Just instinct, taste, and flow.</p><p>That worked, especially when you were building for a single screen, a single use case, a single user.</p><p>But the world’s changed. Now we’re designing systems that have to adapt across contexts, platforms, moods, and moments. It’s no longer enough to just “vibe it out.” We need to be more intentional.</p><p>Enter: <strong>context engineering</strong>.</p><h4>From Feeling to Framing</h4><p>Vibe coding is all about intuition. Context engineering is about shaping the <em>conditions</em> so that intuition actually lands.</p><p>Instead of just designing the output — the interface, the copy, the interaction — you design the frame it exists in:</p><ul><li>Who’s seeing this?</li><li>What state are they in?</li><li>What data or signals can shape how the system responds?</li></ul><p>Think of a chatbot that changes tone based on your mood, or an app that adapts its layout depending on location or time of day. That’s context engineering in action. It’s not just smart UX — it’s systems thinking with emotional intelligence.</p><h4>Why It Matters Now</h4><p>We’re building in a world of AI models, personalised feeds, and adaptive everything. Vibes still matter — but they have to be *situationally aware*.</p><p>Context engineering takes the soul of vibe coding and gives it structure. It’s still creative. Still intuitive. But now it’s grounded in systems that can scale.</p><p>We’re not just making things feel good. We’re making them feel ri<em>ght</em> for <em>whoever</em> needs them, <em>whenever </em>they show up.</p><h4>TL;DR</h4><p><strong>Vibe coding walked so context engineering could run.</strong></p><p>One is about the moment. The other is about the ecosystem.</p><p>As builders, creatives, and technologists, our job isn’t just to make things feel right — it’s to make them feel right <em>in context</em>. That’s the new creative challenge.</p><p>And honestly? That’s the vibe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0df30f68bf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rethinking Intelligence and Security in the Age of AI]]></title>
            <link>https://dataalgo.medium.com/rethinking-intelligence-and-security-in-the-age-of-ai-4811ec7dd2c5?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4811ec7dd2c5</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 04:46:22 GMT</pubDate>
            <atom:updated>2025-07-07T04:46:42.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkXdCpgvcdRHVxlOdYFwmw.png" /></figure><p>As someone fascinated by both AI and cybersecurity, I often find myself torn between the excitement of innovation and the anxiety that comes with its consequences. There’s a sense that we’re standing at the edge of something massive — but it’s not always clear what’s coming next, or how prepared we really are. Listening to Nikesh Arora talk about these topics made me pause. Not because it was dystopian or alarmist, but because of how grounded, sharp, and forward-looking his thinking was. It made the future feel both more urgent and more possible.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvPvnzWoK24Q%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvPvnzWoK24Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvPvnzWoK24Q%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/11e14d174b0ae2308ad11b7899700a09/href">https://medium.com/media/11e14d174b0ae2308ad11b7899700a09/href</a></iframe><p>Nikesh Arora, currently the CEO of Palo Alto Networks, has had one of the most fascinating career arcs — from Ghaziabad to Google to SoftBank, and now leading one of the biggest names in cybersecurity. But what really stood out wasn’t just his resume. It was his ability to make sense of where technology is headed — and explain it without the usual buzzwords.</p><h3>AI and the Changing Face of Cybersecurity</h3><p>One of the most significant takeaways was the profound connection between AI and cybersecurity. With billions of people online and everything from cars to robotic arms connected to the internet, the “attack surface” is exploding. Arora called cybersecurity a “gift that’ll keep on giving” — not because it’s easy, but because the need for it will only grow.</p><p>He pointed out that hacking has become a professional industry. It’s no longer just rogue individuals — it’s structured, profitable, and often tied to nation-states. Future wars may be fought in part through cyberattacks, as we’ve already seen in recent conflicts.</p><p>Then there’s quantum computing. When it arrives in full force, it could break today’s encryption in minutes, forcing a complete reset of our digital security systems.</p><p>But here’s the twist — most cyberattacks today are still low-tech. They often succeed due to simple human mistakes, such as weak passwords or clicking on phishing links. So while we prepare for advanced threats, we still need to get the basics right.</p><p>Arora believes that AI can help here, too — not by solving problems through brute-force computing, but by providing smarter, real-time protection. For investors and entrepreneurs, he suggests looking for new vulnerabilities created by AI itself, especially around agentic systems.</p><h3>The Rise of Agentic AI</h3><p>A concept Arora discusses in depth is <strong>agentic AI</strong> — systems that not only understand commands but can take action. Think of a bot that knows your food preferences, checks your calendar, and books a restaurant. Or a self-driving car deciding when to turn or brake. That’s the shift from answering questions to doing things.</p><p>This is where new risks emerge. What happens when a malicious actor takes control of one of these agents? They might start with minor annoyances, but they could also reprogram industrial systems or bypass security protocols. Arora calls this a “blue sky problem” — a brand-new area with high stakes and no clear solutions yet.</p><h3>How AI Will Change Product Design and Business</h3><p>Arora believes we’ll see a significant shift in how products are developed. Today, much of product design involves building interfaces to help users access backend systems. In the future, with the advancement of powerful AI and automation, users may interact through voice or chat. Interfaces may fade into the background.</p><p>He describes a future of “applications for one” — highly personalised tools built around your preferences and behaviour. That’s a significant departure from today’s one-size-fits-all apps.</p><p>In the enterprise software sector, Arora predicts the decline of traditional analytics platforms. Instead of helping people interpret data, future tools will help them take action directly. Even digital advertising could be disrupted. If AI agents choose things for us, we may no longer respond to ads the same way.</p><p>At the same time, Arora notes that while user interfaces will evolve, core systems of record — such as financial databases or ownership ledgers — will likely remain, especially due to regulatory requirements.</p><h3>Intelligence as a Commodity</h3><p>Arora compares the rise of AI to the way the internet once democratised access to information. AI is now democratising intelligence itself. This could lead to more consistent expertise across teams, but it also raises the bar for what makes people stand out. In a world where AI can mimic expertise, real value will come from solving problems that aren’t already codified.</p><p>He also highlights the importance of private data. While public data has helped train today’s models, there’s far more value hidden in proprietary datasets, like those in healthcare or chip design. Whoever taps into that data responsibly could solve more meaningful problems.</p><h3>Investing in the AI Age: Brains vs. Wrappers</h3><p>Arora describes AI models as “brains” that are getting smarter, some even passing professional exams. But instead of trying to build the next big model, he thinks the real opportunity lies in the <strong>wrappers</strong> — the tools and interfaces built around these brains to solve specific problems.</p><blockquote>“The art is not in securing the brain — but in figuring out what to do with it.”</blockquote><p>As intelligence becomes more widely available, there will be significant shifts in market share. Companies that utilise AI to solve problems faster, more efficiently, and more effectively will grow, often at the expense of slower, legacy businesses.</p><h3>What Founders Need to Know</h3><p>For anyone building something new, Arora’s message is clear: don’t aim for minor improvements. With AI moving so fast, your idea needs to be 10x better than what exists — or it may not be relevant for long. He believes that AI allows companies to be built faster and leaner, with fewer people, but more creativity.</p><h3>Final Thoughts: The Long Game</h3><p>Currently, Arora views the AI space as a gold rush. Valuations are high. Hype is everywhere. But underneath that, the fundamentals are strong. AI will reduce waste, automate repetitive tasks, and unlock new kinds of value. It’s not just a trend — it’s a reshaping of how the world works.</p><p>He also points out the human side. AI may not change what we need (think Maslow’s hierarchy), but it could affect how we meet those needs, especially in the early stages of our careers. Some jobs will disappear. New ones will emerge. Just like every other major shift before it.</p><h3>What I Took Away</h3><p>I left the podcast feeling more aware — and strangely optimistic. AI is moving fast, yes, but if we keep asking the right questions, stay grounded in what matters, and build with care, there’s still a lot to look forward to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4811ec7dd2c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lightweight Secure Communication over LoRa with Arduino]]></title>
            <link>https://dataalgo.medium.com/lightweight-secure-communication-over-lora-with-arduino-3a249d1295aa?source=rss-52a93e9ae85f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a249d1295aa</guid>
            <dc:creator><![CDATA[Data:Algo]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 04:02:56 GMT</pubDate>
            <atom:updated>2025-07-07T04:02:56.563Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever heard of a Flux Tower? Imagine a tall pole in the middle of a forest or a farm, quietly measuring things like carbon dioxide, water vapour, and energy, kind of like a weather station on steroids. These towers help scientists understand how the planet breathes. Cool, right?</p><figure><img alt="Eddy Covariance Flux Tower" src="https://cdn-images-1.medium.com/max/768/1*lQjAXBvW1xyIXE2AJ-9qUA@2x.jpeg" /><figcaption>Image courtesy of <a href="https://www.tern.org.au/what-is-an-eddy-covariance-flux-tower/">TERN Australia</a> — What is an Eddy Covariance Flux Tower?</figcaption></figure><p>Flux Towers aren’t just smart — they’re secure too. With encrypted communication, cellular uplinks, and protected networks, they’re built for serious science. But here’s the catch: they’re also costly and not plug-and-play. For students, citizen scientists, or small-scale researchers, setting one up can feel like trying to launch a satellite to measure some CO₂.</p><p>That’s where our project began.</p><p>As part of a university assignment at Swinburne University, our professor, Dr. Phillip, posed a challenge:</p><p>“Can we build a secure, low-cost LoRa communication system that mimics the functionality of a Flux Tower?”</p><p>That question sparked the idea behind this project — and the blog you’re reading now.</p><p>We set out to design a lightweight, affordable, and secure alternative using <strong>LoRa radios, Arduino-compatible boards, and custom-built cryptographic protocols</strong>. Something that can be deployed in the field by students, hobbyists, or researchers on a budget without compromising security.</p><p>Here’s what we came up with:</p><ul><li>Custom stream cipher encryption using Diffie-Hellman key exchange</li><li>Challenge-response protocol to verify device authenticity</li><li>TTL-based mesh networking for relaying data across multiple nodes</li><li>EEPROM storage for key persistence and recovery</li><li>A complete system that runs on basic hardware — no cellular, no cloud required</li></ul><p>In this blog, I’ll walk you through how it works, how we built it, and why this kind of DIY secure LoRa system could be helpful far beyond the classroom.</p><p>Let’s dive in.</p><h3>System Overview: How It All Works</h3><p>At the heart of our project is a simple but powerful idea: build a <strong>secure communication network using LoRa radios and microcontrollers</strong>, without relying on expensive infrastructure or internet access.</p><p>The system has two main types of devices:</p><ul><li><strong>TX nodes</strong> (transmitters): These are like little environmental scouts — they gather or simulate data (like CO₂ levels) and send it securely.</li><li><strong>RX node</strong> (receiver): This is the central brain. It collects data from TX nodes, verifies it, decrypts it, and processes or displays it.</li><li><strong>Relay nodes</strong>: These don’t generate or consume data — instead, they act like friendly mail carriers. If a TX node can’t reach the RX directly, the relay helps pass the message along. Think of them as signal bridges in the middle of nowhere.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIv4C9Gr79jmG8hvSR17UQ.png" /><figcaption>Coverage Architecture showing how messages hop from TX to RX using relay nodes and TTL logic.</figcaption></figure><ul><li><strong>Management Dashboard:</strong> We built a lightweight Python-based dashboard using <a href="https://streamlit.io/">Streamlit</a> to configure devices and monitor communication. It connects via serial and is mainly used to write key values like deviceId and the SEED into EEPROM — the seed being essential for generating each node’s private/public keys during Diffie-Hellman exchange. Once running, the dashboard logs real-time message flow (PING, PONG, DH, etc.), verifies challenge–responses, and tracks relays. It’s a simple dev tool, but crucial for debugging and validating secure communication.</li></ul><p>Once the devices are configured using the dashboard, they’re ready to be deployed. That’s when the real action begins. Each node follows a secure but straightforward communication process — from saying hello, to verifying identity, to sending encrypted data. It’s like a digital handshake followed by a private conversation over LoRa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zNsdHJUxsLgOT9mFJdAN_Q.png" /><figcaption><em>System Architecture — showing TX, RX, and Relay nodes, along with EEPROM configuration via the Management Dashboard.</em></figcaption></figure><h3>Message Lifecycle: From Hello to Encrypted Data</h3><p>Every transmitter (TX) follows a structured, secure conversation flow with the receiver (RX). This isn’t just a simple “send and receive” — it’s a cryptographic handshake with identity checks and encrypted payloads, all managed through a finite state machine.</p><p>Here’s what happens step by step:</p><p><strong>1. Node Discovery &amp; Reset (CLEAR, PING, PONG)</strong></p><ul><li>The RX node broadcasts a CLEAR message to reset all nodes, clearing previous keys and states.</li><li>It then sends a PING to discover active TX nodes.</li><li>Any TX in range replies with a PONG, confirming it&#39;s online and ready.</li></ul><pre>CLEAR:RX1:ALL:RESET<br>PING:RX1:ALL:Who is out there?<br>PONG:TX1:RX1:READY</pre><p><strong>2. Diffie-Hellman Key Exchange (PK &amp; ACK)</strong></p><ul><li>RX initiates the DH key exchange by sending its public key in a PK message.</li><li>TX responds with its own PK and an ACK to confirm receipt.</li><li>RX also sends a final ACK. Both now compute the same <strong>shared session key</strong> using their private keys and the received public key.</li></ul><pre>PK:RX1:TX1:&lt;rx_public_key&gt;<br>ACK:TX1:RX1:OK<br>PK:TX1:RX1:&lt;tx_public_key&gt;<br>ACK:RX1:TX1:OK</pre><p><strong>3. Challenge–Response Authentication (CHAL &amp; RESP)</strong></p><ul><li>RX sends an encrypted random challenge to the TX in a CHAL message.</li><li>TX decrypts it, computes the correct response using XOR with the session key, and replies with a RESP.</li><li>RX compares the result and if it matches, sends AUTH_SUCCESS.</li></ul><pre>CHAL:RX1:TX1:0:&lt;EncryptedChallenge&gt;<br>RESP:TX1:RX1:0:&lt;EncryptedResponse&gt;<br>AUTH_SUCCESS:RX1:TX1</pre><figure><img alt="After the shared session key is established, the receiver (RX1) sends a random challenge encrypted with the session key. The transmitter (TX1) decrypts it, performs an XOR operation using the session key to compute the expected response, then sends it back. If RX1 validates the response correctly, it sends back AUTH_SUCCESS, confirming the TX1 is authenticated." src="https://cdn-images-1.medium.com/max/1024/1*ia2YWu8c5O5n6IJx1X5SqA.png" /><figcaption>Challenge–Response Authentication Process</figcaption></figure><p>4. <strong>Encrypted Data Transmission (MSG)</strong></p><ul><li>Now authenticated, TX starts sending encrypted sensor data using the session key and a unique message count.</li><li>RX uses the same session key and count to decrypt the payload.</li></ul><pre>MSG:TX1:RX1:5:1:&lt;EncryptedData&gt;<br>MSG:TX1:RX1:5:2:&lt;EncryptedData&gt;</pre><p>The format follows:</p><pre>MSG:&lt;SenderID&gt;:&lt;ReceiverID&gt;:&lt;TTL&gt;:&lt;MessageCount&gt;:&lt;Payload&gt;</pre><figure><img alt="This diagram shows how the transmitter (TX1) and receiver (RX1) each generate public keys using their own seed values and predefined DH parameters. After computing a shared session key, TX1 encrypts its sensor data and sends it to RX1 in a structured message format. RX1 decrypts each message using the same session key, ensuring secure, end-to-end data transmission over LoRa." src="https://cdn-images-1.medium.com/max/1024/1*GEUh859oRM19bD0N8oHu0g.png" /><figcaption>Secure Encrypted Data Transmission between TX and RX</figcaption></figure><p><strong>5. Multi-hop Relay with TTL</strong></p><p>If the RX is too far, the message is automatically relayed by intermediate <strong>relay nodes</strong> using TTL-based flooding:</p><ul><li>Each relay reduces TTL by one before forwarding.</li><li>Relays keep track of previously seen messages (via SenderID and MessageCount) to prevent duplicates.</li></ul><pre>MSG:TX1:RX1:3:24:&lt;Encrypted&gt;<br>RelayA → MSG:TX1:RX1:2:24:&lt;Encrypted&gt;<br>RelayB (duplicate) → cancels forwarding</pre><figure><img alt="This diagram shows how a message from the transmitter (TX1) is relayed through two intermediate nodes (RL1 and RL2) before reaching the central receiver (RX1). Each relay reduces the TTL (Time-To-Live) value by one before forwarding, ensuring messages don’t loop infinitely. Once the TTL expires or the message reaches RX1, it is processed and decrypted securely." src="https://cdn-images-1.medium.com/max/1024/1*PVlY5s13Rl_oq4mi0q535Q.png" /><figcaption>TTL-Based Multi-Hop Message Forwarding</figcaption></figure><p>Only one relay ultimately forwards the message. The others recognise it as a duplicate and drop it, keeping the network efficient and loop-free.</p><h3>Challenges &amp; Lessons Learned</h3><p>No great project comes without a few head-scratching moments — and this one had its share.</p><p><strong>1. Cryptography on a Tiny Arduino</strong></p><p>We knew Arduinos had limited memory, but trying to implement <strong>Diffie-Hellman</strong>, a stream cipher, and session management all on the UNO R4 Minima felt like fitting a jet engine into a lawn mower. We had to keep things super lean — reusing encryption logic (like XOR) for both challenge-response and data encryption to save space.</p><p><strong>2. Managing Node States</strong></p><p>With multiple transmitters, relays, and a single central receiver, things become complicated quickly. We implemented a <strong>finite state machine (FSM)</strong> for each peer to maintain consistent communication and prevent bugs. This made debugging easier and provided a clear map of who was talking to whom and what stage they were at.</p><p><strong>3. Relay &amp; TTL Logic</strong></p><p>Our first mesh attempts were chaos — duplicate messages flying everywhere. We introduced TTL (Time-To-Live) to limit the number of hops a message could take, and we added message deduplication using sender IDs and message counts. That finally gave us control.</p><p><strong>4. EEPROM Interaction</strong></p><p>We initially assumed we could write directly to EEPROM over serial — turns out, nope. So we created our own WRITE_SEED and READ_EEPROM commands that the dashboard could send, and the device would interpret internally. Problem solved.</p><p><strong>5. Streamlining Development Tools</strong></p><p>Switching from the Arduino IDE to <strong>PlatformIO</strong> inside VS Code was a game-changer. It enables us to create a single, modular codebase with distinct environments for each node (TX, RX, Relay), making it easy to switch, compile, and upload code without requiring messy edits.</p><h3>Conclusion &amp; What’s Next</h3><p>This project began as a university challenge and evolved into a comprehensive, hands-on exploration of secure communication over LoRa. By combining <strong>Diffie-Hellman key exchange</strong>, <strong>challenge–response authentication</strong>, and a custom <strong>XOR stream cypher, we developed a lightweight protocol designed for constrained devices, with no internet, no cloud, and no unnecessary complexity</strong>.</p><p>From configuring nodes via our custom <strong>Streamlit dashboard</strong> to watching packets hop through <strong>relay nodes</strong> with controlled TTL, we learned a ton about embedded systems, peer-to-peer messaging, and the art of keeping things secure without overcomplicating them.</p><p>But we’re just getting started.</p><h3>Future Improvements</h3><ul><li><strong>Merge relay + transmitter roles</strong>: To reduce hardware requirements, future versions could allow transmitters to act as relays when idle.</li><li><strong>Upgrade to STM32 or ESP32</strong>: More powerful microcontrollers could support advanced crypto algorithms like AES, or even HMAC-based integrity checks.</li><li><strong>Add real-time charts &amp; analytics</strong>: Expanding the dashboard with live graphs and performance stats would make it more useful for researchers in the field.</li></ul><h3>Resources &amp; Links</h3><p>If you’d like to explore the code, test the system, or build your own secure LoRa network, everything is open-source and available here:</p><ul><li><strong>LoRa Secure Link (Arduino Code for TX, RX, and Relay Nodes)</strong><br> <a href="https://github.com/sumanxcodes/lora-secure-link">👉 GitHub — sumanxcodes/lora-secure-link</a></li><li><strong>Streamlit Dashboard (for EEPROM config &amp; serial logs)</strong><br> <a href="https://github.com/sumanxcodes/LoRa-mgmt-dashboard">👉 GitHub — sumanxcodes/LoRa-mgmt-dashboard</a></li></ul><h3>Thanks for Reading!</h3><p>Whether you’re an embedded systems enthusiast, a student looking for project ideas, or just curious about how LoRa can be made more secure , we hope this project gives you something to build on.<br> Feel free to fork it, remix it, or reach out with questions or feedback.</p><p>— <em>Suman Raj Sharma</em><br> 🌐 <a href="https://sumanrajsharma.dev/">https://sumanrajsharma.dev</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a249d1295aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>