<?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: Fayaz F</title>
    <description>The latest articles on DEV Community by Fayaz F (@fz_1357).</description>
    <link>https://dev.to/fz_1357</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3978540%2Fef87a4f9-15d7-4d18-a98a-85e2ae7495e5.jpg</url>
      <title>DEV Community: Fayaz F</title>
      <link>https://dev.to/fz_1357</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fz_1357"/>
    <language>en</language>
    <item>
      <title>I built a 3KB alternative to replace zxcvbn (389KB) without detection loss</title>
      <dc:creator>Fayaz F</dc:creator>
      <pubDate>Thu, 11 Jun 2026 03:52:25 +0000</pubDate>
      <link>https://dev.to/fz_1357/i-built-a-a-3kb-alternative-to-replace-zxcvbn-389kb-without-detection-loss-1j6o</link>
      <guid>https://dev.to/fz_1357/i-built-a-a-3kb-alternative-to-replace-zxcvbn-389kb-without-detection-loss-1j6o</guid>
      <description>&lt;p&gt;zxcvbn is the most widely used password strength estimator with 1M npm downloads a week. It's also 389KB gzipped and hasn't shipped a commit since 2017. Most sign-up forms are hauling that around just to block &lt;code&gt;password123&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Poor password UX is a real conversion problem. A strength meter that adds 389KB to your bundle delays page load — on mobile, measurably so. Users who hit a slow registration page don't wait. They leave. The irony is that most of that weight goes toward catching passwords nobody is actually using to register on your site.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/Fayazzzzz/passcore" rel="noopener noreferrer"&gt;passcore&lt;/a&gt; - 3.0KB gzipped and 98.4% detection rate on real breach data - same as zxcvbn, benchmarked against a deduped list of passwords pulled live from RockYou, Adobe, HIBP, and other major leak lists. &lt;/p&gt;

&lt;p&gt;zxcvbn takes ~9.7ms to load — it's parsing 389KB of dictionary into memory on every cold start. passcore loads in ~0.2ms. It evaluates a password in ~2,600 nanoseconds. For a registration form, it's effectively invisible — no jank, no layout shift, no contribution to your Core Web Vitals score. The strength meter shows up before the user finishes typing their first character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;passcore runs five detection layers on every password:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dictionary - All entries sourced directly from breach data, not a generic word list&lt;/li&gt;
&lt;li&gt;Keyboard patterns - &lt;code&gt;qwerty&lt;/code&gt; , &lt;code&gt;asdf&lt;/code&gt; , &lt;code&gt;1234&lt;/code&gt; , numpad walks&lt;/li&gt;
&lt;li&gt;Repeats - &lt;code&gt;aaaa&lt;/code&gt; , &lt;code&gt;ababab&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sequences - &lt;code&gt;abcdef&lt;/code&gt; , &lt;code&gt;123456&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;L33t speak - decodes &lt;code&gt;p@ssw0rd&lt;/code&gt; → &lt;code&gt;password&lt;/code&gt; , &lt;code&gt;m0nk3y&lt;/code&gt; → &lt;code&gt;monkey&lt;/code&gt; , then dictionary lookup&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The dictionary is small by design. Every entry was chosen because it appears in real breach data - not because it's a common English word. &lt;code&gt;Password1!&lt;/code&gt; is caught not by a 40k word list but by stripping the suffix and checking if the core word is in the breach list. It is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The scoring model:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;passcore returns a score from 0 to 4 - same scale as zxcvbn.&lt;/p&gt;

&lt;p&gt;The detection layers run first. A dictionary match, keyboard pattern, repeat, sequence, or l33t substitution scores 0 or 1 immediately - no further calculation. If none of those fire, scoring falls through to length and character variety: uppercase, lowercase, digits, symbols. A password that clears all five layers but is only 6 characters long still scores low.&lt;/p&gt;

&lt;p&gt;There's also a length floor, aligned with NIST SP 800-63B: passwords 20+ characters score at least 3, passwords 30+ characters score 4, regardless of character variety. A passphrase like &lt;code&gt;correct-horse-battery-staple&lt;/code&gt; is vastly harder to crack than &lt;code&gt;P@ss1&lt;/code&gt; - the scoring reflects that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The research:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Getting to 98.4% detection required more than a dictionary lookup. A few problems that came up during development:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Word+affix patterns:&lt;/em&gt; &lt;code&gt;Password1!&lt;/code&gt;, &lt;code&gt;Admin123&lt;/code&gt;, &lt;code&gt;Welcome1&lt;/code&gt; - extremely common in breach data, none of them are in any dictionary as-is. The fix was a &lt;code&gt;matchCommonRoot&lt;/code&gt; layer: strip leading and trailing non-alpha characters, check if what's left is a breach word. It is, every time, for this class of password.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;L33t speak with separators:&lt;/em&gt; &lt;code&gt;N0=Acc3ss&lt;/code&gt; decodes to &lt;code&gt;no=access&lt;/code&gt;. A naive l33t decoder finds no dictionary match and passes it. The fix was to split the decoded string on non-alpha characters and check each segment independently. &lt;code&gt;access&lt;/code&gt; is in the breach list. Caught.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Missing critical roots:&lt;/em&gt; Running against real breach lists exposed that &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;user&lt;/code&gt;, &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;pass&lt;/code&gt; weren't in the dictionary - meaning &lt;code&gt;Admin123&lt;/code&gt;, &lt;code&gt;test1234&lt;/code&gt;, &lt;code&gt;user2024&lt;/code&gt; all slipped through. Added those five. Caught.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Switching looks like this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// before&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;zxcvbn&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;zxcvbn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;score&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;zxcvbn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// after&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;passcore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;passcorelib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;score&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;passcore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One caveat: &lt;code&gt;result.feedback.warning&lt;/code&gt; becomes &lt;code&gt;result.warning&lt;/code&gt;, making it one level flatter.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;zxcvbn&lt;/th&gt;
&lt;th&gt;zxcvbn-ts&lt;/th&gt;
&lt;th&gt;passcore&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bundle (gzipped)&lt;/td&gt;
&lt;td&gt;389 KB&lt;/td&gt;
&lt;td&gt;855 KB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.0 KB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;77,578 ns/op&lt;/td&gt;
&lt;td&gt;839,991 ns/op&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2,622 ns/op&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Detection rate&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;98.4%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maintained&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The tradeoff:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The tradeoff is dictionary size: 329 entries vs 40k+. But the passwords responsible for most credential stuffing aren't obscure literary references - they're &lt;code&gt;Password1!&lt;/code&gt;, &lt;code&gt;baseball123&lt;/code&gt;, keyboard walks, and l33t variants of the top breach list. passcore catches those. &lt;/p&gt;

&lt;p&gt;So that's the bet passcore makes: that 329 targeted entries catch more of what actually matters than 40,000 words that cover everything, including passwords no one uses and/or no attacker is trying. The benchmark agrees — 98.4% detection rate across 370 real breach passwords, same as zxcvbn, at 130x less weight. For the 1% that need exhaustive coverage, use zxcvbn.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — zxcvbn is 389KB and abandoned. passcore is 3KB, same detection rate, actively maintained. If bundle size matters to you, it's a near drop-in swap.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Fayazzzzz/passcore" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; · &lt;a href="https://www.npmjs.com/package/passcorelib" rel="noopener noreferrer"&gt;npm&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>showdev</category>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
