<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Om Bhamare</title>
    <description>The latest articles on DEV Community by Om Bhamare (@omrubiksdev).</description>
    <link>https://dev.to/omrubiksdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1654620%2Fe73228ee-b7eb-453d-87d7-44f3e9eab918.png</url>
      <title>DEV Community: Om Bhamare</title>
      <link>https://dev.to/omrubiksdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omrubiksdev"/>
    <language>en</language>
    <item>
      <title>Beyond the Password: How Passkeys Work Under the Hood</title>
      <dc:creator>Om Bhamare</dc:creator>
      <pubDate>Sat, 08 Aug 2026 03:17:21 +0000</pubDate>
      <link>https://dev.to/omrubiksdev/beyond-the-password-how-passkeys-work-under-the-hood-43j4</link>
      <guid>https://dev.to/omrubiksdev/beyond-the-password-how-passkeys-work-under-the-hood-43j4</guid>
      <description>&lt;p&gt;Passwords are broken. They get leaked in database breaches, reused across platforms, and phished through clever domain spoofs. While Multi-Factor Authentication (MFA) helps, standard SMS or OTP codes still leave major security gaps.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Passkeys&lt;/strong&gt;: a modern authentication standard built on top of WebAuthn and FIDO2 specifications designed to eliminate shared secrets entirely.&lt;/p&gt;

&lt;p&gt;Here is a dive into the underlying cryptography, architectural flow, and why passkeys are inherently phishing-proof.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Concept: Asymmetric Cryptography
&lt;/h2&gt;

&lt;p&gt;Traditional authentication relies on &lt;strong&gt;shared secrets&lt;/strong&gt;. Both you and the server know your password (or a hashed version of it). To verify who you are, you send that secret over the network.&lt;/p&gt;

&lt;p&gt;Passkeys replace shared secrets with &lt;strong&gt;asymmetric (public/private key) cryptography&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Key:&lt;/strong&gt; Generated locally on your device and stored inside a Hardware Security Module (like Apple's Secure Enclave, Android's Titan chip, or a YubiKey) or an end-to-end encrypted sync service (iCloud Keychain, 1Password, Google Password Manager). &lt;strong&gt;It never leaves your device unencrypted.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Key:&lt;/strong&gt; Registered with and stored by the website (the Relying Party). It is completely public and mathematically useless to an attacker on its own.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Architectural Breakdown: How It Works
&lt;/h2&gt;

&lt;p&gt;Passkey operations consist of two cryptographic phases: &lt;strong&gt;Registration&lt;/strong&gt; and &lt;strong&gt;Authentication&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 1: Registration (Generating the Keypair)
&lt;/h3&gt;

&lt;p&gt;When you create a passkey for a service (e.g., &lt;code&gt;app.example.com&lt;/code&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Challenge Request:&lt;/strong&gt; Your client initiates registration. The server generates a cryptographic &lt;code&gt;challenge&lt;/code&gt; (a high-entropy random string) and sends it back alongside origin metadata (&lt;code&gt;RP ID&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Verification:&lt;/strong&gt; Your browser hands this request to the OS/authenticator, which prompts for user verification—biometrics (Face ID/Touch ID/Windows Hello) or a hardware PIN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KeyPair Generation:&lt;/strong&gt; Once unlocked, the hardware generates a unique keypair bound exclusively to &lt;code&gt;app.example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Key Registration:&lt;/strong&gt; The private key is saved locally. The public key, along with an attestation signature, is returned to the server and stored in your user record.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------+                 +---------+                 +-------------------+
| Device |                 | Browser |                 | Server (RP)       |
+---+----+                 +----+----+                 +---------+---------+
    |                           |                                |
    |                           |&amp;lt;-- 1. Request Reg + Challenge -|
    |                           |                                |
    |-- 2. Biometric Unlock --&amp;gt;|                                |
    |-- 3. Gen Keypair -------&amp;gt;|                                |
    |                           |-- 4. Public Key + Signature --&amp;gt;|
    |                           |   (Stored in DB)               |

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Phase 2: Authentication (Challenge-Response)
&lt;/h3&gt;

&lt;p&gt;When you return to log in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication Request:&lt;/strong&gt; You provide your username. The server generates a new, time-bound random &lt;code&gt;challenge&lt;/code&gt; string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Matching:&lt;/strong&gt; The browser checks the requesting domain against the stored domain origin associated with the private key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Authorization:&lt;/strong&gt; The OS prompts for your biometric or PIN to consent to the operation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Digital Signing:&lt;/strong&gt; The authenticator uses your private key to digitally sign the server’s challenge along with contextual data (&lt;code&gt;authenticatorData&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server Verification:&lt;/strong&gt; The signature is sent to the server. The server uses your previously stored &lt;strong&gt;Public Key&lt;/strong&gt; to decrypt and verify the signature. If it matches, you are logged in.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Why Passkeys Beat Passwords and Standard MFA
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Threat&lt;/th&gt;
&lt;th&gt;Traditional Passwords&lt;/th&gt;
&lt;th&gt;Passkeys&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phishing / Lookalike Domains&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vulnerable (Users enter credentials on fake sites)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Immune&lt;/strong&gt; (Browser enforces &lt;code&gt;RP ID&lt;/code&gt; matching)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Server Data Breaches&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vulnerable (Hashes can be cracked)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Immune&lt;/strong&gt; (Public keys are useless to attackers)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Man-In-The-Middle (MitM)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vulnerable&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Immune&lt;/strong&gt; (Signed challenges prevent replay attacks)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Credential Stuffing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vulnerable&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Immune&lt;/strong&gt; (Keys are unique per site)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Secret Weapon: Origin Binding
&lt;/h2&gt;

&lt;p&gt;The single greatest architectural feature of WebAuthn is &lt;strong&gt;Origin Binding&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If an attacker sets up a perfect replica site at &lt;code&gt;examp1e.com&lt;/code&gt; and tricks you into logging in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The fake site forwards the challenge from the real server to your browser.&lt;/li&gt;
&lt;li&gt;Your browser evaluates the actual URL in the address bar (&lt;code&gt;examp1e.com&lt;/code&gt;) against the domain bound to your key (&lt;code&gt;example.com&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The browser refuses to sign the challenge.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because this check happens at the browser/OS layer, human error is removed from the security equation entirely.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Passkeys shift the burden of security from user memory to cryptographic verification. By combining hardware-backed asymmetric keys with origin-bound browser enforcement, passkeys make credential theft, phishing, and server-side breach vectors relics of the past.&lt;/p&gt;

</description>
      <category>cryptography</category>
      <category>security</category>
    </item>
  </channel>
</rss>
