<?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 Hesanda Nimneth Liyanage on Medium]]></title>
        <description><![CDATA[Stories by Hesanda Nimneth Liyanage on Medium]]></description>
        <link>https://medium.com/@nhesanda?source=rss-04e5db1152b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2Wxg9Ve_GR2XbrsEmEeNXw.png</url>
            <title>Stories by Hesanda Nimneth Liyanage on Medium</title>
            <link>https://medium.com/@nhesanda?source=rss-04e5db1152b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:39:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nhesanda/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[Non-Human Identity Governance: The Rising IAM Discipline]]></title>
            <link>https://medium.com/ucsc-isaca-student-group/non-human-identity-governance-the-rising-iam-discipline-9079083c6956?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9079083c6956</guid>
            <category><![CDATA[identity-acess-management]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-governance]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Sat, 12 Sep 2026 04:27:16 GMT</pubDate>
            <atom:updated>2026-09-12T04:39:56.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*oLOXR6BHVMUgmSappluF8A.jpeg" /><figcaption><a href="https://indicio.tech/blog/proven-for-ai-verifiable-credentials-enable-ai-agents-to-perform-efficiently-effectively/">Source</a></figcaption></figure><p>We live in a world that is constantly becoming more connected. Applications communicate with other applications, services communicate with databases, APIs communicate with external platforms, and increasingly, AI agents are being given the ability to perform actions on behalf of users.</p><p>In the past, when we talked about Identity and Access Management (IAM), the first thing that usually came to mind was a human employee. A user gets an account, receives some permissions, changes their password, and eventually their access is removed when they leave the organization.</p><p>But modern systems are no longer operated only by humans.</p><p>Applications have service accounts. Systems have API keys. CI/CD pipelines have credentials. Cloud workloads have machine identities. And AI agents can now authenticate to systems and perform actions on their own.</p><p>These identities are often referred to as <strong>non-human identities (NHIs)</strong>.</p><p>The problem is that while organizations have spent years building processes to govern human identities, many non-human identities still live in a governance blind spot.</p><p>In this article, let’s understand why this is becoming a major IAM problem and what a proper lifecycle for non-human identities can look like.</p><h3>What is a Non-Human Identity?</h3><p>A non-human identity is an identity that is used by something other than a person to authenticate and access resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jae6pVHXsCM_hKslv5NqOw.png" /></figure><p>Some common examples include:</p><ul><li>Service accounts</li><li>API keys</li><li>Access tokens</li><li>Cloud workload identities</li><li>Application identities</li><li>CI/CD credentials</li><li>Machine-to-machine accounts</li><li>AI agents</li></ul><p>For example, imagine an application that needs to access an AWS S3 bucket. Instead of a developer manually logging into AWS every time, the application is given an identity with permission to access that bucket. The application then uses that identity whenever it needs to communicate with AWS. From the application’s perspective, this identity is effectively its “user account.” The important difference is that nobody is sitting behind the keyboard using it.</p><p>This changes the way identity governance needs to work.</p><h3>Why Human IAM Is Not Enough</h3><p>Traditional IAM processes were largely designed around human employees.</p><p>A simplified lifecycle might look something like this:</p><p><strong>Employee joins → Account created → Permissions assigned → Access reviewed → Employee leaves → Account disabled</strong></p><p>This works reasonably well because humans have recognizable lifecycle events.</p><blockquote>Someone joins a company.</blockquote><blockquote>Someone changes their job.</blockquote><blockquote>Someone leaves the company.</blockquote><blockquote>But what happens to a service account?</blockquote><blockquote>Suppose a developer creates an API key for a service in 2024.</blockquote><blockquote>The service is later replaced in 2025.</blockquote><blockquote>The developer leaves the company in 2026.</blockquote><blockquote>But nobody remembers that the API key still exists.</blockquote><blockquote>The key may still have access to production resources.</blockquote><p>This is where the problem begins.</p><p>The identity is still active, but the original reason for its existence may no longer exist.</p><h3>The Governance Blind Spot</h3><p>One of the biggest problems with non-human identities is not necessarily that they exist.</p><p>The problem is that organizations may not know <strong>what exists, who owns it, why it exists, or whether it should still have access</strong>.</p><p>Imagine an organization with:</p><ul><li>5,000 employees</li><li>20,000 service accounts</li><li>50,000 API keys</li><li>Thousands of cloud workloads</li><li>Hundreds of automated pipelines</li><li>Increasing numbers of AI agents</li></ul><p>The number of machine identities can quickly become much larger than the number of human identities. Yet the governance process may still be primarily focused on employees. A developer might create an API key for testing. A DevOps engineer might create a service account for a deployment pipeline. A cloud workload might automatically receive an identity. An AI agent might receive permissions to access multiple APIs. All of these identities can become part of the organization’s security boundary.</p><p>If they are not properly governed, they become forgotten access paths.</p><h3>The Identity Lifecycle</h3><p>A useful way to approach this problem is to treat non-human identities as having their own lifecycle.</p><p>Instead of simply creating an identity and leaving it there, we can think about four major stages:</p><p><strong>Discovery → Ownership → Review → Revocation</strong></p><p>This gives organizations a systematic way to manage machine identities.</p><h4>1. Discovery</h4><p>The first question is simple:</p><p><strong>What non-human identities do we actually have?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*XQaUPPXPxO2jNRL-O8gUew.png" /></figure><p>Before we can govern something, we need to know that it exists.</p><p>An organization might have identities spread across different systems such as:</p><ul><li>AWS</li><li>Azure</li><li>Google Cloud</li><li>Kubernetes</li><li>GitHub</li><li>Databases</li><li>Internal applications</li><li>API gateways</li><li>CI/CD systems</li></ul><p>This makes discovery difficult.</p><p>For example, an organization might know about 10,000 service accounts in its central IAM platform but have another 2,000 API keys being used by applications that were never properly registered.</p><p>Therefore, discovery should not only ask:</p><blockquote>“Which identities were officially created?”</blockquote><p>It should also ask:</p><blockquote>“Which identities are actually being used?”</blockquote><p>This distinction is important because an identity can exist without being visible to the team responsible for governance.</p><h4>2. Ownership</h4><p>After discovering an identity, the next question is:</p><p><strong>Who is responsible for it?</strong></p><p>Consider an API key called:</p><p>production-payment-service-key</p><p>That name tells us what it might be used for.But it doesn’t necessarily tell us who owns it. Is it owned by the payment team? The DevOps team? The developer who originally created it? Or has that person already left the organization?</p><p>Every important non-human identity should have an identifiable owner or responsible team.</p><p>Ownership creates accountability. If something goes wrong, there should be someone who can answer:</p><blockquote>Why does this identity exist?</blockquote><blockquote>What system uses it?</blockquote><blockquote>What permissions does it have?</blockquote><blockquote>Who approved those permissions?</blockquote><p>Without ownership, identities can become “orphaned.”</p><p>An orphaned identity is especially dangerous because it may continue to have access even though nobody is actively responsible for it.</p><h4>3. Access Review</h4><p>Having an owner is not enough.</p><p>The next question is: <strong>Does this identity still need the access it currently has?</strong></p><p>This is where periodic access reviews become important.</p><p>Imagine a service account originally created for a reporting application. At the beginning, it only needed access to a reporting database. Six months later, the application was expanded and the service account received additional permissions.</p><p>Eventually, it might have access to:</p><ul><li>The reporting database</li><li>Customer data</li><li>Cloud storage</li><li>Internal APIs</li></ul><p>But perhaps the original application only needs the reporting database.</p><p>This is an example of <strong>permission creep</strong>. The identity continues to accumulate privileges while nobody actively removes permissions that are no longer required.</p><p>Therefore, reviews should ask questions such as:</p><blockquote>Is the identity still being used?</blockquote><blockquote>Is the owner still valid?</blockquote><blockquote>Are the permissions still required?</blockquote><blockquote>Are the permissions greater than what the workload actually needs?</blockquote><p>This is where the principle of <strong>least privilege</strong> becomes important.</p><p>A machine identity should have only the permissions necessary for the task it performs.</p><h4>4. Revocation</h4><p>Eventually, every identity should have a path toward being disabled or revoked.</p><p>This might happen because:</p><ul><li>The application was decommissioned</li><li>The service was replaced</li><li>The API key was compromised</li><li>The owner is no longer responsible</li><li>The identity has been inactive for a long period</li><li>The permissions are no longer required</li></ul><p>For example, imagine an old service account that has not been used for 180 days.</p><p>Instead of allowing it to exist indefinitely, an organization could have a process that detects inactivity, notifies the owner, and eventually disables the identity if nobody can justify keeping it active.</p><p>This transforms revocation from a manual cleanup task into part of the identity lifecycle.</p><h3>What Changes With AI Agents?</h3><p>The rise of AI agents makes this problem even more interesting. A traditional service might perform one predefined task.</p><p>For example:</p><blockquote>Application → Database</blockquote><p>The application has a specific identity and performs a relatively predictable operation. An AI agent can be much more dynamic.</p><p>For example:</p><blockquote>User → AI Agent → GitHub → Cloud → Database → External API</blockquote><p>The agent may be able to decide which tools to use depending on the task it receives. This means the identity of an AI agent cannot simply be treated as another API key.</p><p>We also need to understand:</p><blockquote>Who owns the agent?</blockquote><blockquote>What is the agent allowed to do?</blockquote><blockquote>Which tools can it access?</blockquote><blockquote>What resources can those tools access?</blockquote><blockquote>How long should its permissions remain active?</blockquote><blockquote>What happens when the agent is no longer needed?</blockquote><p>The identity of an AI agent therefore becomes part of the security architecture, not just an implementation detail.</p><p>This isn’t just a theoretical gap anymore ,the identity vendors are actively racing to fill it.</p><p><strong>WSO2</strong> has just released <strong>ThunderID</strong>, a new open source identity core written in Go, built specifically to treat AI agents, applications, and workloads as first-class identities rather than an afterthought bolted onto human IAM. It bakes in delegated authority and full traceability for agents from the ground up, and is being contributed to the OpenWallet Foundation so it isn’t locked to one vendor.</p><p><strong>Okta</strong> has taken a protocol first approach with <strong>Cross App Access (XAA)</strong>, an OAuth extension (and now an official MCP authorization extension) that routes agent to app and app-to-app connections through centralized identity policy instead of static API keys. The idea is that when an agent say, a coding assistant or a chat client wants to reach into Slack, Asana, or a database, that connection is scoped, logged, and revocable by IT, not just a long-lived key floating around in a config file.</p><p>What both approaches point to is the same underlying shift: an AI agent’s identity can’t just be “the API key it was given.” It needs its own lifecycle separate from the human who launched it and separate from the tools it calls including <em>delegation</em> (what authority did a human or system hand it, and for how long), <em>scoping</em> (can it act only within the task it was given, not everything its credentials technically allow), and <em>traceability</em> (can every action the agent takes be tied back to why it took it).</p><p>The tooling here is only months old. But the direction is clear: agent identity is becoming its own category inside IAM, not a subcategory of “service accounts.”</p><h3>From “Who Are You?” to “What Are You?”</h3><p>Traditional IAM often starts with a simple question:</p><blockquote>Who are you?</blockquote><p>For a human user, the answer might be an employee identity.</p><p>For modern infrastructure, we increasingly need another question:</p><blockquote>What are you?</blockquote><p>Is this:</p><ul><li>A human?</li><li>A service?</li><li>An application?</li><li>A workload?</li><li>A CI/CD pipeline?</li><li>An AI agent?</li></ul><p>And then:</p><blockquote>What are you allowed to do?</blockquote><p>This creates a broader identity model where humans and machines are treated as participants in the same security environment.</p><h3>A Simple Non-Human Identity Lifecycle</h3><p>We can visualize the complete lifecycle like this:</p><p><strong>Discover → Register → Assign Owner → Grant Access → Monitor → Review → Rotate/Update → Revoke</strong></p><p>For example:</p><blockquote>A company deploys a new payment service.</blockquote><blockquote>First, the organization’s identity systems discover the new workload.</blockquote><blockquote>The workload is registered and assigned to the payment team’s ownership.</blockquote><blockquote>It receives only the permissions required to process payments.</blockquote><blockquote>Its activity is continuously monitored.</blockquote><blockquote>After a certain period, the permissions are reviewed.</blockquote><blockquote>If the service changes, its permissions are updated.</blockquote><blockquote>When the service is eventually decommissioned, its identity and credentials are revoked.</blockquote><p>The important part is that the identity doesn’t simply disappear from someone’s memory.</p><p>Its lifecycle has a defined beginning, middle, and end.</p><h3>But Why ?</h3><p>The number of machines, applications, APIs, workloads and AI systems inside organizations will continue to grow.</p><p>This means that identity security cannot remain focused only on employees.</p><p>A compromised employee account can be dangerous.</p><p>But a compromised machine identity with persistent access to production systems can also become a serious security problem.</p><p>And unlike humans, machine identities do not necessarily change passwords, notice suspicious activity, or decide that they no longer need access.</p><p>They can continue operating exactly as they were configured.</p><p>That is why non-human identity governance is becoming an important part of modern IAM.</p><h3>Conclusion</h3><p>The identity landscape is changing.</p><p>For years, organizations mainly had to answer:</p><blockquote>“Which people have access to our systems?”</blockquote><p>Today, that question is no longer enough.</p><p>We also need to ask:</p><blockquote>“Which machines have access to our systems?”</blockquote><p>Service accounts, API keys, workloads, applications and AI agents are becoming an increasingly important part of the digital environment.</p><p>The solution is not to treat every machine identity exactly like a human identity. Instead, we need lifecycle processes designed specifically for them.</p><blockquote><strong>Discovery</strong> tells us what exists.</blockquote><blockquote><strong>Ownership</strong> tells us who is responsible.</blockquote><blockquote><strong>Review</strong> tells us whether access is still justified.</blockquote><blockquote><strong>Revocation</strong> ensures that unnecessary access does not remain forever.</blockquote><p>As organizations continue moving toward cloud-native architectures, automation and agentic AI, non-human identities will become an increasingly important part of IAM.</p><p>The future of identity governance is therefore not only about managing <strong>who</strong> can access something.</p><p>It is also about managing <strong>what</strong> can access something, <strong>why</strong> it can access it, and <strong>how long</strong> that access should exist.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9079083c6956" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ucsc-isaca-student-group/non-human-identity-governance-the-rising-iam-discipline-9079083c6956">Non-Human Identity Governance: The Rising IAM Discipline</a> was originally published in <a href="https://medium.com/ucsc-isaca-student-group">UCSC ISACA Student Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My understanding on Identity Server]]></title>
            <link>https://medium.com/@nhesanda/identity-server-d7ab4a255281?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7ab4a255281</guid>
            <category><![CDATA[wso2-identity-server]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 12:48:13 GMT</pubDate>
            <atom:updated>2026-08-19T12:48:42.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*58dmIeqeFTS2lVjXp8rZJw.png" /></figure><h3>What is IAM, quickly</h3><p>IAM (Identity and Access Management) is just the system that checks two things every time someone tries to use an app: who are you, and what are you allowed to do. Every login screen you’ve ever seen is IAM doing its job. Most companies don’t build this themselves anymore — they use a dedicated IAM product for it.</p><h3>Where you’d use something like this</h3><ul><li>A company with multiple internal apps wants employees to log in once and access all of them, instead of separate logins for each one.</li><li>A customer-facing app needs signup, login, password reset, and social login (Google/Facebook) without building all that from scratch.</li><li>Securing APIs and microservices so they can trust each other without each one handling auth on its own.</li><li>Any place that needs proper access control — who can view what, who can edit what — with an audit trail behind it.</li></ul><h3>So what is WSO2 Identity Server</h3><p>WSO2 Identity Server (WSO2 IS) is WSO2’s IAM product, and it’s been around for over 15 years, so it’s pretty battle-tested. It’s open source, and it’s used by banks, telcos, and governments, not just small startups.</p><p>At its core, it does the standard IAM stuff:</p><ul><li><strong>Authentication</strong> — verifying who someone is (password, OTP, social login, biometrics, whatever you configure)</li><li><strong>Authorization</strong> — deciding what they can access once they’re in</li><li><strong>Single sign-on (SSO)</strong> — log in once, get into every connected app without logging in again</li><li><strong>User management</strong> — creating, updating, disabling accounts, all from one place</li></ul><h3>How it’s built, simply</h3><p>It’s built on WSO2’s Carbon platform, which basically means everything is broken into separate, swappable components — one part handles SAML, one handles OAuth, one handles user stores, and so on. That makes it easy to extend or customize without touching the whole system.</p><p>It talks in standard protocols — OAuth2, OpenID Connect, SAML2, SCIM — so it plays nicely with basically any app or tool out there, no proprietary lock-in.</p><p>It also doesn’t force you to move your existing users into it. If you’ve already got users in Active Directory or LDAP, WSO2 IS just connects to that through built-in connectors and sits as a layer on top.</p><p>One feature worth mentioning is adaptive authentication — it can ask for extra verification only when something looks unusual (new device, different location), instead of always demanding MFA from everyone on every login.</p><h3>Wrapping up</h3><p>WSO2 Identity Server is basically the layer that handles login, access control, and single sign-on for your apps, so you don’t have to build and secure that yourself. It’s standards-based, connects to whatever user store you already have, and has been proven at real enterprise scale for a long time.</p><p>Docs are at is.docs.wso2.com if you want to dig deeper.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7ab4a255281" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ThunderID, Explained Simply]]></title>
            <link>https://medium.com/@nhesanda/thunderid-explained-simply-eccd92b24ebd?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/eccd92b24ebd</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[thunderid]]></category>
            <category><![CDATA[identity-and-access]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 10:33:09 GMT</pubDate>
            <atom:updated>2026-08-18T10:33:09.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*BWhF6OW9V-kI3ldtzjWz3A.png" /></figure><h3>First, what even is IAM?</h3><p>IAM stands for Identity and Access Management. Basically it’s the system that answers two questions every time someone (or something) tries to use an app:</p><ol><li><strong>Who are you?</strong> (login, password, passkey, OTP… this is authentication)</li><li><strong>What are you allowed to do?</strong> (can you view this page, edit this record, call this API… this is authorization)</li></ol><p>Every app you’ve ever logged into has some version of IAM behind it. When you sign in to Gmail, when you tap “Login with Google” on some random website, when your company laptop asks for your work credentials before opening a portal, that’s all IAM doing its job in the background.</p><p>Companies rarely build this from scratch anymore because it’s genuinely hard to get right (security, session handling, token expiry, MFA, social logins, single sign-on across ten different apps…). So instead they plug in an IAM product. That’s where things like Okta, Auth0, WSO2 Identity Server, and now, ThunderID come in.</p><h3>Where would you actually use something like this?</h3><ul><li>A startup building a SaaS product needs login, signup, “forgot password”, and social login — instead of writing all that themselves, they hook into an IAM tool.</li><li>A company with 5 internal apps wants employees to log in once and access all of them without re-entering credentials — that’s single sign-on, an IAM feature.</li><li>An app wants to let users log in with Google/GitHub instead of creating a new password — IAM handles that too.</li><li>Increasingly now — AI agents that call APIs on your behalf need their own identity too, so someone (or something) can track and control what that agent is allowed to do.</li></ul><p>That last point is actually the whole reason ThunderID exists.</p><h3>Okay, so what is ThunderID?</h3><p>ThunderID is WSO2’s newest identity product. It’s open source, written in Go, and instead of just handling logins for humans, it’s built to handle identity for <strong>humans, AI agents, and machines</strong> all under one system.</p><p>WSO2 has been in the identity space for over 15 years with WSO2 Identity Server, but ThunderID is basically a rebuild from scratch, because the identity landscape has changed a lot. AI agents now call APIs and act on behalf of users, decentralized identity (things like digital wallets and verifiable credentials) is becoming real, and there’s a looming threat from quantum computers that could break today’s encryption down the line. ThunderID is designed with all of that in mind rather than being patched on afterward.</p><p>WSO2 has even contributed the project to the Open Wallet Foundation, so it’s not just a WSO2-only thing anymore, it’s becoming a community-driven open standard.</p><h3>The basics of how it works</h3><p>Here’s the simple version, no jargon overload:</p><p><strong>It’s a lightweight runtime.</strong> ThunderID starts up in under 50 milliseconds. That matters a lot in cloud-native setups where things spin up and down constantly (containers, serverless, etc.) ,you don’t want your identity service to be the slow part.</p><p><strong>Everything is API-first.</strong> Every single feature ,creating a user, setting up an app, defining a login flow ,can be done purely through REST APIs. This means you can manage your entire identity setup as code, version it in Git, and deploy it the same way you deploy any other piece of infrastructure. This fits naturally into GitOps and CI/CD pipelines.</p><p><strong>Login journeys are “flows.”</strong> Instead of a fixed login screen, ThunderID lets you build your authentication journey like a flowchart, email then OTP, or passkey then a fallback option, etc. There’s a drag and drop visual builder for this, so you’re not stuck editing config files to add a new step.</p><p><strong>It speaks the standard languages.</strong> OpenID Connect, OAuth2, SAML, SCIM — all the usual IAM standards are supported, so it plays nicely with whatever else you already have.</p><p><strong>It has native support for AI agents.</strong> This is the standout part. ThunderID gives AI agents their own proper identity (not just a shared API key), and supports authorization for things like MCP and A2A (agent-to-agent) interactions. So if you have an agent calling tools or talking to other agents, you can actually track and control what it’s allowed to do, the same way you’d control what a human user can do.</p><p><strong>It’s built to be quantum-safe.</strong> It’s designed around post-quantum cryptography from the ground up, so it’s not vulnerable to “harvest now, decrypt later” attacks where someone steals encrypted data today hoping to crack it once quantum computers are powerful enough.</p><p><strong>Deploy it anywhere.</strong> Docker, Kubernetes, Helm charts, or just npx thunderid to try it locally. No lock-in to one specific cloud or infra setup.</p><p>So in short: IAM is the layer that handles “who are you and what can you do” for any application. ThunderID is WSO2’s modern, open-source take on that layer , fast, API-first, standards-compliant, and built for a world where not just humans, but AI agents and machines, need their own verifiable identity too.</p><p>If you want to go deeper, the official docs are at thunderid.dev — that’s the best place to actually try it out and see the flows in action.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eccd92b24ebd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your app got 10x the traffic overnight. Does it survive?]]></title>
            <link>https://medium.com/@nhesanda/your-app-got-10x-the-traffic-overnight-does-it-survive-84be4a8cb668?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/84be4a8cb668</guid>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 12:44:14 GMT</pubDate>
            <atom:updated>2026-04-30T03:08:45.678Z</atom:updated>
            <content:encoded><![CDATA[<p>Most apps don’t fail because of bad code. They fail because the server handling everything just… gave up.</p><p>Load balancing is the fix. But there’s more than one way to do it, and picking the wrong one will come back to bite you.</p><p>Here are the 3 approaches you’ll actually encounter in the wild:</p><ol><li><strong>IP Hashing</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4h3HhGjOC8z3adpakPquw.png" /></figure><p>Your user’s IP address gets hashed and mapped to a specific server. Same IP, same server, every time. Simple to set up, zero extra infrastructure needed.</p><p>The catch? Mobile users switch networks constantly. The moment their IP changes, they land on a different server with no session data. For stateless apps it’s fine. For anything that tracks user state, it’s annoying fast.</p><p><strong>2. Sticky Sessions via Cookie</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8s0vqIF3eyaJKS6h5GYpIA.png" /></figure><p>The load balancer drops a cookie in the user’s browser on their first visit, something like SERVERID=server2. Every request after that gets routed to that exact server.</p><p>Works well until that server goes down. Because when it does, all the users “stuck” to it lose their session. You’ve basically built a single point of failure with extra steps.</p><p><strong>3. Shared Session Store with Redis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wwhKoIzVZhwnEjOTWu06SA.png" /></figure><p>This is the one most production systems actually use. Instead of tying users to specific servers, you store all session data in Redis. Every server reads and writes to the same place, so it doesn’t matter which server handles a request.</p><p>This makes your servers truly stateless. You can add or remove them freely, and no user notices a thing.</p><p>But this has a catch too. The Redis instance itself becomes the single point of failure. If Redis goes down, <em>every</em> server loses access to <em>every</em> session simultaneously. One failure takes out the whole system, not just one server. You also now have network latency on every single request since servers need to reach out to Redis each time.</p><p>So which should you use?</p><p>If you’re building something new: Redis, no contest. The extra setup pays off the moment you need to scale horizontally or handle a server failure without waking up at 3am.</p><p>IP hashing and cookies have their place, but they’re solving the problem by avoiding it rather than actually fixing it.</p><p>Distributed systems are full of tradeoffs. Make sure to pick the solution based on <strong><em>your</em></strong> use case. Not what’s popular.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84be4a8cb668" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Race Conditions in Rate Limiters: Your 100 req/min Limit Probably Isn’t 100]]></title>
            <link>https://medium.com/@nhesanda/race-conditions-in-rate-limiters-your-100-req-min-limit-probably-isnt-100-0c17b23ad1ed?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c17b23ad1ed</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[rate-limiting]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 05:21:03 GMT</pubDate>
            <atom:updated>2026-03-03T05:21:03.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tr1ByGa7u8qqJIrA3VysA.png" /></figure><p>Most rate limiters I’ve seen in Spring Boot apps look something like this:</p><pre>public boolean checkRateLimit(String apiKey) {<br>    String key = &quot;rate_limit:&quot; + apiKey;<br>    Long count = redisTemplate.opsForValue().increment(key);<br>    if (count != null &amp;&amp; count == 1) {<br>        redisTemplate.expire(key, 60, TimeUnit.SECONDS);<br>    }<br>    return count != null &amp;&amp; count &lt;= 100;<br>}</pre><p>Looks reasonable. 100 requests per minute per API key. Ships to production. Nobody touches it again.</p><p>But there’s a race condition sitting right in the middle of it that only shows up under real load.</p><p>increment() and expire() are two separate Redis calls. There’s a tiny gap between them. Under normal traffic you’d never notice. But when 500 concurrent requests land at the same time, this is what actually happens:</p><blockquote>thread 1 calls increment → count is 1<br>thread 2 calls increment → count is 2<br>thread 3 calls increment → count is 3<br>... 490 more threads all increment ...<br>thread 1 finally calls expire</blockquote><p>By the time expire() runs, nearly 500 requests already went through. Your limit was 100. Nobody told Redis that.</p><p>And there’s actually a second scenario that’s worse. If the server crashes or restarts between increment() and expire(), the key never gets an expiry. That API key stays blocked forever until someone manually clears it from Redis.</p><p>The fix is running both operations as a single atomic Lua script. Redis executes Lua scripts as one unit, nothing can interrupt them mid way:</p><pre>private static final String RATE_LIMIT_SCRIPT =<br>    &quot;local count = redis.call(&#39;INCR&#39;, KEYS[1]) &quot; +<br>    &quot;if count == 1 then &quot; +<br>    &quot;    redis.call(&#39;EXPIRE&#39;, KEYS[1], ARGV[1]) &quot; +<br>    &quot;end &quot; +<br>    &quot;return count&quot;;<br><br>public boolean checkRateLimit(String apiKey) {<br>    String key = &quot;rate_limit:&quot; + apiKey;<br>    RedisScript&lt;Long&gt; script = RedisScript.of(RATE_LIMIT_SCRIPT, Long.class);<br>    Long count = redisTemplate.execute(<br>        script,<br>        Collections.singletonList(key),<br>        &quot;60&quot;<br>    );<br>    return count != null &amp;&amp; count &lt;= 100;<br>}</pre><p>Now increment and expire are one operation. No gap. The race condition is gone.</p><p>But fixing the race condition only solves half the problem. Even with a perfectly atomic rate limiter, limiting only by API key leaves a pretty obvious hole. An attacker creates 500 free accounts, each one stays under 100 req/min, all 500 run at the same time. That’s 50,000 requests per minute going through cleanly while your rate limiter thinks everything is fine.</p><p>This is why you need multiple layers:</p><pre>public boolean checkRateLimit(String apiKey, String ipAddress) {<br>    return checkLimit(&quot;api_key:&quot; + apiKey, 100, 60)<br>        &amp;&amp; checkLimit(&quot;ip:&quot; + ipAddress, 200, 60)<br>        &amp;&amp; checkLimit(&quot;global:all&quot;, 10000, 60);<br>}<br><br>private boolean checkLimit(String identifier, int max, int windowSeconds) {<br>    String key = &quot;rate_limit:&quot; + identifier;<br>    RedisScript&lt;Long&gt; script = RedisScript.of(RATE_LIMIT_SCRIPT, Long.class);<br>    Long count = redisTemplate.execute(<br>        script,<br>        Collections.singletonList(key),<br>        String.valueOf(windowSeconds)<br>    );<br>    return count != null &amp;&amp; count &lt;= max;<br>}</pre><p>The global limit is what actually saves you here. No matter how many accounts or IPs an attacker rotates through, once total traffic hits 10,000 req/min the whole thing stops.</p><p>Yes there are other ways to prevent these kind of issues (In Redis 6.0 + you have multithreads but its still in I/O so inside redis its still single threaded).You can use DSA based approaches like sliding windows as well.</p><p>Most rate limiters are built to handle mistakes, like a developer accidentally writing an infinite loop. They’re not really built for someone who studied the API and planned around the limits. Worth knowing which one yours is actually protecting against.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c17b23ad1ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can Your Microservices Team Eat Two Pizzas?]]></title>
            <link>https://medium.com/@nhesanda/can-your-microservices-team-eat-two-pizzas-59af1fc60303?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/59af1fc60303</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 06:19:35 GMT</pubDate>
            <atom:updated>2026-03-02T06:19:35.557Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1SE5MuJGCBlsSrPm" /></figure><p>If yes, you might be doing microservices right. If no, you might be building a distributed disaster.</p><p>This is the two pizza rule coined by Jeff Bezos at Amazon. If two pizzas can’t feed the team owning a service, the team is too big. But most junior developers only hear half of it. The other half is just as important</p><p>If one developer is running five services, something is very wrong.</p><p>Ok now I know what you thinking. “So you’re saying my user service should have only 10 developers?” No</p><p>What people casually call “the user service” at large companies is usually a domain made up of many microservices, each owned by its own two pizza team.</p><p>The Two Pizza Rule is not:</p><ul><li>“Every microservice must have exactly one team”</li><li>“Every team must be 6–10 engineers”</li><li>“Every service maps 1:1 to a team forever”</li></ul><p>It is:</p><blockquote><em>“A unit of ownership must be small enough to move fast </em>and<em> large enough to carry the operational load.”</em></blockquote><h3>What Are Microservices, Actually?</h3><p>A microservice is a small, independent service that does one thing and talks to other services over a network, usually via HTTP or a message queue.</p><p>Instead of one big application handling everything (a monolith), you split the system into pieces. The user service handles users. The payment service handles payments. The notification service handles notifications. Each one deploys independently, scales independently, and fails independently.</p><p>That last part is where most people get it wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NH1ayj5HkLDIKHqX" /></figure><h3>The Kitchen Behind the Rule</h3><p>Think of a restaurant kitchen.</p><p>A small cafe has one chef. Takes the order, cooks the food, plates it, hands it over. Simple. Fast. No coordination needed. If something breaks, one person fixes it.</p><p>Now imagine a 5 star restaurant. Pizza station, grill station, sauce chef, pastry chef, and an expeditor coordinating all of them. More complex, but every station is specialized, the kitchen runs at scale, and they serve 1000 plates a night without collapsing.</p><p>A monolith is the café chef. Microservices are the 5 star kitchen.</p><p>The two pizza rule exists because the 5 star kitchen only works when each station has a dedicated team that owns it fully. The moment one person is running three stations alone, the whole kitchen falls apart.</p><p>The same is true for microservices.</p><h3>When the Rule Says Go For It</h3><p>01. Your teams are big enough to own separate services independently</p><p>At Amazon, Netflix, and companies at that scale, hundreds of engineers are shipping code daily. A monolith becomes a traffic jam, everyone waiting on everyone else to deploy. Microservices let each team work, deploy, and ship at their own pace without stepping on each other.</p><p>02. Different parts of your system need to scale differently</p><p>Imagine an e commerce platform during a sale. The product catalog gets millions of hits. The checkout service gets thousands. The admin dashboard gets ten.</p><p>With a monolith, you scale everything together, you’re paying to scale the admin dashboard just because the catalog is under load. With microservices and horizontal pod autoscaling on Kubernetes, you scale only what needs it. Each team tunes their own service’s resources without touching anything else.</p><p>03. Teams need to deploy without waiting on each other</p><p>If the payment team has a critical fix, they shouldn’t wait for the recommendations team to finish their feature. Microservices give each team a deployment pipeline they fully control. The team owns their service end to end ,code, deployment, and uptime.</p><h3>When the Rule Should Stop You</h3><p>01. You only have enough people for one pizza</p><p>This is the most common mistake. A team of two or three developers running five microservices isn’t a two pizza setup.</p><p>Each service in Java needs its own Spring Boot configuration, its own CI/CD pipeline, its own monitoring, distributed tracing (Zipkin, OpenTelemetry), and its own error handling. For a small team, that operational overhead eats more time than the benefits are worth. You’ll spend more time keeping infrastructure alive than building features.</p><p>Your services aren’t actually independent… the distributed monolith trap</p><p>You split your app into five services. But service A can’t do anything without calling service B, which calls service C, which calls back to A. If your services are deeply tangled, you don’t have microservices. It’s just distributed monolith.</p><p>02. You need strong data consistency</p><p>In a monolith, a database transaction is clean. Either everything commits or nothing does.</p><p>In microservices, each service owns its own database. If the payment service updates its records but the order service fails mid transaction, you have an inconsistency. Solving this requires patterns like Sagas or two phase commits, which are complex, hard to debug, and genuinely easy to get wrong.</p><p>If your domain needs strong consistency across entities, finances, medical records, inventory think very carefully before splitting those responsibilities across service boundaries.</p><p>03. You’re too early to even know where the boundaries are</p><p>Microservices require clear boundaries between services. That’s only possible when you deeply understand your domain. If you’re still figuring out what your product does, splitting into services too early means constantly refactoring across service boundaries, which is far more painful than refactoring inside a single codebase.</p><p>Martin Fowler, the engineer who popularized microservices, said it himself:</p><blockquote><em>don’t start with microservices. Start with a well structured monolith and extract services when the pain of not doing so becomes real and specific.</em></blockquote><h3>Test Before You Split</h3><p>Before you break anything off into a microservice, ask these questions:</p><p>Is there a team even a small one that can own this service fully, from code to deployment to uptime? Can this service be deployed without coordinating with five other teams? Does this part of the system have genuinely different scaling or reliability needs from everything else? Do you understand this domain well enough to draw a clean boundary?</p><p>If the answer to most of these is no, you’re not ready. Keep it in the monolith.</p><p>Two pizzas isn’t just a headcount rule. It’s a question of ownership.</p><p>Can your team truly own this service end to end, without depending on everyone else to function? If yes, microservices will accelerate you. If no, they’ll slow you down in ways that are genuinely hard to recover from.</p><p><strong>Start with the monolith. Earn the microservices.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59af1fc60303" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting DTOs in Your Backend Service Can Reduce API Response Time From 6 Seconds to 40ms]]></title>
            <link>https://medium.com/@nhesanda/setting-dtos-in-your-backend-service-can-reduce-api-response-time-from-6-seconds-to-40ms-eebc2bdbb4a6?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/eebc2bdbb4a6</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 04:12:46 GMT</pubDate>
            <atom:updated>2026-02-28T04:12:46.147Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGAWx94ckbjo4dMg3BVkZw.png" /></figure><p>Most of us think we add DTOs because we don’t want to send the entire entity back to the client.<br> The user only needs a name, an id, maybe a status. Why send everything, right?</p><p>That’s exactly how I thought too.</p><p>Turns out, that’s not even the main reason DTOs exist.</p><p>The real reason only shows up once your service gets a bit real. A bit slow. A bit scary.</p><p>Let’s talk about it.</p><p>Say you have a backend service. Plain old REST. Nothing fancy. You load a User from the database.</p><pre>User user = userRepository.findById(id);</pre><p>Your User entity looks innocent enough.</p><pre>@Entity<br>public class User {<br>    @Id<br>    private Long id;<br>    private String name;<br><br>    @OneToMany(mappedBy = &quot;user&quot;, fetch = FetchType.LAZY)<br>    private List&lt;Order&gt; orders;<br>    // getters<br>}</pre><p>Notice that LAZY.</p><p>Most people add it because “that’s the default” or “someone told me eager is bad”. But what does it actually do?</p><p>When Hibernate loads this User, it does <strong>not</strong> load the orders.<br>Not even a little.</p><p>There is no SELECT * FROM orders ... happening at this point.</p><p>Instead, Hibernate puts a placeholder there. A proxy. Something that looks like a list, behaves like a list, but isn’t actually holding any data yet.</p><p>So at this moment:</p><pre>user.getOrders();</pre><p>has not been called. No query has happened. So far, so good.</p><p>Now comes the part nobody expects.</p><p>You return this entity directly from your controller.</p><pre>@GetMapping(&quot;/users/{id}&quot;)<br>public User getUser(@PathVariable Long id) {<br>    return userRepository.findById(id).orElseThrow();<br>}</pre><p>Spring sees this User and hands it to Jackson.</p><p>Jackson’s job is simple: convert this object into JSON. But Jackson doesn’t look at fields. Jackson looks at <strong>getters</strong>.</p><p>So internally, Jackson does something very close to this:</p><pre>user.getId();<br>user.getName();<br>user.getOrders();</pre><p>And that last line is where things quietly go sideways.</p><p>Because now, for the very first time, getOrders() is called. Hibernate sees that call and goes,<br> “Oh. You actually want the orders now? Cool.”</p><p>And fires a SQL query.</p><pre>SELECT * FROM orders WHERE user_id = ?</pre><p>This query happens <strong>during serialization</strong>.<br>Not in your service logic.<br>Not in your repository.<br>While JSON is being written.</p><p>And yes, the data is actually fetched, mapped into entities, and handed back to Jackson so it can keep serializing.</p><p>If this user has 5 orders, that’s one extra query.</p><p>If you return a list of 100 users?</p><p>Now it’s:</p><blockquote>1 query for users</blockquote><blockquote>100 queries for orders</blockquote><p>That’s the N+1 problem.</p><p><strong>Why “+1”?</strong></p><p>Because you start with <strong>1 main query</strong>, and then for each row returned, you accidentally trigger <strong>N more queries</strong>.</p><p>Nothing crashes.No exception. No red flags.</p><p>Your endpoint just went from ~40ms to ~6 seconds and you’re staring at the logs wondering what changed.</p><p><strong>And here’s the part that hurts a little.</strong></p><p>Lazy loading itself isn’t broken.Hibernate is doing exactly what you asked.Jackson is also doing exactly what it’s designed to do.They just don’t know about each other.Jackson doesn’t care that orders is lazy. It sees a getter. It calls it.</p><h4>Now enter DTOs.</h4><p>A DTO is boring. And that’s the point.</p><pre>public record UserDto(Long id, String name) {}</pre><p>No relationships.<br>No proxies.<br>No hidden database access.</p><p>You map it explicitly.</p><pre>User user = userRepository.findById(id).orElseThrow();<br>UserDto dto = new UserDto(<br>    user.getId(),<br>    user.getName()<br>);</pre><p>Notice what’s missing.</p><p>No getOrders() !!!</p><p>Which means Jackson never gets the chance to accidentally wake Hibernate up and make it talk to the database.</p><p>Serialization becomes a pure in-memory operation.<br>No SQL.<br>No surprises.</p><p>That’s why DTOs suddenly turn a slow endpoint into a fast one without changing any queries in your repository. They’re not just about “sending less data”. They’re about <strong>controlling what code is allowed to execute</strong> during serialization.</p><p>Once you see that, a lot of weird production issues start to make sense.</p><p>That random slowdown after adding one field.<br>That endpoint that’s fast in tests but slow in production.<br>That “but I only made it lazy” moment.</p><p>DTOs aren’t ceremony.<br>They’re a safety boundary.</p><p>They stop your database from being touched at the worst possible time: while you’re already in the middle of responding to a request.</p><p>And once you realize serialization can trigger SQL, you never look at “just returning the entity” the same way again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eebc2bdbb4a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s make a 2D RPG game with Java Swing — 02]]></title>
            <link>https://medium.com/@nhesanda/lets-make-a-2d-rpg-game-with-java-swing-02-05d3d3fe5b84?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/05d3d3fe5b84</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[java-swing]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 06:23:14 GMT</pubDate>
            <atom:updated>2026-04-10T13:25:53.410Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s make a 2D RPG game with Java Swing — 02</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SWxNtt-iyj6K4CjDhF05ZA.png" /></figure><blockquote>The content and approach detailed in this blog post were significantly inspired by and adapted from an excellent tutorial series available on YouTube. I highly recommend checking out RyiSnow’s channel and, in particular, his comprehensive <a href="https://www.youtube.com/watch?v=om59cwR7psI&amp;list=PL_QPQmz5C6WUF-pOQDsbsKbaBZqXj4qSq">playlist</a> on this topic. His clear explanations and practical examples served as the foundation for my understanding and, subsequently, this write-up. Please be sure to explore his original work for further insight and give him credit for the valuable resource he has created.</blockquote><p>Ok so in the previous article we discussed how to setup the jpanel and jframe and all that. Now you should have a pitch black , 768x576 resolution (you can change it from the gamepanel.java) screen.</p><p>Ok so for next step we are going to add something to the gamepanel. So first we need to create the world. and then we can put the world in that gamepanel so it’ll show the world we created instead of pitch black.</p><p>First we need to define what is the size of our world.</p><pre>public final int maxWorldCol = 74;<br>public final int maxWorldRow = 74;<br><br>public final int worldWidth = tileSize * maxWorldCol;<br>public final int worldHeight = tileSize * maxWorldRow;</pre><p>Ok so as you can see , our map size is bigger than the screensize (as it should be , unless you making a pretty boring small game )</p><p>Ok so now how to draw the map we want on the gamepanel ?</p><p>For that we need images like this —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIOg3V1SRx3bRACEuxYWxg.png" /></figure><p>These are some of the basics tiles you can use. There’s one for grass, sand, water , wall , and some mud or something?</p><p>You can download these type of assets from sites like <a href="https://itch.io/game-assets/free">itch.io </a>.</p><p>After download the assets now set copy those it to the project folder. Create a seperate folder called ‘res’ and inside there create another folder called ‘tiles’ , and paste them there.</p><p>Now we have to pick each of those tiles and draw them in the gamepanel. So there are basically few methods to this. We can get tiles one by one and draw them in to the gamepanel. Its better if you have a small map like only the size of the gamepanel. For example like snake game (most basic one) , You only have one map , nothing changes on the map , only the player movements.</p><p>And there’s another way we can draw a whole map in to the gamepanel. Let’s do that method. (Let’s take my tiles as an example.)</p><p>So I have water.png, grass.png , wall.png , mud.png . Idea is to assign a value to each one of those tiles , and make a 2 dimensional array for the map. Idea is pretty simple but implementation can be tricky.</p><p>Ex: water.png = 1 , grass.png =2 , wall.png = 3</p><pre>1   1   1   1<br>1   3   3   1<br>2   3   3   1<br>2   3   3   1<br>2   1   1   1</pre><p>Now this shows a nice little map right ?</p><p>Before going on to the coding , first we have to learn about the process. First we are going to import the two dimensional array we created. And then we getting all the images from the images folder and assigning them numbers. And then we have to go column by column on the array and check if its 1 or 2 or 3 and then draw the corresponding tile to the gamepanel. So for that we need to create a new class and then in there we need to define few functions so we can call from the gamepanel.</p><p>First.. we have to create a file names ‘Tile.java’ in a folder called ‘tile’</p><pre>package tile;<br><br>import java.awt.image.BufferedImage;<br><br>public class Tile {<br>    public BufferedImage image;<br><br>}</pre><p>This is the tile type. Our tile type is BufferedImage. BufferedImage is a instance of a Image class. Basically it is more optimized for these type of use cases so we using BufferedImage.</p><p>Now create a file called tileManager.java</p><pre>public class tileManager{<br>    Gamepanel gp;<br>    public Tile[] tile;<br>    public int[][] mapTileNum;<br>    public TileManager(Gamepanel gp){<br>        this.gp = gp;<br>        tile = new Tile[10];<br>        mapTileNum = new int[gp.maxWorldRow][gp.maxWorldCol];<br>        getTileImage();<br>        loadMap(&quot;maps/map04.txt&quot;);<br>    }</pre><p>Now as you can see first we have to create a tile of Tile type (which is a bufferedImage) .BufferedImages are like this —</p><blockquote>BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);</blockquote><p>We have to take an array of bufferedImages because we are dealing with few tiles in here.</p><p>And we have mapTileNum to calculate the number of the map tile, and then we have the constructor that takes gamepanel as a parameter.</p><p>In the constructor we are setting the mapTileNum with maxWorldCol and maxWorldRow. And then we have two functions to define. One is to get the time images from the src folder and next one is to load the map to the gamepanel.</p><p>First let’s talk about getTileImage()</p><pre>public void getTileImage() {<br>    try {<br>        tile[0] = new Tile();<br>        tile[0].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/grass.png&quot;));<br><br>        tile[1] = new Tile();<br>        tile[1].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/wall.png&quot;));<br>        tile[1].collision = true;<br><br>        tile[2] = new Tile();<br>        tile[2].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/water.png&quot;));<br>        tile[2].collision = true;<br><br>        tile[3] = new Tile();<br>        tile[3].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/earth.png&quot;));<br><br>        tile[4] = new Tile();<br>        tile[4].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/tree.png&quot;));<br>        tile[4].collision = true;<br><br>        tile[5] = new Tile();<br>        tile[5].image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(&quot;tiles/sand.png&quot;));<br><br>    }catch (IOException e) {<br>    e.printStackTrace();<br>}<br>}</pre><p>Code is pretty long but the core concept is pretty easy. What we have to do is get image one by one fromt the folders and put them in the bufferedImage array we created. You might be confused with the way we taking the images like , there are alot of functions in there i know.</p><blockquote>ImageIO.read :- Reads the image data from the InputStream and creates a BufferedImage.</blockquote><blockquote>getClass() :- Gets the Class object of the current class (the class where this code is written)</blockquote><blockquote>getClassLoader() :- Gets the ClassLoader that loaded the current class. ClassLoaders are responsible for loading class files and resources.</blockquote><blockquote>getResourceAsStream(“filepath”) :- Asks the ClassLoader to find the resource at path “tiles/grass.png” and return it as an InputStream. The path is relative to the classpath.</blockquote><p>There ‘are’ some other simpler ways to read images. But sometimes it depends on the IDE too. In intellij only this method works. In Ecplipse you can do a simple</p><blockquote>BufferedImage img = ImageIO.read(new File(“src/main/resources/tiles/grass.png”));</blockquote><p>IntelliJ idea uses a strict way to load resources from the project. So we have to go with classloaders.</p><p>Now let’s go to the loadMap() function</p><pre>public void loadMap(String mapFile) {<br>    try {<br>        InputStream is = getClass().getClassLoader().getResourceAsStream(mapFile);<br>        BufferedReader br = new BufferedReader(new InputStreamReader(is));<br>        int col = 0;<br>        int row = 0;<br>        while (col &lt; gp.maxWorldCol &amp;&amp; row &lt; gp.maxWorldCol) {<br>            String line = br.readLine();<br>            //readline reads a line of text<br><br>            while (col &lt; gp.maxWorldCol) {<br>                String numbers[] = line.split(&quot; &quot;);<br>                int num = Integer.parseInt(numbers[col]);<br>                mapTileNum[col][row] = num;<br>                col++;<br>            }<br>            if(col == gp.maxWorldCol){<br>                col = 0;<br>                row++;<br>            }<br>        }<br>        br.close();<br>    }catch (Exception e) {<br>        e.printStackTrace();<br>    }<br>}</pre><p>Hehe…It’s alot I know. Let’s explain the core idea behind this.</p><p>Ok so what we want to do is to load the map. In the InputStream is line we do that. I already explained that line in the previous section. and then we have to get the array it self from the txt file. To do that we can use something like InputStreamReader but this goes from character to character. So we have to use something better , which is BufferedReader (a wrapper class around InputStream) In these classes we don’t read line by line , first we taking the whole thing in the RAM and then gets one by one from there , which is way more efficient. But in this case InputStreamReader will do just fine too.</p><p>And now let me explain the core logic in here. We are going from line by line and taking each of those line’s characters in to a string. Thats basically it. First we have the constraint to check if the array is between our predefined sizes (that we have in gamepanel) and then we setting col and row as 0 and then increamenting one by one on each iteration. readLine() method can read a full line and store it in the line varaible. and then we use line.split(“ “) to remove all the spaces and store them as an String array (remember these are numbers but still we are reading them as Strings). Now we have to convert all that into Integers.And then in the next line we putting those numbers in to the 2 dimensional array we created. In that two dimensional array , at first col is 0 and row is 0. And then when we going through all of them , col and row are increasing incrementally. And then when the col hits the maxWolrdSize we setting col as 0 and then moving to the next column and then increamenting row by 1.And then to stop writing to the ‘br’ we have to do a ‘br.close()’. And we putting all of this in a try catch block.</p><p>Ok now we got the tile images and then we get the map data as well. Now we have to draw it. We are going to discuss that in the next article because we have to implement some threads in this project as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05d3d3fe5b84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s make a 2D RPG game with Java Swing — 01]]></title>
            <link>https://medium.com/@nhesanda/lets-make-a-2d-rpg-game-with-java-swing-01-2cf48cc221b1?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cf48cc221b1</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java-swing]]></category>
            <category><![CDATA[2d-game-development]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 13:11:41 GMT</pubDate>
            <atom:updated>2026-04-10T13:26:34.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s make a 2D RPG game with Java Swing — 01</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/0*MWnymVOm0DW4K9IF.jpeg" /></figure><blockquote>The content and approach detailed in this blog post were significantly inspired by and adapted from an excellent tutorial series available on YouTube. I highly recommend checking out RyiSnow’s channel and, in particular, his comprehensive <a href="https://www.youtube.com/watch?v=om59cwR7psI&amp;list=PL_QPQmz5C6WUF-pOQDsbsKbaBZqXj4qSq">playlist</a> on this topic. His clear explanations and practical examples served as the foundation for my understanding and, subsequently, this write-up. Please be sure to explore his original work for further insight and give him credit for the valuable resource he has created.</blockquote><p>Ever wondered what goes into building a game from scratch? Not with a fancy engine, but with pure Java and the Swing library that’s been around since the late 90s?</p><p>Over this series, we’re going to build a complete 2D RPG game using nothing but Java and Swing. No game engines, no complex frameworks , just core programming concepts, creative problem-solving, and a lot of fun along the way.</p><p><strong>What we’ll build:</strong></p><p>A playable 2D RPG with character movement, tile-based maps, collision detection, NPCs, inventory systems, and combat mechanics. Think classic top-down RPGs like the early Pokémon or Zelda games.</p><p>Ok so before jumping in to game development , you should have atleast basic understanding of Java programming concepts.</p><p><strong>Let’s jump right in to it.</strong></p><p>First create a project. You can use any type of IDE you want , but my personal favourite is IntelliJ idea. And yeah it is power hungry and RAM hungry , but I really like it , i have the educational licence so alot of features. If not you can go with Eclipse editor. VS code is… ok too but i prefer intellij and eclipse. And also make sure you have JDK installed in your machine.</p><p>And now create a java project. Now in the src folder you can see a main.java file. This is the entry point in our game.</p><pre>package main;<br>import javax.swing.*;<br><br>public class Main {<br><br>    public static void main(String[] args) {<br>        JFrame window = new JFrame();<br>        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br>        window.setResizable(false);<br>        window.setLocationRelativeTo(null);<br>        window.setVisible(true);<br>    }<br>}</pre><p>And this is the code.</p><blockquote>Tip :- Don’t just blindly copy paste the code. Understand what’s happening in each of those functions write it out and test out with passing different values to those methods.</blockquote><p>So what’s happening in here. In game development (or any other java app development) you have to create a window right? because everything is inside of that window. To create that window we can use JFrame class. First we have to create a instance of that class.</p><p>Most of these methods aren’t that much verbose. like with the ‘setDefaultCloseOperation’ is for what happens when the user clicks on the exit button on the window. We can change that in here. If you want you can add something to pop up like “Are you really want to exit?” and then exit from the program. Its up to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icWQNKYxPRGBJ9KM132g1Q.png" /><figcaption>Test these out. See what happens.</figcaption></figure><p>And then we have setResizable is set to false. At our first game its better to keep that false because if the window is resizable then we have to re-render everytime it resizes and it’s way complicated. First let’s do this in easy way.</p><p>With the setLocationRelativeTo(null) means it’s going to be in the middle of the screen. If you didnt add this part then window is going to be somewhere around upper left corner.</p><p>And Of course setVisible is true.</p><p>So yeah. this is basically it. Now run the applcation and you might get a small window in the middle of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*KgljI3RlO-DXpcfZcRMHvQ.png" /><figcaption>In mac something like this.</figcaption></figure><p>Ok now we can’t keep the window like this right? we have to make it bigger. But how to make it bigger. ?</p><p>You can add this line to the main . java file.</p><pre>window.setSize(800,600); //width and height</pre><p>But… it’s not the best practice. why? because we have to make a gamepanel (where the content of the game shows basically) and then fill the frame with that gamepanel. in that way we have better control over screen resolution and renderings.</p><p>So , add these two lines</p><pre>window.add(gamePanel);<br>window.pack();</pre><p>Now we have to create the gamepanel . That gamepanel should have the sizes and everything so all that content is going inside of the frame and with window.pack() it ‘packs’ the content inside of it.</p><p>Now create a ‘Gamepanel’ class in the same directory.</p><pre>package main;<br>import javax.swing.*;<br>import java.awt.*;<br><br>public class Gamepanel extends JPanel{<br>    //screen settings<br>    final int originalTileSize = 16; //16x16 tiles<br>    public final int tileSize = originalTileSize * 3; //48x48 tiles<br>    public int maxScreenCol = 16;<br>    public int maxScreenRow = 12;<br>    public final int screenWidth = tileSize * maxScreenCol; //768 pixels<br>    public final int screenHeight = tileSize * maxScreenRow; //576 pixels<br><br>public Gamepanel() {<br>        this.setPreferredSize(new Dimension(screenWidth, screenHeight));<br>        this.setBackground(Color.black);<br>        this.setDoubleBuffered(true);<br>    }</pre><p>Now this is a lot, I know. but let’s go one by one slowly.</p><p>Why we extending this with JPanel. And what is JPanel ?</p><p>Well basiclly JPanel is the ones that we put inside of JFrames. That JPanel have all the methods we need to include this gamepanel inside of that Jframe window.</p><p>Now since we are making a Tile game , we need to define a single tile size right ?</p><p>So let’s decide that. First I’m making the tileSize as 16. Back in the day with low resoltion screen that tile size was…enough actually. But nowadays , 16 pixels tile is really really small. So we have to make it big. That’s why Im multiplying it by 3. If you want bigger tiles then you can go with 4.</p><p>Now what is maxScreenCol and maxScreenRow. Those says , how many tile rows and tile columns are in our JPanel instance (in this case our JPanel instance is gamepanel). Im making 16 columns and 12 rows.</p><p>Now according to the simple mathematics you learned in high school, you should know , you can get the screenWidth and screenHeight with that formula.</p><p>Now we have world Settings. maxWorldCol , maxWorldRow etc. Since our actual game map is bigger than the window we have to set that as well. In here Im defining it as 74x74 world. But it depends on your world. If you want a bigger world then this goes up. And again we have to calculate the actuall size of the world with the same math we did earlier.</p><p>And now we have the constructor. In the contrustor we setting up few things to plug this in to the JFrame. I don’t have to explain all of this because these aren’t that much verbose. But about setDoubleBuffered. We use that to double buffer all the assets before it showing in the gamepanel. Why ? Because you do the buffering one time it shows the drawing in the screen. It might look ugly, and users might see the screen flickering.</p><p><strong>Congratulations. Now you have a pitch black screen , with controllable screen size. ;)</strong></p><p>In the next part we’re going to draw something in the screen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cf48cc221b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quantum Computing and It’s Impact on Cryptography]]></title>
            <link>https://medium.com/@nhesanda/quantum-computing-and-its-impact-on-cryptography-part-01-07e5892c916b?source=rss-04e5db1152b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/07e5892c916b</guid>
            <category><![CDATA[quantum-mechanics]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Hesanda Nimneth Liyanage]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 05:41:56 GMT</pubDate>
            <atom:updated>2025-12-25T13:21:07.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h85sHQn0fncEb6It_M9kOw.png" /></figure><p>Lately, Quantum Computing has moved from theoretical speculation to a rapidly advancing field with a wide range of implications, such as Cryptography. These Quantum Computers process data with the help of concepts like Superposition and Entanglement to perform complex calculations. So with this huge technical leap, technologies such as Cryptography can take a lot of advantages.</p><p>In this article we’re gonna talk about <strong>Quantum Computing and Quantum Algorithms and its impact on cryptography</strong>.</p><h3><strong>01.Quantum Computing</strong></h3><p><strong>It’s better to have an basic understanding of Quantum Computing before diving in to Quantum Algorithms.</strong></p><p>So, What is Quantum Computing? How does it work ? Do we have to learn quantum mechanics in depth for this ?</p><p>First of all , No you don’t need to learn Quantum Mechanics to learn quantum algorithms and their use cases.(though, if you can , it’s better). You know about our classical computers, right? Computers that work with 0s and 1s ?. These are called “bits”. Well these Quantum Computers don’t have bits. They use something called <strong>“Quantum Bits”</strong> or <strong>“Qubits”.</strong></p><p>Qubits have 3 states. We call them <strong>“Quantum States”</strong> and can be 1, 0 and Both at the same time!!!. You can think of it as a spectrum. This ability to become both states at once is called <strong>Superposition.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*dtOtXQKeb25hvmyfPycwAg.png" /></figure><p><strong>I)Superpositions —</strong></p><p>Imagine the moment when you flipped a coin and it’s in the air right now. So what is the coin’s state now? Head or tails? You can’t tell right? Because it’s in the air , it’s still not heads or tails. The coin is in a state of uncertainty. This is that 3rd state of the qubit. We call this a <strong>“Superposition”</strong> which is a property in quantum mechanics , where particles can exist in a blend of multiple states <strong>until they are measured</strong>.</p><p>When it falls it has a definite state , which is either heads or tails. So with this superposition we can calculate the probability of a Qubit being in either the 0 or 1 state. Imagine if coin’s head side is weighted more than tails side. Well then there’s a higher chance that it’ll be heads right ? Just like that if a qubit in a superposition we can calculate how much of a chance it has with either 1 or 0. Mathematically we can write the qubit in superposition as,</p><h3><strong>∣ψ⟩=α∣0⟩+β∣1⟩</strong></h3><blockquote><em>α , β = These are complex numbers called “Amplitudes , that determine the probability of measuring the qubit in either 0 or 1 state.</em></blockquote><blockquote><em>ψ = Quantum state of the Qubit</em></blockquote><blockquote>∣x⟩ = This is 0/1 state of the qubit (pronounced as “ket-zero”/”ket-one”) represented in “Dirac notation”</blockquote><p>You won’t be needing these terms in depth for understanding the Quantum Algorithms. This is just to get an basic understanding of what Quantum Computing.</p><p>And from this equation you can calculate the probability of getting 1 or 0 in a Qubit.</p><p><strong>II)Entanglement —</strong></p><p>In Quantum Mechanics We can connect two or more Qubits , So the state of one particle is directly connect to the state of the other.</p><blockquote><strong>Quantum entanglement</strong> is the phenomenon of a group of particles being generated, interacting, or sharing spatial proximity(Physical closeness of Qubits or Quantum Systems within a Quantum Processor)in such a way that the quantum state of each particle of the group cannot be described independently of the state of the others, including when the particles are separated by a large distance.</blockquote><p>This not a thing that happen automatically. These Entanglements happens during certain operation in Quantum Algorithms. With Quantum Entanglement we can determine the state of one particle just by finding the state of the entangled particle , even tho they’re billions of light years apart!!!. (Spooky action at distance).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyw5vjA_KA3qQlyX-t3fZg.png" /></figure><h3>02.Quantum Algorithms</h3><p>Ok So you know we have DSA( Data Structures and Algorithms) in classical Computers? In Quantum Computers they have Quantum Algorithms. Because Quantum Computers works in a completely different way than our classical computers. Our usual DSA concepts such as arrays , linked lists, trees and graphs are designed around the manipulation of binary data. So those concepts won’t work <strong>directly </strong>on Quantum Computers. But the idea of those concepts are exists in Quantum Computing. For example in Quantum Computing there are Quantum registers that holds multiple elements. But it’s totally different from our usual ‘Arrays’.</p><p>There’s few Quantum Algorithms that designed specifically to run on Quantum Computers by taking advantage of their Quantum properties such as Superpositions and Entanglements etc.</p><blockquote><strong>01.Shor’s Algorithm (For factoring)</strong></blockquote><blockquote><strong>02.Grover’s Algorithm (For Search Problems)</strong></blockquote><blockquote><strong>03.Quantum Fourier Transform/QFT (Quantum version of Fourier transform)</strong></blockquote><blockquote><strong>04.Quantum Simulations</strong></blockquote><blockquote><strong>05.Variational Quantum Eigensolver (VQE) And Quantum Approximate Optimization Algorithm(QAOA)</strong></blockquote><blockquote><strong>06.Lattice-based Algorithm</strong></blockquote><p>And many more….</p><p>But in our case , to improve the Cryptography encryption methods, We talk about “Shor’s Algorithm” ,“Grover’s Algorithm” and “Post-Quantum Cryptography”.</p><p>First let’s take a look at these algorithms and then let’s see how we can implement those algorithms in Cryptography.</p><h3><strong>Shor’s Algorithm —</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QciYZbJonkKvOFRFAm9ZAA.png" /><figcaption><a href="https://fastercapital.com/topics/shors-algorithm-and-its-implications.html">Shor’s Algorithm</a></figcaption></figure><p>Shor’s algorithm is a Quantum Algorithm that can factors very large numbers ,but better than our classical computers. Factoring large numbers is difficult for classical computers because in classical computers they guess one number at a time so if the number is big then it takes alot of time. Which is why RSA and similar cryptosystems are considered secure.(We’ll get to that later).</p><p>Example: Let’s factor the number N = 15.</p><p>01.Pick any number that less than N , say ‘a’.</p><p>First take let’s take the number that we want to find the factors as , N = 15.</p><p>Now pick any number that less than N. So for ease of our use I’m gonna take a=2.</p><p>Now in Shor’s algorithm we use something called “Moduler arithmetic”.</p><p>So now we need to find something called period which is how many times moduler arithmetic repeats around the number N=15.</p><blockquote>2¹ MOD 15 = 2</blockquote><blockquote>2² MOD 15 = 4</blockquote><blockquote>2³ MOD 15 = 8</blockquote><blockquote>2⁴ MOD 15 = 1</blockquote><blockquote>2⁵ MOD 15 = 2 …… And repeats.</blockquote><p>You can do this with any numbers and it always repeats. This is the Modular arithmetic.</p><p>So how many times did it repeat? 4 . So we take r=4.</p><p><strong>N=15, a=2, r=4.</strong></p><p>Now we use these variables in this formula —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IA0PSs6V7rAKy9YHj42oOA.png" /><figcaption>Formula in Shor’s algorithm</figcaption></figure><p>(a ʳ⁄₂−1) = 3 And (aʳ⁄₂+1) = 5.</p><p><strong>gcd(3,15) = 3.</strong></p><p><strong>gcd(5,15) = 5.</strong></p><p><strong><em>This is not the only way to approach Shor’s algorithm !!!</em></strong></p><p>Now you might think , well why we can’t do this in a classical computer ? Well for very large numbers classical computers takes a long time because it has to guess the answers. But in Quantum computers you can calculate the “r” super quickly using <strong>“Quantum Fourier Transform(QFT)”.</strong> (We don’t need that in here)</p><h3><strong>Grover’s Algorithm —</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NhmeeJ3Emgj2GY2EDptu8A.png" /><figcaption><a href="https://fastercapital.com/keyword/grovers-algorithm.html">Grover’s Algorithm</a></figcaption></figure><p>This algorithm is all about searching. Imagine there are 100 boxes and in one box has a treasure in it. In classical computers we have to search every box one by one to find the correct box. But in Quantum Computers it uses something called “Quantum Parallelism” to explore multiple boxes at the same time.</p><p>Best way to explain it, is through an example.</p><p>So imagine there’s 100 boxes. And one box containing a treasure. We have to find that box. Each box has a unique number combination. In classical computer we have to find the correct box by checking one by one.</p><p>So what Grover’s algorithm do first is putting all 100 boxes into a superposition. So every box has an equal chance of having the treasure.</p><p>Now Grover’s algorithm uses an operation called “Oracle” to mark out the correct box. Oracle is a function in Quantum computing that can change the state of the correct box. Imagine Oracle function as a metal detector. It “beeps” around the metal right? So same thing here , it finds the correct box by beeping So we can’t 100% find the box , but we can get an idea where it is. Think of that beeping like quantum signature.</p><p>And now Grover’s algorithm uses Amplitude Amplification to increase the chances of finding the correct box. It’s like increasing the Volume of the metal detector. With that we can get a better idea where it is. And after few iterations (N½) times it has a higher chance of finding the correct box.</p><p>So in classical computers , in worse case we have to check N times to find the correct box while we can find the correct box in N½ times with Grover’s algorithm.</p><blockquote>So if an encryption method has 2¹²⁸ bits key then we can find the encryption key by 2⁶⁴ bits.</blockquote><h3>Conclusion:</h3><p>Quantum computing is going to change everything about how we keep data secure. Current encryption methods that we use today could be broken by quantum computers in the future. However, researchers are already working on new types of encryption that can resist quantum attacks.</p><p>The good news is that we still have time to prepare. Companies and organizations need to start planning now for the transition to quantum-safe security methods. While quantum computers present serious challenges to current cryptography, they also push us to develop better and stronger security systems. The future of data protection will be different, but it will still exist..just in a more advanced form that can stand up to quantum threats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07e5892c916b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>