<?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 Guna Abhiram Bondada on Medium]]></title>
        <description><![CDATA[Stories by Guna Abhiram Bondada on Medium]]></description>
        <link>https://medium.com/@abhiknowswhy?source=rss-cc3b6ccce261------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-xcumwsDiMuWSl2O</url>
            <title>Stories by Guna Abhiram Bondada on Medium</title>
            <link>https://medium.com/@abhiknowswhy?source=rss-cc3b6ccce261------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:49:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhiknowswhy/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[What the Stock?]]></title>
            <link>https://medium.com/@abhiknowswhy/what-the-stock-1ade92e592f4?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ade92e592f4</guid>
            <category><![CDATA[financial-literacy]]></category>
            <category><![CDATA[equity-compensation]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 11:28:37 GMT</pubDate>
            <atom:updated>2026-02-02T11:28:37.693Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding your equity package isn’t rocket science!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VF9j49EAPmKUUPYBfYNYLQ.jpeg" /></figure><p>I decided to write this blog after a loooong and interesting conversation with my friend <a href="https://www.linkedin.com/in/ml-engineer-v-s-s-anirudh-sharma/"><strong>Anirudha Sharma</strong></a><strong> </strong>(do follow him on linkedin, cool guy)</p><p>So you just got a job offer with “competitive equity compensation” or your company announced a new stock grant. Congratulations! But… what does it all actually mean? If you’ve ever stared at an equity compensation document feeling like you need a law degree and an MBA to understand it, you’re not to blame — people who went to law schools and B-schools wrote them. Let’s break down the world of employee stock awards — what they are, how they work, and most importantly, what they mean for your wallet.</p><h3>Why Do Companies Give Stock Awards?</h3><p>Before diving into the types, let’s understand the “why.” Companies offer equity compensation for several reasons:</p><p>1. Alignment of interests — When you own a piece of the company, you’re motivated to help it succeed<br>2. Cash conservation — Especially for startups, stock can supplement salary when cash is tight<br>3. Retention — Vesting schedules encourage employees to stick around<br>4. Attraction — Competitive equity packages help recruit top talent</p><p>Think of it this way: if your company doubles in value, and you own part of it, you benefit directly. That’s a powerful motivator that a salary alone can’t provide.</p><h3>The Umbrella: ESOP (Employee Stock Ownership Plan)</h3><p>An <strong>ESOP</strong> is the overarching framework — the “umbrella program” — that defines how a company grants equity to its employees. It’s not a specific type of award; it’s the plan that governs how stock-based rewards are structured and distributed.</p><p>- Sets the rules for who is eligible for equity grants<br>- Defines the total pool of shares available for employee compensation<br>- Establishes the governance and administration of equity awards<br>- Can include various types of awards (RSUs, ISOs, NSOs, etc.)</p><p>Think of it this way: Think of ESOP as an interface, and RSU, ISO, NSO, etc. are the concrete implementations. Let’s discuss them in detail</p><h4>RSU (Restricted Stock Unit) — The “Promise of Shares” Award.</h4><p>RSUs are the most straightforward type of equity compensation, especially popular at large public companies like Microsoft, Google, and Amazon.</p><p>How it works</p><p>1. Grant: Company promises you a certain number of shares<br>2. Vesting: Over time, portions of those shares become yours<br>3. Delivery: Once vested, you receive actual shares — no action required on your part</p><p>The beauty of RSUs</p><ul><li>No purchase required — You don’t pay anything to receive them</li><li>Simpler math — 100 RSUs that vest = 100 shares you own</li><li>Lower risk — Unlike options, RSUs always have value (unless the stock goes to $0)</li></ul><p>Tax implications</p><p>RSUs are taxed as ordinary income when they vest. If your company grants you RSUs worth $10,000 and they vest, that $10,000 is added to your taxable income for the year — regardless of whether you sell the shares.</p><p>Example: You receive 1,000 RSUs with a 4-year vesting schedule:</p><ul><li>Year 1: 250 RSUs vest → You own 250 shares</li><li>Year 2: 250 RSUs vest → You now own 500 shares</li><li>Year 3: 250 RSUs vest → You now own 750 shares</li><li>Year 4: 250 RSUs vest → You now own 1,000 shares</li></ul><p>Many employees opt to “sell to cover” — automatically selling enough shares to pay the taxes owed when RSUs vest. Let’s say 100 shares are vested and your tax rate is 30%, you sell off 30 shares to pay off the tax and keep 70.</p><h4>Stock Options: ISO vs. NSO</h4><p>Stock options give you the right to buy company shares at a predetermined price. Unlike RSUs, you don’t automatically receive shares — you have to actively purchase them.</p><h4>ISO (Incentive Stock Option) — The Tax-Advantaged Employee Option</h4><p>ISOs are designed exclusively for employees and come with potential tax benefits.</p><p>How it works:</p><ol><li>Grant: You receive the option to buy X shares at $Y (the “strike price” — usually the fair market value of the stock at grant date)</li><li>Vesting: The options become exercisable over time</li><li>Exercise: You choose when (or if) to buy the shares at the strike price</li><li>Sell: You sell the shares, hopefully at a higher price (ideally you don’t exercise options when the stock price is below the strike price)</li></ol><p>Tax advantages:</p><ul><li>No tax at grant or exercise (for regular income tax purposes)</li><li>If you hold shares for 1+ year after exercise AND 2+ years after grant, gains are taxed at lower long-term capital gains rates</li><li>Potential to significantly reduce your tax burden</li></ul><p>The catch:</p><ul><li>The <strong>Spread</strong> (market price minus strike price) at exercise may trigger <strong>Alternative Minimum Tax (AMT)</strong></li><li>Strict holding requirements to get favorable tax treatment</li><li>Only available to employees</li></ul><p>Example:</p><ul><li>Strike price: $10/share</li><li>Current market price: $50/share</li><li>You exercise 100 options: Pay $1,000 for shares worth $5,000</li><li>Your “paper gain”: $4,000 (but you haven’t sold yet!)</li></ul><p>If you sell immediately after exercising, the $40/share gain is taxed as ordinary income. But if you hold for the required periods, that $40/share becomes a long-term capital gain.</p><h4>NSO (Non-Qualified Stock Option) — The Flexible Option</h4><p>NSOs work similarly to ISOs but without the special tax treatment — and with fewer restrictions. Tax treatment is worse for NSOs because the spread at exercise is treated as ordinary income, meaning you pay higher taxes compared to capital gains rates — even if you hold the shares long-term. Restrictions are more relaxed, and they can be granted to employees, contractors, advisors, and even board members.</p><p>ISOs may still trigger AMT (Alternative Minimum Tax) based on the spread at exercise.</p><p>When NSOs make sense:</p><ul><li>You’re a contractor or advisor, not an employee</li><li>You want to exercise and sell immediately without worrying about holding periods</li><li>The company wants flexibility in who receives equity</li></ul><p>ISOs = Better tax treatment, stricter rules<br>NSOs = More flexible, higher taxes at exercise</p><h3>ESPP (Employee Stock Purchase Plan) — The Discounted Stock Shopping Spree</h3><p>ESPPs are a benefit many employees overlook, but they can be an excellent deal.</p><p>How it works</p><p>1. Enrollment: You elect to contribute a percentage of your salary (usually up to 15%)<br>2. Accumulation: Money is deducted from each paycheck and held<br>3. Purchase: At the end of a purchase period (often 6 months), the accumulated funds buy company stock<br>4. Discount: You typically get a 10–15% discount off the stock price</p><p>The “look-back” provision</p><p>Many ESPPs have a “look-back” feature: the purchase price is based on the lower of the stock price at the beginning OR end of the purchase period, minus the discount.</p><p>Example:</p><ul><li>Stock price at start of period: $100</li><li>Stock price at end of period: $150</li><li>Your purchase price (with 15% discount on lower price): $85</li><li>Instant gain: $65/share (76% return!)</li></ul><p>Even if the stock stays flat or goes down slightly, the discount provides a built-in profit margin.</p><h4>Performance Stock Units (PSUs) — The “Earn It” Award</h4><p>PSUs are like RSUs with extra conditions attached — typically tied to company performance metrics. PSUs are more common for executives and senior leaders, but some companies extend them to all employees.</p><p>How PSUs differ from RSUs:</p><ul><li>RSUs Vest based on time, PSUs vest based on time AND performance goals</li><li>Number of RSU shares is fixed, number of PSU shares can vary (0% to 200%+ of target)</li><li>PSUs are higher risk higher potential reward compensation models</li></ul><p>Common performance goals used in PSU contracts:</p><ul><li>Revenue growth — company revenue grows by X%</li><li>Earnings per share (EPS) (Earnings = Revenue - Costs)</li><li>Stock price targets</li></ul><p>Example: You’re granted 1,000 PSUs targeting 20% revenue growth:</p><ul><li>If growth is &lt; 15%: You get 0 shares</li><li>If growth is 20%: You get 1,000 shares (100% of target)</li><li>If growth is 25%+: You might get 1,500 shares (150% of target)</li></ul><h3>Key Concepts You Need to Know</h3><h4>Vesting Schedule:</h4><p>The vesting schedule determines when your equity actually becomes yours.</p><p>Common structures:</p><ul><li>4-year with 1-year cliff — Nothing for year 1, then 25% vests at the cliff, remaining vests monthly/quarterly</li><li>Monthly vesting — Equal portions vest each month</li><li>Back-weighted — More vests in later years (e.g., 10/20/30/40 over 4 years)</li><li>Performance-based — Vests only when specific goals are met</li></ul><h4>Cliff:</h4><p>A “cliff” is a waiting period before any equity vests. With a 1-year cliff:</p><ul><li>Leave at month 11? You get nothing</li><li>Stay until month 12? You receive your first chunk (typically 25%)</li></ul><p>The cliff protects the company from granting equity to employees who leave quickly.</p><h4>Strike Price (Exercise Price):</h4><p>For stock options, the strike price is the fixed cost at which you can buy shares.</p><p>Key points:</p><ul><li>Set on the grant date, usually at fair market value (FMV)</li><li>Never changes, regardless of how high (or low) the stock goes</li><li>Your profit = Market price — Strike price</li></ul><h4>The “underwater” problem:</h4><p>If the stock price falls below your strike price, your options are “underwater” — exercising them would mean paying MORE than the shares are worth. This is why options carry more risk than RSUs.</p><p>Example:</p><ul><li>Strike = $50, Current price = $30</li><li>Your options are underwater by $20/share</li><li>Exercising makes no sense — you’d pay $50 for something worth $30</li></ul><h4><strong>Change of Control Provisions:</strong></h4><p>What happens to your unvested equity if your company gets acquired? That depends on the Change of Control provisions in your agreement.</p><p>Single Trigger:</p><ul><li>Equity vests **automatically** when the acquisition closes</li><li>More employee-friendly</li><li>Less common in modern agreements</li></ul><p>Double Trigger:</p><ul><li>Equity only accelerates if the acquisition happens **AND** you’re terminated (or your role substantially changes)</li><li>Protects the acquiring company from immediate equity payouts</li><li>More common today</li></ul><p>** <strong>Read your agreement carefully!</strong> Some companies have no acceleration provisions at all, meaning unvested equity could be canceled or converted on unfavorable terms.</p><h4>Comparing the Award Types</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c0b010e8670ed0d69adf13959b41edb/href">https://medium.com/media/4c0b010e8670ed0d69adf13959b41edb/href</a></iframe><h3>Practical Tips</h3><p>When you receive an equity grant</p><p>1. Read the full agreement — Not just the summary, the actual legal document<br>2. Understand your vesting schedule — Know your cliff date and vesting frequency<br>3. Check the strike price (for options) — Is it at current FMV?<br>4. Review change of control provisions — What happens in an acquisition?<br>5. Know the expiration date (for options) — Most expire 10 years from grant, or 90 days after leaving</p><h4>Tax planning considerations</h4><p>1. RSUs: Consider selling to cover taxes, or set aside cash for the tax bill<br>2. ISOs: Be aware of AMT implications; consider exercising early when spread is small<br>3. NSOs: Factor in immediate tax hit when deciding to exercise<br>4. ESPP: Usually a no-brainer — the discount provides downside protection. Always opt for ESPP, even if you sell immediately after vesting — you are still profitable.</p><p>When leaving a company</p><p>1. Options: Know your exercise window (often only 90 days!)<br>2. RSUs: Unvested RSUs are typically forfeited<br>3. Calculate the math: Is it worth exercising options before you leave?<br>4. Document everything: Keep records of grants, exercises, and tax basis</p><h3>The Bottom Line</h3><p>Equity compensation can be confusing, but it’s often a significant part of your total compensation — especially in tech. Understanding the differences between RSUs, ISOs, NSOs, ESPPs, and PSUs helps you:</p><p>- Negotiate better when evaluating job offers<br>- Plan your finances around vesting schedules and tax events<br>- Make informed decisions about exercising options and selling shares<br>- Avoid costly mistakes like missing exercise deadlines or unexpected tax bills</p><p>The next time someone throws terms like “four-year vest with a one-year cliff” or “ISO with AMT implications” at you, you’ll know exactly what they’re talking about.</p><h3>Quick Reference Summary</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52649e986f686277bcd7f57fcc36b869/href">https://medium.com/media/52649e986f686277bcd7f57fcc36b869/href</a></iframe><p>Now go forth and decode that equity compensation document with confidence!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ade92e592f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What the Auth? (Pt. 4)]]></title>
            <link>https://medium.com/@abhiknowswhy/what-the-auth-pt-4-21e46d16e3b9?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/21e46d16e3b9</guid>
            <category><![CDATA[passkey]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 13:11:17 GMT</pubDate>
            <atom:updated>2026-01-23T16:04:20.404Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 4 of 4 part series</h4><h4><em>The Passwordless Future: How WebAuthn and FIDO2 are finally killing the password</em></h4><p>Thanks to <a href="https://www.linkedin.com/in/sudomakes/"><strong>Vaibhav</strong></a><strong> -</strong> CTO of <a href="https://www.vaatun.com/"><strong>Vaatun</strong></a>, for suggesting this topic, Do check his <a href="https://sudomakes.substack.com/"><strong>substack</strong></a>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KYk5uc_eAqLNdCpzHhBHkg.jpeg" /><figcaption>A FIDO Yubikey physical device to store Passkeys</figcaption></figure><p>In Part <a href="https://medium.com/@abhiknowswhy/what-the-auth-3839c2e5b906">1</a>, we explored the evolution from simple cookie-based authentication to hashed and salted passwords. In Part <a href="https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023">2</a> and <a href="https://medium.com/@abhiknowswhy/what-the-auth-6b364a001419">3</a>, we saw how OAuth 2.0 and OpenID Connect revolutionized delegated authentication and social login. But we’re still relying on passwords. Even with hashing, salting, and OAuth flows, passwords remain the weakest link in our security chain.</p><p>Users reuse passwords across sites, phishing tricks people into giving them away, data breaches expose billions of hashes that can be cracked, and password managers are just a band-aid on a fundamentally broken system. Meanwhile, enterprises spend millions on password resets (20–50% of help desk calls), breach response, and development overhead building secure password flows.</p><p>What if we could eliminate passwords entirely? What if authentication could be both more secure and easier to use? That’s exactly what <strong>passkeys</strong> powered by <strong>WebAuthn</strong> and <strong>FIDO2</strong> achieve — and it’s already here.</p><p><strong>Why Passwords Never Worked</strong></p><p>Passwords created an impossible burden on both users and systems. Users face a security paradox: strong passwords are hard to remember, memorable passwords are weak. The average person has over 100 online accounts, making unique passwords impractical. Even password managers only patch the symptoms.</p><p>Technically, passwords are fundamentally broken. They’re shared secrets between user and server — if the server is hacked, the secret is exposed. Passwords can be replayed if intercepted, typed into fake websites since users can’t reliably spot phishing, and reused across services through credential stuffing attacks. The costs are staggering: enterprises spend $70+ per password reset, millions on breach response, and engineering teams burn cycles building reset flows and account recovery.</p><p><strong>The Journey to Passkeys</strong></p><p>The FIDO Alliance formed in 2012 with an audacious mission: kill the password. Their insight was elegant — replace shared secrets with asymmetric cryptography. Instead of both user and server knowing a secret, use public-key cryptography where only you have the private key.</p><p>This evolved through FIDO U2F (2014), which added hardware security keys as a second factor but still required passwords. FIDO2 (2018) enabled true passwordless authentication, allowing credentials stored in device biometrics, PINs, or security keys. Finally, in 2022, Apple, Google, and Microsoft unified around the term passkeys — FIDO2 credentials with cloud sync that work across devices, making the technology practical for mainstream users.</p><p><strong>How Passkeys Actually Work</strong></p><p>The core mechanism is elegantly simple: asymmetric cryptography replaces shared secrets. You have a private key (stored securely on your device) and the server stores your public key. Only your private key can create valid signatures, and only your public key can verify them. Here’s a high level overview of the exchanges that happen during Passkey creation and Passkey login:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wk74Llxp8fnQlIUdVgl23A.png" /><figcaption>Passkey creation and authentication flows</figcaption></figure><p>When you create a passkey on a website, the browser requests it from your device’s authenticator (Touch ID, Face ID, Windows Hello, or a hardware key). After you verify yourself biometrically, the authenticator generates a unique key pair for that website, stores the private key securely in the device’s hardware (Secure Enclave, TPM, etc.), and sends the public key back to the server. The server stores this public key — nothing else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*ZkPmI34aeb0Kt2tny-dyqA.jpeg" /><figcaption>Different biomechanical verification in passkey authentication flows</figcaption></figure><p>Later, when you log in, the server sends a random challenge. Your authenticator verifies it’s you again (biometric), retrieves the private key, signs the challenge, and sends the signature back. The server verifies the signature using the stored public key. If it matches and the challenge is correct, you’re logged in. This entire flow is cryptographically bound to the specific domain, so the same credential won’t work on a phishing site.</p><p><strong>The Security Guarantees</strong></p><p>This approach provides security guarantees that passwords can never achieve.</p><p><strong>Phishing-Resistant</strong>: The credential is cryptographically bound to a specific domain. Even if you’re tricked into visiting a lookalike site, your passkey won’t work there because the origin validation fails silently.</p><p><strong>Breach-Resistant</strong>: The server only stores public keys. If breached, attackers get useless cryptographic material — the private keys never leave your device.</p><p><strong>Replay-Resistant</strong>: Every authentication uses a unique challenge and produces a unique signature. Old signatures can’t be replayed. A signature counter on each credential also detects if someone tried to clone your passkey.</p><p><strong>Man-in-the-Middle Resistant</strong>: The origin is cryptographically included in the signed authentication data. An attacker intercepting traffic can’t forge a valid signature for a different domain.</p><p><strong>Malware-Resistant</strong>: No password is typed. Biometric authentication happens in secure hardware isolated from your operating system. Even with keyloggers or screen recording, attackers can’t extract the private key or replay past authentications.</p><p>Modern devices have specialized hardware for secure key storage. Apple’s Secure Enclave, Windows TPM, Android’s Keystore, and hardware FIDO2 keys all keep private keys isolated where even the operating system can’t access them. All cryptographic operations happen inside this protected boundary.</p><p><strong>Passkeys and Cloud Sync</strong></p><p>FIDO2 solved the technical problem, but created a practical one: losing your device meant losing access to accounts. Apple, Google, and Microsoft solved this with passkeys, adding cloud sync while maintaining security. Your private key is encrypted end-to-end before cloud storage using encryption keys derived from your device passcode. Even the cloud providers can’t decrypt your keys. Your passkeys sync across all your devices signed into the same account, so losing one device doesn’t mean losing all your credentials.</p><p>The user experience improvement is dramatic. With passwords, you visit a site, click “Forgot Password,” wait for an email, click a link, type a new password, probably forget it again. With passkeys: visit site, click “Sign in,” touch your fingerprint or face, done. No username, no password, no recovery flow.</p><p>One of the coolest features is cross-device authentication. If you’re on a work computer without your passkeys, a QR code appears. Scan it with your phone (which has your passkeys), verify with Face ID on your phone, and you’re authenticated on the work computer. The phone never sends the private key — just a cryptographic proof that you’re authorized.</p><p><strong>The Current State of Adoption</strong></p><p>Passkeys aren’t theoretical anymore. Apple added them to iCloud Keychain across iOS, iPadOS, and macOS starting in 2022, with end-to-end encryption. Google added them to Google Password Manager for Android and Chrome in December 2022. Microsoft added Windows Hello support for passkeys synced across Windows devices. With WebAuthn libraries, you can create a cross platform application which allows passkey authentication on any supported device. More and more devices keep updating to support passkeys each day.</p><p>Identity providers leading adoption include Apple ID, Google Account, and Microsoft Account — all offering passwordless sign-in with passkeys. Financial services like PayPal, Shopify, and Stripe support passkey authentication. Social platforms including WhatsApp, TikTok, and Discord are testing or rolling out support. Technology companies like GitHub, Cloudflare, and cloud providers are enabling passkey login. Gaming platforms like Nintendo and PlayStation are experimenting with FIDO2.</p><p>Enterprises are adopting passkeys for workforce authentication, integrating with identity platforms like Azure AD and Okta, and using hardware FIDO2 keys for privileged access management. This shift is part of broader zero-trust architecture where authentication is continuous rather than just at login.</p><p>For developers, open-source libraries like BetterAuth, SimpleWebAuthn, and py_webauthn make passkey implementation accessible without requiring deep cryptography expertise. These libraries handle the complex validation, challenge generation, and signature verification, letting teams focus on user experience rather than low-level security details.</p><p><strong>Challenges and Realities</strong></p><p>We’re in a messy transition phase. Not every website supports passkeys yet, though adoption accelerates. Most services maintain password fallbacks, and many users don’t understand passkeys. Legacy systems on older devices don’t support WebAuthn.</p><p>The practical risks matter. Losing your phone AND your cloud account password means losing access to your passkeys. Critical accounts need backup security keys stored in safe places. If cloud providers face outages, synced passkeys become temporarily unavailable, though local credentials still work.</p><p>Right now, passkeys create ecosystem lock-in: Apple’s sync only works across Apple devices, Google’s only with Google accounts, Microsoft’s only with Microsoft accounts. Password managers are adding cross-platform passkey support to solve this, and the FIDO Alliance is developing portability standards.</p><p>The biggest unsolved problem is account recovery. Passwords have email-based “Forgot Password” flows, but passkeys can’t safely offer that without undermining security. Current solutions include keeping a hardware backup key offline, storing recovery codes securely, delegating recovery to trusted contacts, or identity verification with customer support. It’s not ideal, and this remains an active research area.</p><p><strong>The Future</strong></p><p>Short-term (next 2–3 years), most major websites will support passkeys, password managers will fully integrate passkey storage, and autofill for passkeys will become standard. Enterprises will adopt FIDO2 as their workforce standard. User education will improve dramatically.</p><p>Looking further ahead, passkey portability will improve with standardized export/import. Password managers will become the neutral storage option. Post-quantum cryptography will be prioritized as quantum resistance becomes critical. Biometric methods will advance. Continuous authentication will replace simple login verification.</p><p>The long-term vision is straightforward: passwords become obsolete. In a decade, explaining that “we used to memorize hundreds of complex secret strings” will sound as quaint as manual phone dialing. Authentication will be invisible, continuous, and secure by default. The passwordless future isn’t coming — it’s already here.</p><p>Link to previous parts</p><ul><li>What the Auth — <a href="https://medium.com/@abhiknowswhy/what-the-auth-3839c2e5b906"><strong>Part 1</strong></a></li><li>What the Auth — <a href="https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023?postPublishedType=repub"><strong>Part 2</strong></a></li><li>What the Auth — <a href="https://medium.com/p/6b364a001419/edit"><strong>Part 3</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21e46d16e3b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cache it!]]></title>
            <link>https://medium.com/@abhiknowswhy/cache-it-72429ae73a91?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/72429ae73a91</guid>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[high-level-design]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 18:59:05 GMT</pubDate>
            <atom:updated>2025-11-01T18:59:05.173Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1 of 2 part series</h4><h4>A Developer’s Guide to Faster Applications using Cache</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*Nlv859FzGEb-xYsjO0W-9Q.jpeg" /><figcaption>Ever wondered why some apps feel lightning-fast while others make you tap your fingers waiting? The secret often lies in one word: <strong>Caching</strong>.</figcaption></figure><h3><strong>What is a cache?</strong></h3><p>Think of a <strong>Data store</strong> (like databases or file systems) as your home’s main storage — where everything lives permanently. A <strong>cache</strong>, on the other hand, is like keeping your most-used items on your desk instead of walking to the storage room every time you need them. It’s temporary, fast, and designed to make life easier. By storing frequently accessed data closer to where it’s needed, you can:</p><ul><li>Serve users faster</li><li>Reduce database load</li><li>Cut infrastructure costs</li><li>Handle more traffic with the same resources</li></ul><h4><strong>A Quick Trip Through </strong>History of <strong>Caching</strong></h4><p>Caching isn’t new — it’s been making our digital lives better for decades:</p><ul><li><strong>1960s</strong>: CPU caches (L1, L2, L3) were born, helping processors avoid the slow journey to main memory for frequently needed data.</li><li><strong>1990s</strong>: The internet boom brought web caching. Browsers and proxies started saving pages and resources to speed up your browsing.</li><li><strong>2000s</strong>: Modern solutions like Redis, Memcached, and distributed cache systems have become the backbone of scalable applications and cloud architectures.</li><li><strong>Present</strong>: Redis popularized RESP (Redis Serialization Protocol), leading to an ecosystem of compatible alternatives like <strong>KeyDB</strong> (a fork focused on multithreading and performance) and <strong>Valkey </strong>(an open-source project backed by Google and Amazon, using RDMA for ultra-low latency). There are other caches built from the ground up as well like <strong>Garnet</strong>, built in C# by Microsoft, and <strong>DragonflyDB</strong>, designed for vertical scaling and memory efficiency.</li></ul><h4><strong>Real-World Use Cases of cache</strong></h4><ol><li><strong>Web Applications</strong>: Cache API responses or database queries to slash response times</li><li><strong>CDNs</strong>: Store images and assets closer to users worldwide</li><li><strong>Database Query Results</strong>: Save expensive computations for instant reuse</li><li><strong>User Sessions</strong>: Keep session data in memory for seamless experiences</li></ol><h3><strong>Designing systems with Cache</strong></h3><h4>Read Strategies</h4><ul><li><strong>Cache-Aside (Lazy Loading):</strong> Application checks cache first. On cache miss, fetches from database, writes to cache, then returns data. Simple to implement and only caches what’s actually accessed, but requires multiple round trips on cache misses. Use it when application code should control cache logic.</li><li><strong>Read-Through</strong>: Cache automatically handles database reads. On cache miss, the cache itself fetches from database, stores it, and returns data. Simplifies application code since it’s unaware of cache misses, but increases cache layer complexity. Use it for read-heavy applications like CDNs or social media feeds.</li><li><strong>Refresh-Ahead</strong>: Proactively refreshes frequently accessed data before it expires. Keeps hot data always fresh and eliminates cache miss latency for popular items, but adds overhead for tracking and predicting which data to refresh. Use it when you can predict access patterns and need consistently low latency.</li></ul><figure><img alt="Different Strategies for Cache Read" src="https://cdn-images-1.medium.com/max/1024/1*USW0-ENY7hGYZwgJRYigrQ.png" /><figcaption>Different Strategies for Cache Read</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65b8a1acc8444711e313b7d092f01a4e/href">https://medium.com/media/65b8a1acc8444711e313b7d092f01a4e/href</a></iframe><h4><strong>Write Strategies</strong></h4><ul><li><strong>Write-Through</strong>: Write to cache and database simultaneously. This is safe because it ensures data consistency between the two and data is persisted in the database, but slower because it waits for both operations to complete. Use it for critical data where consistency is key and write latency is not a concern.</li><li><strong>Write-Behind</strong>: Write to cache first, sync to database later. This is fast but riskier because if the cache fails before syncing, data can be lost. Use this when write performance is critical and occasional data loss is acceptable.</li><li><strong>Write-Around</strong>: Skip the cache, write directly to database. You write to cache during reads, if some data is not present in the cache — you query the DB, and parallelly return the response and write to cache. This is useful for scenarios where data is usually not read immediately.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--zgqU3yqkVRpARFKGck_w.png" /><figcaption>Different Strategies for Cache Write</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a142d17ac48f15e2694f328236db53df/href">https://medium.com/media/a142d17ac48f15e2694f328236db53df/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXn0hwIlbb_BUulzdlSK2w.png" /><figcaption>Choose Cache Read-Write Strategies</figcaption></figure><h4><strong>The Space Problem: Cache Eviction Policies</strong></h4><p>Caches can’t grow forever. When they’re full, something has to go out. Also, it is not desirable for Cache to return outdated data because invalidation logic is missing or incorrect. Users see old prices, deleted content, or incorrect inventory counts. <br>We can choose what data can be let go with the help of cache eviction policies. Here are the most popular cache eviction policies:</p><ul><li><strong>Least Recently Used (LRU): </strong>The crowd favorite. If you haven’t used it in a while, out it goes. Perfect for most workloads and used everywhere from Redis to CPU caches.</li><li><strong>Time to Live (TTL): </strong>Set an expiration date. When time’s up, the data disappears. Essential for keeping things fresh in CDNs, DNS, and HTTP caching.</li><li><strong>Least Frequently Used (LFU): </strong>Track how often items are accessed. The unpopular kids get evicted first. Great when access patterns are predictable.</li><li><strong>First In, First Out (FIFO): </strong>Simple queue logic: oldest entry goes first. Less sophisticated than LRU but easier to implement.</li></ul><p>There are also some other well known options like Random Replacement, Adaptive Replacement Cache (ARC), and Segmented LRU (SLRU).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3rosWZ1UT2pA4g_RZTKfw.png" /><figcaption>Choosing the right Cache Eviction policy</figcaption></figure><h4><strong>The Challenges: What Could Go Wrong?</strong></h4><p>Caching isn’t all sunshine and rainbows. Given cache is an in-memory data storage system, which means your cache is hosted on a VM in the cloud. So there is always a chance of failure and we need to design our system to be resilient to such failures. Here are some popular problems that can occur and how we solve them:</p><ul><li><strong>Cache Stampede/Thundering Herd</strong>: Multiple requests simultaneously hit a cold cache or rush to regenerate expired data. This can also be considered as a <strong>Cascading Failure, </strong>where One cache node failure can overload neighboring nodes, causing a domino effect<br><em>Solution: Use </em><strong><em>mutex locks</em></strong><em> (ensure only one request regenerates the data while others wait) or </em><strong><em>probabilistic early expiration</em></strong><em> (randomly refresh cache before it expires), use </em><strong><em>exponential backoff </em></strong><em>(retries after 1s, 2s, 4s,…) and </em><strong><em>jitter </em></strong><em>(random delay added to prevent synchronized retries) for requests hitting the service so that the database is not overloaded.</em><br><em>Implement circuit breakers, use </em><a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/bulkhead"><strong><em>bulkheads</em></strong></a><em> to isolate failures, and maintain </em><strong><em>spare capacity</em></strong><em> for failover scenarios.</em></li><li><strong>Cache Avalanche</strong>: Multiple keys expire simultaneously, overwhelming the database with requests at the same time. <br><em>Solution: Add random </em><strong><em>jitter </em></strong><em>to TTL values.</em></li><li><strong>Cold Start Problem:</strong> When a cache server restarts or a new server is added, it starts empty, leading to a flood of requests to the database. <em>Solution: </em><strong><em>Pre-warm </em></strong><em>the cache with frequently accessed data, use cache priming strategies, or gradually shift traffic to new nodes.</em></li><li><strong>Cache Invalidation</strong>: Keeping cache in sync with the source of truth — one of the hardest problems in computer science. <br><em>Solution: No one size fits all solution exists — you can use TTL, event-driven invalidation, or write-through pattern.</em></li><li><strong>Data Sharding Issues</strong>: As data is distributed across nodes (sharding), resharding when adding/removing nodes causes massive data movement.<br><em>Solution: Use </em><strong><em>consistent hashing</em></strong><em> to minimize key redistribution, implement gradual resharding, or use virtual nodes.</em></li></ul><h4><strong>Security considerations While using Cache:</strong></h4><p>Cache is fast, but it’s also ephemeral and often less secured than your primary database. When in doubt, don’t cache sensitive data. Here’s how to cache safely without compromising your application’s security posture.</p><ul><li><strong>Encryption &amp; Access Control: <br></strong>Encrypt sensitive data before caching (even if Redis/Memcached has encryption). Enable Redis AUTH/ACL with password protection. Use TLS/SSL for connections. Keep cache isolated (VPCs, firewalls — never public-facing)</li><li><strong>TTLs &amp; Keys: </strong>Short TTLs for sensitive data (sessions: 15–30 min, auth: 5–10 min). Use hashed identifiers in cache keys. Invalidate cache on logout or password change.</li><li><strong>Data Handling: </strong>Validate and sanitize all data before caching. Test GDPR deletion workflows. Monitor unusual access patterns. Quarterly security audits of cached data</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6979fd63da4169d96e7dc3d31a244e22/href">https://medium.com/media/6979fd63da4169d96e7dc3d31a244e22/href</a></iframe><h4>Cost Analysis of using Cache</h4><p>Caching is a costly, so it’s not always the right solution. “Let’s cache everything and make it faster!” This leads to bloated cache, low hit rates, and wasted memory on rarely-accessed data. The following flowchart can help you decide whether to use cache:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMYrUTmkDvYt0mM-ZCLkug.png" /><figcaption>Flowchart to decide if you need Cache</figcaption></figure><p>Here are some popular scenarios where using caching is beneficial:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5473d16b971bdc048d12b61a299ebb8/href">https://medium.com/media/d5473d16b971bdc048d12b61a299ebb8/href</a></iframe><p><strong>The Bottom Line</strong></p><p>Caching is one of the most powerful tools in your performance optimization toolkit. Master it, and you’ll build faster, more scalable applications that keep users happy and infrastructure costs down.</p><p>Start simple with TTL-based caching, graduate to LRU when you need sophistication, and always monitor your cache hit rates. Your users (and your database) will thank you.</p><p>In the next blog, we will learn about Redis and it’s uses</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72429ae73a91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What The Auth? (Pt.3)]]></title>
            <link>https://medium.com/@abhiknowswhy/what-the-auth-6b364a001419?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b364a001419</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 16:14:01 GMT</pubDate>
            <atom:updated>2026-01-22T09:34:25.307Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 3 of 4 part series</h4><h4>From OAuth1.0 to OAuth2.0 — how Auth evolved for the Mobile first world</h4><p>In the previous <a href="https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023"><strong>blog</strong></a><strong> </strong>we discussed about the origins of secure delegated Auth. In this blog, we will understand how OAuth1.0 evolved into OAuth2.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*XEzE8y_Xg0gXv2KVP7K6HA.png" /></figure><p><strong>OAuth 2.0</strong> arrived in 2012 as a complete redesign based on five years of OAuth 1.0 experience. It revolutionized authentication by solving the fundamental problem: <strong>How do you grant limited access without sharing passwords AND make it simple enough for developers to implement correctly?</strong></p><p>OAuth 2.0 introduced multiple grant types (flows) for different use cases — Authorization code, Implicit, Client credentials flows. The most secure and commonly used is the <strong>Authorization Code Flow</strong>, used by web applications. Let’s understand OAuth2.0 with a flow where Spotify can access your Google account data:</p><ol><li><strong>Authorization Request</strong>: Spotify redirects you to the authorization server (e.g., Google, Facebook) with parameters including client_id, redirect_uri, scope (what permissions it needs), and state (a random value for security)</li><li><strong>User Consent:</strong> You log in to the authorization server and see “Spotify wants to access your profile and email. Allow?” You click “Authorize”</li><li><strong>Authorization Code</strong>: Google’s Authorization server (Apigee) redirects back to Spotify with an authorization code (short-lived, one-time use code) and the state parameter.</li><li><strong>Token Exchange</strong>: Spotify’s backend server exchanges the authorization code for an access token by making a server-to-server call with the code, client_id, and client_secret.</li><li><strong>Access Token</strong>: The authorization server validates the request and returns an access token (and optionally a refresh token)</li><li><strong>Access Resources</strong>: Spotify uses the access token to make API calls to access your protected resources</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i43FdAq2M0E2BGjOK4myvQ.png" /><figcaption>OAuth2.0 — Authorization Code flow</figcaption></figure><h4>Changes in OAuth 2.0:</h4><ul><li><strong>No more cryptographic signatures</strong>: Instead of signing every request, OAuth 2.0 relies on HTTPS/TLS for transport security. Access tokens are bearer tokens — if you have the token, you can use it. This is simpler but requires HTTPS everywhere.</li><li><strong>Mobile-first design</strong>: Introduced multiple “flows” (authorization code, implicit, client credentials) designed for different scenarios — web apps, mobile apps, server-to-server communication. Introduction of <strong>front-channel and back-channel </strong>requests. User is not involved during communication between Client and Auth server (hence back-channel).</li><li><strong>Shorter-lived tokens</strong>: Access tokens expire quickly (often in an hour), with refresh tokens allowing apps to get new access tokens without bothering the user again.</li><li><strong>Better error handling</strong>: Standardized error codes and responses made debugging exponentially easier.</li></ul><p>From the flow, you may ask — How does the 3P app get and exercise these permissions, i.e. how does google grant these permissions to a 3P app like Duolingo?</p><p>When Duolingo first started supporting “Connect with Google,” its developers had to register their app with Google in the <a href="https://docs.cloud.google.com/apigee/docs/api-platform/security/registering-client-apps"><strong><em>Google Cloud Console</em></strong></a>. Google generates a Client ID (a GUID) and a Client Secret (a private key). The app specifies <strong>Redirect URIs</strong> (where Google should send the user + token after login). In the redirection step, Duolingo sends the Client ID, Request scopes (profile, email, etc.) and the Redirect URI to Google OAuth2.0 Authorization endpoint — this is the <strong>Front-Channel call. </strong>After approval from user, the google redirects back to Duolingo’s redirect URL with a short-lived Authorization code and initiates the <strong>Back-Channel call</strong> (the user is not involved — only Duolingo and Google are involved — another improvement over OAuth1.0). Client ID registration helps prevent <strong>Spoofing (</strong>i.e. attacker trying to pretend to be Duolingo), it lets google <strong>apply policies </strong>for scopes allowed, and ensures <strong>verified Redirect URIs </strong>are used.</p><h3>Problems:</h3><h4>Cross-Site Request Forgery attack (CSRF)</h4><p>What if an attacker mimics the master account provider and sends a malicious authorization code to the 3P app (the attacker wants the 3P app to accept and exchange that forged code, so the 3P app links to an attacker’s account instead of the user account, so 3P app consumes or writes data to attacker’s account instead of user’s master account)</p><ul><li>To solve this problem, OAuth2.0 uses <strong>State</strong>.<br>State is a randomly generated string by the 3P app that is sent along with redirect URL to master account provider. The master account provider must return a redirect response to 3P app with the authorization code and the same state sent to it before, otherwise the 3P app won’t use the authorization code.</li></ul><p>What if the attacker compromised the client, steals the authorization code, and uses it like a mimic the function of 3p app (to gain and misuse the permissions approved by the user)</p><ul><li>To solve this problem, use <strong>PKCE (Proof Key for Code Exchange)</strong><br>The 3P app sends a problem (an encrypted code) in the front channel call. This code can only be decrypted by a key which is with 3P app, and this code is sent during the back channel call.</li></ul><p>Note:</p><ul><li>OAuth 2.0 previously had an “<strong>implicit flow</strong>” where the validation token was directly sent to the device for native apps. This was deprecated in 2.1 because it was susceptible to token interception in shared environments.</li><li>OAuth 2.0 also provides a <strong>“client credentials flow”</strong> for validating scopes of the client applications. There is no user involved here. This is used in the settings of Microservices APIs.</li></ul><h3><strong>OpenID Connect</strong></h3><p>Here’s where things get subtle but important. OAuth 2.0 is fantastic for <strong>authorization</strong> (granting permissions), but it wasn’t designed for <strong>authentication</strong> (proving who you are). Think about it: an access token tells you what someone can do, but not necessarily who they are. Anyone with a valid token can use it — there’s no built-in identity verification. In the early days of social login, developers had to hack around this limitation. They’d use OAuth to get permission to access a user’s profile, then make an API call to figure out who the user was. Every platform did this differently.</p><p><strong>OpenID Connect (OIDC)</strong> solved this by adding a standardized identity layer on top of OAuth 2.0. It introduced the <strong>ID token</strong> — a secure, standardized way to say “this person is authenticated.”</p><p>An ID token contains three parts:</p><ul><li><strong>Header</strong>: Technical information about how the token is encoded</li><li><strong>Claims</strong>: The actual user information (name, email, etc.)</li><li><strong>Signature</strong>: Cryptographic proof that the token is legitimate and hasn’t been tampered with</li></ul><p>The beautiful thing about OpenID Connect is that it gives you both authentication AND authorization in one flow. You get an ID token that tells you who the user is, plus access tokens that let you perform actions on their behalf.</p><h3><strong>The Modern Landscape: Two Worlds Converging</strong></h3><p>Today’s authentication ecosystem has evolved into two main branches:</p><p><strong>Enterprise Identity Management</strong>: Traditional enterprise solutions like Active Directory evolved into cloud-first platforms like Azure AD (now Microsoft Entra), Okta, and JumpCloud. These provide comprehensive identity governance, multi-factor authentication, and lifecycle management for organizations.</p><p><strong>Consumer Identity Providers</strong>: Social login evolved from OAuth 1.0 to the robust OAuth 2.0 + OpenID Connect ecosystem we use today. Think Google Sign-In, Facebook Login, Apple Sign-In, and GitHub authentication.</p><p>Interestingly, these two worlds are converging. Enterprise platforms now support consumer identity providers, and consumer platforms offer enterprise-grade features. The result? A more unified, secure, and user-friendly authentication experience.</p><h3><strong>What’s Next?</strong></h3><p>We’ve come incredibly far from the days of remembering dozens of passwords. Today’s authentication systems are more secure, more user-friendly, and more developer-friendly than ever before.</p><p>But the story isn’t over. We’re seeing new innovations like:</p><ul><li><strong>Passwordless authentication</strong> with WebAuthn and FIDO2 (<strong>Fast IDentity Online</strong>)</li><li><strong>Decentralized identity</strong> with blockchain and self-sovereign identity</li><li><strong>Zero-trust architecture</strong> that never assumes trust, always verifies</li><li><strong>AI-powered fraud detection</strong> that can spot suspicious login patterns in real-time</li></ul><p>The evolution continues, but the foundation we’ve built with OAuth 2.0 and OpenID Connect remains solid. It’s a testament to good engineering: solving real problems with elegant, extensible solutions that stand the test of time.</p><p>If you haven’t alread, do check out my previous blogs:</p><ul><li><a href="https://medium.com/@abhiknowswhy/what-the-auth-3839c2e5b906"><strong>What The Auth — Part 1</strong></a></li><li><a href="https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023"><strong>What The Auth — Part 2</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b364a001419" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What The Auth? (Pt.2)]]></title>
            <link>https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb7147c03023</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 16:13:07 GMT</pubDate>
            <atom:updated>2026-01-22T09:43:05.429Z</atom:updated>
            <content:encoded><![CDATA[<h4>PART 2 OF 4 PART SERIES</h4><h4><em>From Enterprise SSO to OAuth 1.0: How the internet solved delegated authentication</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*kft4GG_PPmVRgEQ5egwe8Q.jpeg" /></figure><p>In <a href="https://medium.com/@abhiknowswhy/what-the-auth-3839c2e5b906"><strong>Part 1</strong></a>, we explored the foundations of authentication — from simple cookie-based sessions to password hashing and salting. We saw how these solutions worked well for individual websites, but the web was facing four critical limitations:</p><ol><li>Users couldn’t delegate limited access without sharing full credentials</li><li>Every app had to build authentication from scratch</li><li>Mobile and cloud apps needed solutions that went beyond cookies</li><li>There was no way to grant “read-only” or “write-only” permissions</li></ol><p>The internet needed a fundamental shift in how authentication worked. This is the story of how we got there.</p><h3><strong>The Enterprise Solution — Single Sign-On (SSO)</strong></h3><p>The enterprise world had already solved part of this problem. <strong>Single Sign-On (SSO)</strong> allowed employees to log into multiple company applications using one master account — typically their Active Directory credentials. Systems like <strong>Microsoft Active Directory </strong>(the precursor to Azure Active Directory)<strong> </strong>became the de facto standard for Windows networks, while <strong>Samba</strong> brought AD compatibility to Linux/Unix environments.</p><p>Under the hood, these relied on protocols like <strong>LDAP</strong> (Lightweight Directory Access Protocol for querying directory services) and <strong>Kerberos</strong> (for ticket-based authentication — prove your identity once, get a ticket, use it everywhere). SSO used technologies like <strong>SAML</strong> (Security Assertion Markup Language) to securely share authentication between applications within an organization. You login once, and you can access your authorized resources for a day (or a configured max-time). It was perfect for the Web 1.0 world of desktop applications and corporate networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDQ974T7RYNZaifaFt-PfQ.png" /><figcaption>Active Directory Authentication in Web1.0</figcaption></figure><h4><strong>The Mobile Revolution</strong></h4><p>Traditional SSO model was built for a world where applications were hosted on corporate networks. It relied on a central identity provider (like Active Directory) to authenticate users and manage their permissions. However, this approach faced several challenges in the Web 2.0 era because it had to be available on a <strong>Decentralized system</strong>, work with Servers on <strong>different Domains </strong>(Your Company Email server could share a domain with HR portal, but Amazon doesn’t share a domain with Youtube) and different types of devices (Mobile and Edge devices — like your Alexa Speakers or Smart Watches too)</p><p>Cookies became inadequate as well, they weren’t ideal for mobile applications where users expected to stay logged in even after closing the app. Now, these were the requirements for the new world:</p><ol><li>We needed an “<strong>Active Directory for the internet</strong>” — something that worked for consumer apps, not just enterprise software</li><li>Apps needed to work seamlessly across different domains and platforms — “<strong>Cross-domain authentication”</strong></li></ol><h3>OAuth — the internet’s Active Directory</h3><p>In the early days of social login, apps would ask for your Facebook or Google password directly. Imagine giving your house key to every delivery person who needed to drop something off — it was a security Nightmare! OAuth 1 solved this by letting apps access your data <strong>without ever seeing your password</strong>.</p><p>In 2006, <a href="https://en.wikipedia.org/wiki/Blaine_Cook_(programmer)"><strong>Blaine Cook</strong></a>, then a developer at Twitter, faced the same problem: third-party apps wanted access to user accounts. Cook began collaborating with others — including Chris Messina and developers from Google, Yahoo, and Ma.gnolia — to design a simple, open standard for delegated access. That idea became OAuth (short for Open Authorization) and it worked like a digital Valet. If you wanted a new app to read your tweets, Twitter could issue that app a <em>token</em> instead of your credentials.</p><p>Here is a brief on how OAuth1.0 works with an example of TweetDeck which is an app request user’s Twitter (X) data.</p><ol><li><strong>Request Token: </strong>TweetDeck asks Twitter for a temporary “request token” — which is signed using TweetDeck’s consumer key and secret (credentials Twitter gave TweetDeck when it registered as a developer app) Twitter validates the signature and returns a temporary request token</li><li><strong>User Authorization: </strong>TweetDeck redirects you to Twitter’s website with the request token. You see Twitter’s authorization page: “TweetDeck wants to access your account. Allow?” You log into Twitter (if not already) and click “Authorize”. Twitter links the request token with your account and marks it as “authorized”</li><li><strong>Exchange for Access Token: </strong>Twitter redirects you back to TweetDeck with the now-authorized request token. TweetDeck exchanges this request token for an <strong>access token</strong> (and its associated secret) This access token is what TweetDeck will use for all future API calls</li><li><strong>Access Protected Resources: </strong>TweetDeck can now make API calls to Twitter on your behalf. Every single request must be cryptographically signed using the access token secret. No passwords involved — just tokens that can be revoked anytime</li></ol><figure><img alt="OAuth 1.0 flow" src="https://cdn-images-1.medium.com/max/1024/1*02MooB7WOhXr9rx44VK69A.png" /><figcaption>OAuth 1.0 Flow</figcaption></figure><h4>Signing Why and How?</h4><p>OAuth 1.0 was designed in 2007, when HTTPS wasn’t universally adopted. Plain HTTP traffic could be intercepted and modified by attackers. This is where OAuth 1.0 gets complex but powerful. Every API request must be <strong>digitally signed</strong>.</p><p>A signature is very similar to fingerprinting or checksums — but here it’s used for validating sender identity, and not payload integrity. To create a sign, TweetDeck would hash the payload (using an algorithm like HMAC-SHA1) using the key provided to it by twitter, and attach the output as a request header. Then, when Twitter receives the request, it would also perform the same hashing algorithm and compare it with the signature in the request header, the request was valid only if there is a match. <br>(Food for thought — don’t you think its unnecessarily complicated to hash the whole payload for validation?)</p><p>Signing solved three critical security problems: <strong>Man-in-the-Middle Attacks </strong>(Attacker tampers request— but when server side signature validation fails) <strong>Replay Attacks</strong> (Attacker captures a valid request and sends it multiple times — timestamps and nonces prevent this), <strong>Impersonation (</strong>Attacker could steal an access token and use it — but without the token secret, they can’t create valid signatures), hence OAuth made delegation of access safe and tamper proof.</p><h4>Problems with OAuth 1.0</h4><p>As the OAuth 1.0 framework was based on HTTP — it was always possible for an attacker to steal data if not impresonate or create attacks. So, the world moved to HTTPS for safer communication. This also made the signature checks unnecessarily complex for the purpose of just verifying identity.</p><ul><li><strong>Performance implication</strong>: For mobile devices with low power requirements, the advent of compute heavy hashing algorithms (like SHA256) was a huge performance implication and it was no longer feasible to use OAuth 1.0 — Generating signatures for every request added computational cost. Another problem with Mobile apps running on user devices is that “secrets” can’t be kept secret (anyone can reverse engineer an app) Also, for every request there was a three way communication, even for S2S communication — user was involved always — which is not good for performance.</li><li><strong>No support for Authentication</strong>: OAuth was also not adequate for handling Authentication, as it was designed solely for Authorization. OAuth 1.0’s specification only defined <em>how to get permission</em> to access resources, but not <em>how to get user information</em>. Each company implemented their own way with Different endpoints, different response formats, different field names.</li></ul><p>Despite these challenges, OAuth 1.0 was revolutionary. Twitter’s API adoption exploded, and major platforms like Netflix, LinkedIn, Google, and Yahoo adopted it. It proved that delegated authorization without password sharing was possible — it just needed to be simpler. The lessons learned from OAuth 1.0’s successes and failures would directly inform the design of OAuth 2.0.</p><p>Continue reading: What the Auth? — <a href="https://medium.com/@abhiknowswhy/what-the-auth-6b364a001419"><strong>Part 3</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb7147c03023" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What The Auth?]]></title>
            <link>https://medium.com/@abhiknowswhy/what-the-auth-3839c2e5b906?source=rss-cc3b6ccce261------2</link>
            <guid isPermaLink="false">https://medium.com/p/3839c2e5b906</guid>
            <category><![CDATA[computer-science-theory]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Guna Abhiram Bondada]]></dc:creator>
            <pubDate>Fri, 24 Oct 2025 18:19:38 GMT</pubDate>
            <atom:updated>2026-01-22T09:34:49.786Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1 of 4 part series</h4><h4>This is the wild journey from “password123” to “Sign in with Google” — and why you should care!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zc3JPRZ_2YFCoJcIrqYBng.jpeg" /><figcaption>Image from <a href="https://www.hurix.com/blogs/what-organizations-need-to-know-about-cyber-security/">hurix.com</a></figcaption></figure><p>Seriously, what IS all this auth stuff? If you’ve ever wondered why clicking “Sign in with Google” is so much easier than creating yet another account with yet another password you’ll definitely forget, you’re in the right place.</p><p>Let’s be honest: authentication used to be a nightmare. Remember having 47 different passwords for 47 different websites? (Okay, let’s be real — it was probably the same password everywhere, which was… not great for security.) But somehow, we went from that chaos to the smooth, seamless login experience we have today. How did we get here? Buckle up — this is the story of how the internet solved one of its most annoying problems.</p><h3>The Foundation: Understanding Auth</h3><p>Before we dive into the journey, let’s clarify two terms that are often confused:</p><ul><li><strong>Authentication</strong>: Verifying who you are (“Show me your ID”)</li><li><strong>Authorization</strong>: Determining what you’re allowed to do (“Here’s what you can access”)</li></ul><p>Think of it like entering a secure building. Authentication is showing your badge at the front desk, and authorization is which floors and rooms your badge can access. Now, let’s explore how we went from simple password-based authentication to the sophisticated systems we use today.</p><h3>The Simple Days — Cookie-Based Authentication</h3><p>The process was refreshingly simple:</p><ol><li><strong>Sign up</strong>: You provide an email and password to a website.</li><li><strong>Storage</strong>: The website stores these credentials in their database.</li><li><strong>Login</strong>: Each time you visit, you enter your credentials, and the server verifies them.</li><li><strong>Session creation</strong>: After successful login, the backend creates a session and packages the session details into a “<em>cookie”</em>, the server saves a copy and sends one to the client.</li><li><strong>Authentication</strong>: This cookie gets stored in your browser and is sent with every subsequent request to prove who you are</li></ol><h3>What exactly is a cookie?</h3><p>Cookies were invented in 1994 by Lou Montulli, a Netscape programmer, as a way to remember user information between page loads. The first use case was to enable shopping carts on e-commerce sites, allowing users to add items to their cart without losing them when navigating between pages. Later on, cookies became the standard way to manage sessions and authentication on the web.</p><figure><img alt="Programmer humor: In the movie The Matrix, the Oracle (a program which was designed to help Neo on his journey) gives him a cookie, which symbolizes the way websites give your browser cookies to help you navigate their services." src="https://cdn-images-1.medium.com/max/800/1*LGOS6EzA8orl466Ue1wi9g.jpeg" /><figcaption><strong>Programmer humor:</strong> In the movie <em>The Matrix</em>, the Oracle (a program designed to help Neo on his journey) gives him a cookie, which symbolizes the way websites give your browser cookies to help you navigate their services.</figcaption></figure><p>Think of a cookie as a small digital receipt that the website gives your browser. It contains session information and gets automatically included with every request you make to that website. It’s like having a wristband at an event — once you have it, you don’t need to show your ticket again.</p><p>A sample cookie might look like this:</p><pre>{<br> &quot;user_id&quot;: &quot;user789&quot;, // unique user identifier<br> &quot;session_id&quot;: &quot;abc123xyz456&quot;, // unique session identifier<br> &quot;expires&quot;: &quot;2024–12–31T23:59:59Z&quot;, // expiration time - token is invalid after this time<br> &quot;nbf&quot;: &quot;2024–01–01T00:00:00Z&quot;, // not before - token is activate after this time<br> &quot;iat&quot;: &quot;2024–01–01T00:00:00Z&quot;, // issued at - token is created at this time<br> &quot;httpOnly&quot;: true // prevents JavaScript access for security<br>}</pre><p>Cookies can be configured to expire after inactivity. Most modern applications store these sessions in fast cache stores like Redis with automatic time-to-live (TTL) settings, so inactive sessions get cleaned up automatically. To further improve this, modern applications often use <strong>JWTs (JSON Web Tokens)</strong> as cookies, so they don’t need to store a server-side copy. JWTs are self-contained tokens that include all the necessary information about the user and session, signed to prevent tampering.</p><p>A JWT (JSON Web Token) has 3 parts:</p><ol><li><strong>Header </strong>— metadata about the algorithm and type</li><li><strong>Payload</strong> — the claims (user info, expiry, etc.)</li><li><strong>Signature</strong> — ensures integrity and authenticity</li></ol><p>Here’s how those parts might look before base64 encoding:</p><pre>Header:<br>{<br>  &quot;alg&quot;: &quot;HS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}<br><br>Payload:<br>{<br>  &quot;sub&quot;: &quot;1234567890&quot;,<br>  &quot;name&quot;: &quot;John Doe&quot;,<br>  &quot;role&quot;: &quot;admin&quot;,<br>  &quot;iat&quot;: 1735050230, // unix timestamp of issued at time<br>  &quot;exp&quot;: 1735053830, // unix timestamp of expiry time<br>  &quot;nbf&quot;: 1735053230<br>}<br><br>Signature:<br>HMACSHA256(<br>  base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload),<br>  &quot;a-string-secret-at-least-256-bits-long&quot;<br>)</pre><p>Each section is Base64URL-encoded and joined with dots (`.`):</p><pre>&lt;URLbase64(Header)&gt;.&lt;URLbase64(Payload)&gt;.&lt;URLbase64(Signature)&gt;<br>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNzM1MDUwMjMwLCJleHAiOjE3MzUwNTM4MzAsIm5iZiI6MTczNTA1MzIzMH0.GzK_n1tjJoKkTJXkmJuo-KRXwgyk2uyBqqveGyOR5wMWhen stored as a cookie (for HTTP requests):</pre><pre>Set-Cookie: jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNzM1MDUwMjMwLCJleHAiOjE3MzUwNTM4MzAsIm5iZiI6MTczNTA1MzIzMH0.GzK_n1tjJoKkTJXkmJuo-KRXwgyk2uyBqqveGyOR5wM; HttpOnly; Secure; SameSite=Strict; Path=/</pre><p>You can play around with JWTs using online tools like <a href="https://www.jwt.io/">https://jwt.io/</a> to see how they work in practice.</p><h3>But wait, there’s a problem</h3><p>What happens if someone breaks into the website’s database? In the early days, passwords were often stored in plain text. If hackers got access to the database, they’d have everyone’s passwords. Game over.</p><h4>The First Security Evolution: Password Hashing</h4><p>The solution was clever: instead of storing the actual password, websites started storing a <strong><em>hash </em></strong><em>of the password</em>. Hashing is a non-reversible process — think of it like a one-way blender — you can turn a password into hash, but you can’t reverse the process to get the password back from the hash. ()</p><p>Here’s how it works:</p><ol><li>When you create an account, the website hashes your password and stores only the hash</li><li>When you log in, they hash your input and compare it to the stored hash.</li><li>If the hashes match, you’re in!</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b01a7ae39c32c8be6606b16e12acb927/href">https://medium.com/media/b01a7ae39c32c8be6606b16e12acb927/href</a></iframe><p>Even if hackers steal the database, they only get meaningless hash values, not your actual passwords. And it’s computationally infeasible to guess your password based on the hash — remember, hashing is an irreversible process. (Why is that so? Read about <strong>Assymmetric Hashing algorithms</strong>.)</p><h4>But hackers got smarter too</h4><p>Enter R<strong>ainbow Table Attacks</strong>. Clever attackers started creating massive databases of common passwords and their corresponding hashes. They’d create fake accounts with popular passwords like “password123”, get the hashes, and then compare those against real user hashes in stolen databases.</p><p>If your password hash matched a hash in their rainbow table, they knew your password.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92b9cba8e67ebfccef38471965fa35d8/href">https://medium.com/media/92b9cba8e67ebfccef38471965fa35d8/href</a></iframe><p>This is the reason why strong passwords were recommended — to make rainbow table attacks harder, but the risk was still there!</p><h4>The Counter-Attack: Salt</h4><p>The security community fought back with <strong>salt</strong> — a random string added to each password before hashing. Now instead of hashing just “password123”, the system would hash “password123XyZ9mK” where “XyZ9mK” is a unique salt for that user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e49333d87d6228cb8a59a03e4987d3cc/href">https://medium.com/media/e49333d87d6228cb8a59a03e4987d3cc/href</a></iframe><p>Even if two users have the same password, their salts are different, so their hashes are completely different. Rainbow tables become useless because attackers would need separate tables for every possible salt combination — which makes it practically impossible to attack.</p><h3>The Growing Pains of Simple Authentication</h3><p>While hashing and salting solved the password storage problem, the web was evolving rapidly, and simple authentication started showing its age:</p><p><strong>The User Experience Problem</strong>: People had to remember dozens of different passwords for different websites. Password managers weren’t mainstream yet, so users resorted to reusing passwords (security nightmare) or forgetting them constantly.</p><p><strong>The Developer Burden</strong>: Every application had to build its own authentication system from scratch:</p><ul><li>Password reset mechanisms with email/SMS verification</li><li>Session management and security features</li><li>Compliance with privacy regulations like GDPR and HIPAA</li><li>Monitoring for suspicious login activities</li><li>Hosting and maintaining secure session storage</li></ul><p><strong>The Delegation Problem</strong>: What if you wanted to give a third-party app access to your account? You’d have to share your actual password — there was no way to grant limited, specific permissions.</p><p><strong>The All-or-Nothing Problem</strong>: When you did share access, it was complete access. No way to say “only read my email” or “only post to my timeline.”</p><p>The internet needed a better way.</p><h3>What’s Next?</h3><p>So far, we’ve established the foundation: simple password-based authentication with cookies solved the initial problem, but hashing and salting couldn’t keep up with evolving threats. More importantly, the web was facing four critical limitations:</p><ol><li>Users couldn’t delegate limited access without sharing full credentials</li><li>Every app had to build authentication from scratch</li><li>Mobile and cloud apps needed solutions that went beyond cookies</li><li>There was no way to grant “read-only” or “write-only” permissions</li></ol><p>These problems demanded a fundamental rethinking of authentication architecture.</p><p>In Part 2, we’ll examine exactly how this evolved:</p><ul><li><strong>Single Sign-On (SSO)</strong> — How the enterprise world solved centralized authentication with Active Directory and SAML</li><li><strong>The OAuth 2.0 Revolution </strong>— How delegated authentication finally solved the permission problem without sharing passwords</li><li><strong>OpenID Connect</strong> — How we added identity verification on top of OAuth’s authorization framework</li></ul><p>I’ll walk through the actual OAuth 2.0 flow step-by-step, understand why apps like Duolingo can safely ask for “<strong>Sign in with Google</strong>” access, and see how this became the foundation for modern social login.</p><p>Continue reading: What the Auth? — <a href="https://medium.com/@abhiknowswhy/what-the-auth-bb7147c03023"><strong>Part 2</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3839c2e5b906" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>