<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tabrez Ahmed</title>
    <description>The latest articles on DEV Community by Tabrez Ahmed (@seucra).</description>
    <link>https://dev.to/seucra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3844957%2F9a0d7eb3-d14b-42a1-8a09-2a818c591780.jpg</url>
      <title>DEV Community: Tabrez Ahmed</title>
      <link>https://dev.to/seucra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seucra"/>
    <language>en</language>
    <item>
      <title>The Packet That Should Never Have Been Seen: Protecting Data Privacy in Computer Networks</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Thu, 08 Oct 2026 12:49:43 +0000</pubDate>
      <link>https://dev.to/seucra/the-packet-that-should-never-have-been-seen-protecting-data-privacy-in-computer-networks-5fig</link>
      <guid>https://dev.to/seucra/the-packet-that-should-never-have-been-seen-protecting-data-privacy-in-computer-networks-5fig</guid>
      <description>&lt;p&gt;Every second, the Internet is flooded with billions of packets zooming from one device to another. They move through all kinds of gear: routers, switches, ISPs, data centers, and cloud setups. You'd think your passwords, bank info, private messages—every little personal detail—would be exposed somewhere along the way. But somehow, only the intended receiver can see them. How does that even work?&lt;/p&gt;

&lt;p&gt;That's the big question at the core of &lt;strong&gt;data privacy in computer networks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Say you visit a website, message your friend, or upload something to cloud storage. Your data doesn't travel in a straight line—it's bounced around between dozens of organizations and devices. Each piece of equipment just forwards your packets along, but none of them are supposed to read what's inside.&lt;/p&gt;

&lt;p&gt;Let’s break down what happens as a single packet travels from your computer to a server, and see how tech keeps your info private.&lt;/p&gt;




&lt;h2&gt;
  
  
  Meet Alice
&lt;/h2&gt;

&lt;p&gt;Let’s use Alice as our example.&lt;/p&gt;

&lt;p&gt;Alice wants to log into her online bank. She types:&lt;/p&gt;

&lt;p&gt;Username: alice&lt;br&gt;&lt;br&gt;
Password: ••••••••••••&lt;/p&gt;

&lt;p&gt;She clicks &lt;strong&gt;Login&lt;/strong&gt;. Her browser takes those details and transforms them into digital network packets, sending them out across the Internet in milliseconds.&lt;/p&gt;

&lt;p&gt;Her packets drop by several stops before reaching the bank:&lt;/p&gt;

&lt;p&gt;Alice's Laptop&lt;br&gt;&lt;br&gt;
 │ (Wi-Fi 802.11 frames)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Home Wi-Fi Router&lt;br&gt;&lt;br&gt;
 │ (NAT &amp;amp; PPPoE / Ethernet)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Internet Service Provider (ISP)&lt;br&gt;&lt;br&gt;
 │ (Metro Ethernet / Fiber)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Internet Backbone Routers&lt;br&gt;&lt;br&gt;
 │ (BGP Peering &amp;amp; Transit AS)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Cloud Firewall / Load Balancer&lt;br&gt;&lt;br&gt;
 │ (Edge WAF &amp;amp; TLS Termination)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Bank's Application Server&lt;br&gt;&lt;br&gt;
 │ (Encrypted RPC / mTLS)&lt;br&gt;&lt;br&gt;
 ▼&lt;br&gt;&lt;br&gt;
Database Vault&lt;/p&gt;

&lt;p&gt;Imagine if every device on that path could just read Alice’s password in plain text. Banking, business deals, online shopping—none of it would work. That’s why privacy is baked into the modern Internet.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Data Privacy?
&lt;/h2&gt;

&lt;p&gt;Data privacy is really about keeping your sensitive info safe from prying eyes. It’s not just about people not seeing your stuff—it also means they can’t collect it or misuse it. At the same time, legitimate parties (like your bank) still need access.&lt;/p&gt;

&lt;p&gt;In computer networks, most of the focus is on &lt;strong&gt;data in transit&lt;/strong&gt;—when info is moving between places, whether that’s along copper wires, fiber optics, or bouncing through the air.&lt;/p&gt;

&lt;p&gt;Here are some things people want to protect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Passwords, authentication tokens&lt;/li&gt;
&lt;li&gt;Bank deals and payment info&lt;/li&gt;
&lt;li&gt;Medical records and health data&lt;/li&gt;
&lt;li&gt;Corporate emails&lt;/li&gt;
&lt;li&gt;Chat messages, VoIP calls&lt;/li&gt;
&lt;li&gt;Personal photos, business docs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The big idea: Even if your packet travels through hardware you don’t trust, only whoever’s meant to get it can decrypt and understand it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The CIA Triad
&lt;/h2&gt;

&lt;p&gt;If you ever peek at how cybersecurity folks think, you’ll hear about the &lt;strong&gt;CIA Triad&lt;/strong&gt;. It’s three pillars every secure network stands on:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Confidentiality&lt;/strong&gt;: Keep private stuff hidden.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrity&lt;/strong&gt;: Make sure nothing’s been altered or faked as it moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability&lt;/strong&gt;: Users and systems should always have access when they need it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Confidentiality is the hero when it comes to privacy—it keeps your data from being seen by anyone else.&lt;/p&gt;




&lt;h2&gt;
  
  
  Every Hop Is a Risk
&lt;/h2&gt;

&lt;p&gt;Every time Alice's packet moves through another segment of the Internet, a new threat or weak spot could pop up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 1 — Public Wi-Fi
&lt;/h3&gt;

&lt;p&gt;Picture Alice logging in at a café on public Wi-Fi. That Wi-Fi is blasting her info everywhere, and anyone nearby with a laptop and the right tools can scoop up unprotected data.&lt;/p&gt;

&lt;p&gt;If Wi-Fi isn’t locked down, attackers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sniff packets—yes, literally watching everything she sends.&lt;/li&gt;
&lt;li&gt;Set up fake access points (“evil twins”) to grab her traffic.&lt;/li&gt;
&lt;li&gt;Hijack her sessions, stealing cookie info to impersonate her.&lt;/li&gt;
&lt;li&gt;Pull off ARP spoofing, rerouting her data through their own devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Stage 2 — The ISP
&lt;/h3&gt;

&lt;p&gt;When the data leaves Alice’s home (or café), it enters the world of her Internet provider. ISPs have tons of power here: they can log all sorts of metadata, watch DNS requests, and—if stuff isn’t encrypted—peek into what’s being sent.&lt;/p&gt;

&lt;p&gt;Proper encryption means ISPs just see destination addresses and ports, not the contents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 3 — The Backbone
&lt;/h3&gt;

&lt;p&gt;Next, the packet hops onto the big Internet backbone—traveling across networks run by major telecom companies.&lt;/p&gt;

&lt;p&gt;Backbone routers only need a little info (IP addresses, port numbers, and sequence stuff) to deliver packets. They don’t care about passwords or balances.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 4 — Cloud &amp;amp; Bank Defenses
&lt;/h3&gt;

&lt;p&gt;Just before hitting the bank’s internal servers, packets are screened by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firewalls,&lt;/li&gt;
&lt;li&gt;Web Application Firewalls,&lt;/li&gt;
&lt;li&gt;Load balancers,&lt;/li&gt;
&lt;li&gt;DDoS defense appliances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These systems filter out suspicious stuff and make sure only legit connections get through.&lt;/p&gt;




&lt;h2&gt;
  
  
  Main Threats to Network Privacy
&lt;/h2&gt;

&lt;p&gt;Cybersecurity pros deal with a moving target. Some common threats:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Passive Eavesdropping
&lt;/h3&gt;

&lt;p&gt;Attackers just listen in to everything flowing by. Usually undetectable unless encryption catches them.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Man-in-the-Middle (MITM)
&lt;/h3&gt;

&lt;p&gt;Someone sits between Alice and the bank, intercepting and possibly changing her communications. Without proper authentication, they could trick both sides, grab her details, and forward everything to the real server.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Packet Sniffing &amp;amp; Traffic Analysis
&lt;/h3&gt;

&lt;p&gt;Hackers capture raw packets and, even if they can’t read them, try to guess what’s happening based on packet size, timing, and destinations.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Phishing &amp;amp; Social Engineering
&lt;/h3&gt;

&lt;p&gt;No amount of encryption helps if Alice herself is tricked into giving up her password to a fake bank site.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Endpoint Malware &amp;amp; Keyloggers
&lt;/h3&gt;

&lt;p&gt;If Alice's computer is infected, her password is stolen right at the keyboard—before it even gets encrypted.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Networks Protect Your Privacy
&lt;/h2&gt;

&lt;p&gt;Modern security isn’t about one magic layer—it’s a stack of defenses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 1:&lt;/strong&gt; Strong Encryption (TLS 1.3, AES-GCM, End-to-End)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2:&lt;/strong&gt; Robust Authentication (MFA, Passkeys, certificates)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3:&lt;/strong&gt; Precise Authorization (Minimum privileges, RBAC)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 4:&lt;/strong&gt; Firewalls &amp;amp; perimeter filters&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 5:&lt;/strong&gt; Monitoring (IDS/IPS, SOC teams)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture:&lt;/strong&gt; Zero Trust—never trust, always verify&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Encryption: The First Line
&lt;/h2&gt;

&lt;p&gt;Encryption scrambles readable information into nonsense. Only someone with the right key can unscramble it.&lt;/p&gt;

&lt;p&gt;For Alice, her browser and the bank set up a secure tunnel using &lt;strong&gt;TLS 1.3&lt;/strong&gt;. Anyone snooping sees a meaningless jumble of characters.&lt;/p&gt;

&lt;p&gt;TLS 1.3 is faster, more secure, and makes sure previous leaks don’t let attackers decrypt old sessions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Authentication: Proving Identity
&lt;/h2&gt;

&lt;p&gt;Authentication asks: “Who are you?” and—crucially—"Can you prove it?"&lt;/p&gt;

&lt;p&gt;These days, banks use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Passkeys and hardware security modules&lt;/li&gt;
&lt;li&gt;Digital certificates from trusted authorities&lt;/li&gt;
&lt;li&gt;One-time codes and push prompts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No more relying just on passwords.&lt;/p&gt;




&lt;h2&gt;
  
  
  Authorization: Controlling Access
&lt;/h2&gt;

&lt;p&gt;Being authenticated doesn’t mean you can do everything. Authorization answers: “What are you allowed to do?”&lt;/p&gt;

&lt;p&gt;Networks use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RBAC:&lt;/strong&gt; Role-Based Access Control—different roles, different privileges&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ABAC:&lt;/strong&gt; Attribute-Based Access Control—checks extra context, like location, device, etc.&lt;/li&gt;
&lt;li&gt;Principle of least privilege—only grant what’s needed.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Firewalls &amp;amp; Perimeter Defense
&lt;/h2&gt;

&lt;p&gt;Firewalls are like strict bouncers at the door. They check, filter, and track every packet—blocking anything suspicious.&lt;/p&gt;

&lt;p&gt;Capabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Statefully inspecting packets, making sure inbound stuff matches outgoing requests&lt;/li&gt;
&lt;li&gt;Filtering by port/protocol&lt;/li&gt;
&lt;li&gt;Deep analysis—spotting malware and protocol abuses&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  IDS &amp;amp; IPS: Watching and Acting
&lt;/h2&gt;

&lt;p&gt;Security teams rely on automated systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IDS:&lt;/strong&gt; Watch for anything weird or malicious in traffic, alert people&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IPS:&lt;/strong&gt; Take action—drop/kill bad connections right away&lt;/li&gt;
&lt;li&gt;Security analytics: finding patterns, flagging coordinated attacks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Zero Trust: Rethinking Trust
&lt;/h2&gt;

&lt;p&gt;Old-school network security treated everything inside the company as safe and everything outside as risky. That doesn’t work anymore—cloud, remote work, and insider threats break the walls.&lt;/p&gt;

&lt;p&gt;Now, Zero Trust is the rule: every access request is checked, verified, and encrypted, no matter where it comes from. Trust isn’t static—networks keep checking, every time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal networks aren’t inherently trusted.&lt;/li&gt;
&lt;li&gt;Verification happens every time someone connects.&lt;/li&gt;
&lt;li&gt;Trust is dynamic—risk is always reassessed.&lt;/li&gt;
&lt;li&gt;Micro-segmentation keeps systems contained—even if an attacker gets in, they can't move laterally.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Where It Matters—Real World Examples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Application&lt;/th&gt;
&lt;th&gt;Privacy Tech Used&lt;/th&gt;
&lt;th&gt;What It Stops&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Online Banking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;TLS 1.3, hardware security, FIDO2 MFA&lt;/td&gt;
&lt;td&gt;Stopping sniffing, MITM, fraud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Instant Messaging&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;End-to-end encryption, Signal Protocol&lt;/td&gt;
&lt;td&gt;Blocking server/ISP snooping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cloud Storage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;TLS in transit, AES-256 at rest, OAuth2&lt;/td&gt;
&lt;td&gt;Foiling interception, unauthorized scraping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Enterprise Remote Access&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Zero Trust, VPNs&lt;/td&gt;
&lt;td&gt;Easing lateral movement, stopping Wi-Fi snooping&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  New Challenges
&lt;/h2&gt;

&lt;p&gt;Things aren’t slowing down, either. Privacy engineers are juggling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-driven attacks: Automated scans, smart phishing messages&lt;/li&gt;
&lt;li&gt;Post-Quantum Cryptography: Preparing for quantum computers; new algorithms like ML-KEM&lt;/li&gt;
&lt;li&gt;IoT explosion: Billions of insecure devices—weak passwords, old firmware, easy targets&lt;/li&gt;
&lt;li&gt;Supply chain hacks: Attacks through third-party code or devices&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;When Alice submits her login, her data doesn't travel in some private magical tunnel. It bounces across public wires and random devices before landing at the bank. But her info stays safe because of layer upon layer of dedicated engineering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TLS 1.3 encrypts everything at the source.&lt;/li&gt;
&lt;li&gt;PKI ensures the bank really is the bank.&lt;/li&gt;
&lt;li&gt;Routers only move packets based on headers—they never see what’s inside.&lt;/li&gt;
&lt;li&gt;Firewalls shield sensitive systems.&lt;/li&gt;
&lt;li&gt;Zero Trust means constant verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security isn’t just a patch you slap on—it’s the architecture underneath everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Want to Learn More?
&lt;/h2&gt;

&lt;p&gt;Check out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;NIST Zero Trust Architecture (SP 800-207): &lt;a href="https://doi.org/10.6028/NIST.SP.800-207" rel="noopener noreferrer"&gt;https://doi.org/10.6028/NIST.SP.800-207&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;NIST Cybersecurity Framework (CSF 2.0): &lt;a href="https://www.nist.gov/cyberframework" rel="noopener noreferrer"&gt;https://www.nist.gov/cyberframework&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The Transport Layer Security (TLS) Protocol Version 1.3 (RFC 8446): &lt;a href="https://www.rfc-editor.org/rfc/rfc8446" rel="noopener noreferrer"&gt;https://www.rfc-editor.org/rfc/rfc8446&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Authored by
&lt;/h2&gt;

&lt;p&gt;Team xX_FallenAngelsWithR3KTShotgun2077_Xx (Third-year students of B.Tech Computer Engineering Vidyalankar Institute of Technology, Mumbai&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ashish Chaudhari&lt;br&gt;
Dibyaranjan Prusty&lt;br&gt;
Khan Rayed&lt;br&gt;
Shams Tabrez Ahmed&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Under The Guidance of
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Dr Amit K. Nerurkar, Ms. Shivani Herlekar (Vidyalankar Institute of Technology)&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>networking</category>
      <category>cybersecurity</category>
      <category>tls</category>
      <category>zerotrust</category>
    </item>
    <item>
      <title>Publishing My First Rust npm Package (@seucra/matrix-sdk-bridge)</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 14 Aug 2026 14:20:36 +0000</pubDate>
      <link>https://dev.to/seucra/publishing-my-first-rust-npm-package-seucramatrix-sdk-bridge-21mb</link>
      <guid>https://dev.to/seucra/publishing-my-first-rust-npm-package-seucramatrix-sdk-bridge-21mb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Publishing a package to npm is a common milestone for JavaScript developers. However, publishing an npm package &lt;strong&gt;written in Rust and compiled to WebAssembly&lt;/strong&gt; introduces a completely different set of tooling, cross-compilation target considerations, and TypeScript definition generation.&lt;/p&gt;

&lt;p&gt;Recently, I published &lt;a href="https://www.npmjs.com/package/@seucra/matrix-sdk-bridge" rel="noopener noreferrer"&gt;&lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;&lt;/a&gt;—the extracted WebAssembly wrapper around &lt;code&gt;matrix-sdk&lt;/code&gt; used by Vigilant. &lt;/p&gt;

&lt;p&gt;This post documents the exact workflow, build scripts, pitfalls, and lessons learned during the publishing process.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tooling Stack
&lt;/h2&gt;

&lt;p&gt;To build and package Rust code for WebAssembly, I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wasm-pack&lt;/code&gt;&lt;/strong&gt;: The official CLI tool for building and packaging Rust-generated WebAssembly for npm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wasm-bindgen&lt;/code&gt;&lt;/strong&gt;: The core library facilitating high-level interactions between Rust and JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt;: Auto-generated &lt;code&gt;.d.ts&lt;/code&gt; definition files ensuring strong typing for JS consumers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────┐     wasm-pack build     ┌────────────────────────┐
│  Rust Source │ ───────────────────────►│  WebAssembly Binary    │
│  (src/lib.rs)│   --target web          │  (.wasm + .js + .d.ts) │
└──────────────┘                         └───────────┬────────────┘
                                                     │
                                                     │ npm publish
                                                     ▼
                                         ┌────────────────────────┐
                                         │ npm Registry Package   │
                                         │ @seucra/matrix-sdk-b.. │
                                         └────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step-by-Step Publishing Workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Configuring &lt;code&gt;Cargo.toml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The Rust crate must be configured as a dynamic system library (&lt;code&gt;cdylib&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[package]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"matrix-sdk-bridge"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="py"&gt;edition&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"2021"&lt;/span&gt;

&lt;span class="nn"&gt;[lib]&lt;/span&gt;
&lt;span class="py"&gt;crate-type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"cdylib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"rlib"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;wasm-bindgen&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.2"&lt;/span&gt;
&lt;span class="py"&gt;wasm-bindgen-futures&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.4"&lt;/span&gt;
&lt;span class="py"&gt;matrix-sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;default-features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"e2e-encryption"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="py"&gt;serde&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"derive"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="py"&gt;serde-wasm-bindgen&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.6"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Building for Web Targets
&lt;/h3&gt;

&lt;p&gt;Building the compiled WASM artifacts for browser environments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wasm-pack build &lt;span class="nt"&gt;--target&lt;/span&gt; web &lt;span class="nt"&gt;--scope&lt;/span&gt; seucra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates a &lt;code&gt;pkg/&lt;/code&gt; folder containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge_bg.wasm&lt;/code&gt;: The compiled WebAssembly bytecode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge.js&lt;/code&gt;: The JS glue code initializing and exposing WASM functions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge.d.ts&lt;/code&gt;: TypeScript typings for all &lt;code&gt;#[wasm_bindgen]&lt;/code&gt; functions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;package.json&lt;/code&gt;: Configured package manifest under scope &lt;code&gt;@seucra&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Publishing to npm
&lt;/h3&gt;

&lt;p&gt;After logging in with &lt;code&gt;npm login&lt;/code&gt;, publishing the scoped package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;pkg
npm publish &lt;span class="nt"&gt;--access&lt;/span&gt; public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Lessons &amp;amp; Gotchas
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Target Selection (&lt;code&gt;--target web&lt;/code&gt; vs &lt;code&gt;--target bundler&lt;/code&gt;)&lt;/strong&gt;:
&lt;code&gt;--target web&lt;/code&gt; generates ES module outputs using native &lt;code&gt;fetch()&lt;/code&gt; to load &lt;code&gt;.wasm&lt;/code&gt; files. This avoids complex Webpack/Vite loader configurations for consumers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Generation is Automatic&lt;/strong&gt;:
&lt;code&gt;wasm-bindgen&lt;/code&gt; automatically generates TypeScript &lt;code&gt;.d.ts&lt;/code&gt; files for annotated Rust structs and functions. Ensuring Rust doc comments are clean means your published npm package gets instant IntelliSense documentation!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate Builds with Scripts&lt;/strong&gt;:
Always script your build and test flow to prevent publishing stale WASM binaries.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Publishing &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt; was a major milestone in my Rust learning journey. It proved that Rust and WebAssembly can bridge the gap between low-level systems programming and modern browser applications seamlessly.&lt;/p&gt;

</description>
      <category>seucra</category>
      <category>npm</category>
      <category>rust</category>
    </item>
    <item>
      <title>Extracting Matrix SDK into a Rust WASM Library</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 14 Aug 2026 14:19:55 +0000</pubDate>
      <link>https://dev.to/seucra/extracting-matrix-sdk-into-a-rust-wasm-library-2mko</link>
      <guid>https://dev.to/seucra/extracting-matrix-sdk-into-a-rust-wasm-library-2mko</guid>
      <description>&lt;h2&gt;
  
  
  The Monolith Problem in Early Prototypes
&lt;/h2&gt;

&lt;p&gt;When building an ambitious application, it is tempting to put all code into a single repository. In early iterations of &lt;strong&gt;Vigilant&lt;/strong&gt;, the Rust Matrix SDK integration was tightly coupled with application-specific state handlers and UI glue code. &lt;/p&gt;

&lt;p&gt;As the project grew, this coupling created several friction points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing the Matrix SDK integration independently from application UI state was difficult.&lt;/li&gt;
&lt;li&gt;Changes to the frontend interface required touching deep backend Matrix sync loops.&lt;/li&gt;
&lt;li&gt;Reusing the Matrix integration in another web client or tool was impossible without copy-pasting code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I realized that Matrix client integration is fundamentally an independent concern. That realization led to extracting the Rust integration code into a standalone, reusable library: &lt;strong&gt;&lt;code&gt;matrix-sdk-bridge&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why WebAssembly for Matrix Client Logic?
&lt;/h2&gt;

&lt;p&gt;The Matrix client ecosystem has robust native implementations, with &lt;a href="https://github.com/matrix-org/matrix-rust-sdk" rel="noopener noreferrer"&gt;&lt;code&gt;matrix-sdk&lt;/code&gt;&lt;/a&gt; in Rust being one of the most active and feature-complete SDKs available.&lt;/p&gt;

&lt;p&gt;By compiling Rust to WebAssembly target &lt;code&gt;wasm32-unknown-unknown&lt;/code&gt; via &lt;code&gt;wasm-bindgen&lt;/code&gt;, we get several advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Memory Safety &amp;amp; Correctness&lt;/strong&gt;: Rust's type system ensures data race safety, strict lifetime checks, and zero-cost abstractions inside the browser environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upstream Alignment&lt;/strong&gt;: We leverage official, audited Matrix Rust SDK crates directly rather than reimplementing protocol handling in JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Architectural Boundary&lt;/strong&gt;: WebAssembly exposes a clear ABI (Application Binary Interface). JavaScript handles UI rendering while WebAssembly handles protocol state, cryptographic sessions, and timeline synchronization.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Designing the WASM Bridge Interface
&lt;/h2&gt;

&lt;p&gt;Bridging Rust async types (&lt;code&gt;Future&lt;/code&gt;, &lt;code&gt;Stream&lt;/code&gt;, &lt;code&gt;tokio&lt;/code&gt;/&lt;code&gt;wasm-bindgen-futures&lt;/code&gt;) to JavaScript promises requires careful API design.&lt;/p&gt;

&lt;p&gt;Here is a simplified architectural view of how data flows across the WASM boundary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────────────────────────────────┐
│     JavaScript Application / UI       │
└───────────────────┬───────────────────┘
                    │  call async WASM methods (e.g. client.login())
                    ▼
┌───────────────────────────────────────┐
│     wasm-bindgen Export Layer         │
│  - JsValue serialization              │
│  - Future -&amp;gt; Promise conversion       │
└───────────────────┬───────────────────┘
                    │  Rust async calls
                    ▼
┌───────────────────────────────────────┐
│       matrix-sdk (Rust Crates)        │
│  - Room handling                      │
│  - Sync loops                         │
│  - Session state                      │
└───────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Design Principles:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hide Upstream Complexity&lt;/strong&gt;: Upstream &lt;code&gt;matrix-sdk&lt;/code&gt; exposes dozens of types (&lt;code&gt;Client&lt;/code&gt;, &lt;code&gt;Room&lt;/code&gt;, &lt;code&gt;Timeline&lt;/code&gt;, &lt;code&gt;SyncResponse&lt;/code&gt;). The bridge packages these into high-level, serializable JS structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explicit Event Passing&lt;/strong&gt;: Matrix live sync updates are passed across the WASM boundary using JS callbacks or event dispatchers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graceful Error Handling&lt;/strong&gt;: Rust &lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; types are converted to structured JavaScript errors rather than panicking inside the WebAssembly module.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decoupling Accelerates Iteration&lt;/strong&gt;: Once &lt;code&gt;matrix-sdk-bridge&lt;/code&gt; was extracted, developing the frontend became significantly cleaner. The frontend team can mock or consume WASM methods without needing to touch Rust code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WASM Memory Management Matters&lt;/strong&gt;: Passing large byte arrays or string structures continuously across the JS/WASM boundary can introduce garbage collection overhead. Using lightweight JSON or typed array structures minimizes serialization overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat Internal Tooling as Open Source&lt;/strong&gt;: Even if a library starts as part of an internal project, structuring it like an open-source package forces cleaner abstractions, better documentation, and higher code quality.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next post, I will share the process of packaging this Rust WebAssembly bridge and publishing it to npm as &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Building Vigilant — Cycle 1 Complete</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 07 Aug 2026 15:09:06 +0000</pubDate>
      <link>https://dev.to/seucra/building-vigilant-cycle-1-complete-o7m</link>
      <guid>https://dev.to/seucra/building-vigilant-cycle-1-complete-o7m</guid>
      <description>&lt;p&gt;_&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Reflections on finishing Cycle 1 of Vigilant's backend, adopting Matrix Synapse, and choosing architectural focus over protocol reinvention.&lt;/em&gt;&lt;br&gt;
_&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Building a modern secure communication application is one of the most effective ways to understand backend systems. However, it is also a project where it is easy to get lost in the wrong problem.&lt;/p&gt;

&lt;p&gt;When I first conceived &lt;strong&gt;CipherLink&lt;/strong&gt;—the project that eventually evolved into &lt;strong&gt;Vigilant&lt;/strong&gt;—my goal was simple: write a complete messaging application from scratch, including the protocol, authentication, server storage, and encryption. &lt;/p&gt;

&lt;p&gt;It did not take long to realize that building a custom protocol from scratch is a massive undertaking. Designing key management, device synchronization, offline message delivery, and federation requires years of protocol engineering and security auditing. Attempting to build all of that alone meant spending 90% of my time reinventing established cryptography and messaging infrastructure, leaving almost no time for application architecture, backend robustness, or client integration.&lt;/p&gt;

&lt;p&gt;Near the end of B.Tech Semester 4, I made a major architectural pivot: &lt;strong&gt;adopt the open Matrix protocol, build on top of Matrix Synapse, and implement the application logic in Rust compiled to WebAssembly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Cycle 1 of Vigilant’s backend now complete&lt;/strong&gt;, this post reflects on what was accomplished, why this architecture was chosen, and what I learned along the way.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is Vigilant?
&lt;/h2&gt;

&lt;p&gt;Vigilant is a secure communication platform built on top of the Matrix ecosystem. &lt;/p&gt;

&lt;p&gt;Rather than treating Matrix as just a third-party API, Vigilant uses a self-hosted Matrix stack (Synapse, PostgreSQL, MinIO, Nginx) as its underlying persistence and synchronization engine, while relying on a custom Rust backend and WebAssembly bridge for client state, authentication, room management, and timeline handling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│                   Vigilant Frontend                    │
└───────────────────────────┬────────────────────────────┘
                            │ (TypeScript / JS)
                            ▼
┌────────────────────────────────────────────────────────┐
│            @seucra/matrix-sdk-bridge (WASM)            │
└───────────────────────────┬────────────────────────────┘
                            │ (Rust matrix-sdk)
                            ▼
┌────────────────────────────────────────────────────────┐
│                 Matrix Synapse Engine                  │
│       ┌──────────────┐          ┌──────────────┐       │
│       │  PostgreSQL  │          │    MinIO     │       │
│       └──────────────┘          └──────────────┘       │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Cycle 1 Accomplishments
&lt;/h2&gt;

&lt;p&gt;During Cycle 1, the primary objective was establishing a rock-solid backend foundation that could reliably interact with Matrix Synapse. &lt;/p&gt;

&lt;p&gt;Key backend milestones completed in Cycle 1:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication &amp;amp; Session Persistence&lt;/strong&gt;: Implementing login, registration, homeserver discovery, and secure token storage across page reloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Room Management &amp;amp; Discovery&lt;/strong&gt;: Joining public rooms, creating direct message channels, and mapping Matrix room states to application views.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeline Loading &amp;amp; Message History&lt;/strong&gt;: Fetching room timelines, listening to live sync events, and handling message pagination tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WASM Bridge Extraction&lt;/strong&gt;: Separating the Rust integration logic into a standalone library published as &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt; on npm.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Key Lessons &amp;amp; Architectural Trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Build on Proven Standards
&lt;/h3&gt;

&lt;p&gt;Choosing Matrix over a custom protocol was the single best decision in this project. It shifted my effort from &lt;em&gt;reinventing the wheel&lt;/em&gt; to &lt;em&gt;learning how real distributed communication engines work&lt;/em&gt;. Matrix Synapse handles event graph ordering, federation, and persistence, allowing me to focus on Rust async state management and client integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Rust for Client Integration
&lt;/h3&gt;

&lt;p&gt;Writing the core logic in Rust using &lt;code&gt;matrix-sdk&lt;/code&gt; provided strong memory safety guarantees and compile-time correctness. Upstream Matrix SDK updates can be integrated directly, and compiling to WebAssembly (&lt;code&gt;wasm32-unknown-unknown&lt;/code&gt;) ensures high performance in the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Read Upstream Source Code
&lt;/h3&gt;

&lt;p&gt;Documentation for emerging SDKs is often sparse. I frequently had to dive directly into the Rust &lt;code&gt;matrix-sdk&lt;/code&gt; source code to understand event handlers, sync loops, and sliding sync behaviors. Reading primary source code is a muscle every backend engineer must develop.&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next for Cycle 2
&lt;/h2&gt;

&lt;p&gt;Now that Cycle 1 backend milestones are solid, the focus shifts toward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refining frontend integration with my project collaborator.&lt;/li&gt;
&lt;li&gt;Hardening timeline pagination and offline event caching.&lt;/li&gt;
&lt;li&gt;Expanding documentation and integration tests for &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Building Vigilant has proven that engineering depth comes from understanding system boundaries, making deliberate trade-offs, and shipping defensible work.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Links :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/seucra/vigilant/" rel="noopener noreferrer"&gt;project repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://seucra.tech/" rel="noopener noreferrer"&gt;main site / portfolio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://journal.seucra.tech/" rel="noopener noreferrer"&gt;personal journal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Concurrency in Python: Solving the Dining Philosophers Problem</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Sun, 19 Apr 2026 17:26:11 +0000</pubDate>
      <link>https://dev.to/seucra/concurrency-in-python-solving-the-dining-philosophers-problem-6ao</link>
      <guid>https://dev.to/seucra/concurrency-in-python-solving-the-dining-philosophers-problem-6ao</guid>
      <description>&lt;p&gt;If you are writing multithreaded applications, you are going to run into deadlocks. There’s no avoiding it. To understand how to fix them, you need to understand the Dining Philosophers problem.&lt;/p&gt;

&lt;p&gt;Five philosophers sit at a round table. There are five forks. To eat, a philosopher needs the fork on their left and the fork on their right. If everyone grabs their left fork at the exact same time, they all wait forever for the right fork. Deadlock.&lt;/p&gt;

&lt;p&gt;In this series, my team and I will break down how we built a visual simulator for this problem in Python. For part one, we are looking at the core mechanics and Dijkstra’s Resource Hierarchy solution.&lt;br&gt;
The Setup&lt;/p&gt;

&lt;p&gt;We want raw execution without third-party bloat, so we rely entirely on Python's standard threading library. Each philosopher is a daemon thread, and each fork is a threading.Lock.&lt;br&gt;
Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;

&lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;forks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we just wrote forks[left].acquire() followed by forks[right].acquire(), the script would eventually freeze.&lt;br&gt;
The Solution: Resource Hierarchy&lt;/p&gt;

&lt;p&gt;To break the circular wait, we assign a hierarchy to the resources (forks). Instead of "grab left, then right," the rule becomes "grab the lower-numbered fork first, then the higher-numbered one."&lt;/p&gt;

&lt;p&gt;Here is how that logic looks in our simulation loop:&lt;br&gt;
Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_cycle_resource_hierarchy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Determine fork indices
&lt;/span&gt;    &lt;span class="n"&gt;left&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt;
    &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;

    &lt;span class="c1"&gt;# Establish hierarchy
&lt;/span&gt;    &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Acquire in strict order
&lt;/span&gt;    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;acquire&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;acquire&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# CRITICAL SECTION: Eating
&lt;/span&gt;    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uniform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="c1"&gt;# Release locks
&lt;/span&gt;    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the last philosopher (index 4) sits next to the first fork (index 0), they will try to grab fork 0 first, while philosopher 0 is also trying to grab fork 0 first. The cycle is broken. Someone gets blocked, allowing someone else to eat.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>My First Week Learning Offensive Security (Before Hitting the Paywall)</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Sun, 05 Apr 2026 12:06:17 +0000</pubDate>
      <link>https://dev.to/seucra/my-first-week-learning-offensive-security-before-hitting-the-paywall-3g55</link>
      <guid>https://dev.to/seucra/my-first-week-learning-offensive-security-before-hitting-the-paywall-3g55</guid>
      <description>&lt;p&gt;I started learning red team fundamentals on TryHackMe. Here's what I learned before running into premium content limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 1: Red Team Basics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What offensive security actually means&lt;/li&gt;
&lt;li&gt;Learned about dirb tool for directory brute-forcing&lt;/li&gt;
&lt;li&gt;[Explain what dirb does and why it's useful]&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 2: Blue Team Perspective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Defense in depth concept&lt;/li&gt;
&lt;li&gt;SOC analyst role&lt;/li&gt;
&lt;li&gt;What SIEM tools do&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 3: Research Skills
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to find CVEs and exploits&lt;/li&gt;
&lt;li&gt;Tools: Shodan, Censys, VirusTotal&lt;/li&gt;
&lt;li&gt;GitHub for exploit code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 4: Linux Fundamentals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Commands I learned: ls, cd, cat, grep&lt;/li&gt;
&lt;li&gt;Operators: &amp;amp;&amp;amp;, &amp;gt;, |&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Paywall Problem
&lt;/h2&gt;

&lt;p&gt;TryHackMe's free tier is limited. Switching to OverTheWire (completely free) to continue learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Week
&lt;/h2&gt;

&lt;p&gt;Starting OverTheWire Bandit challenges. Goal: Complete levels 0-10.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
