<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Usable Password Security · Brennenstuhl on Security</title><link>https://www.janbrennenstuhl.eu/series/passwords/</link><description>Password policies, length limits and login forms that work with password managers instead of against them.</description><language>en-GB</language><copyright>Original writing CC BY 4.0, Jan Brennenstuhl</copyright><atom:link href="https://www.janbrennenstuhl.eu/series/passwords/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Support Long Passwords in a Login System</title><link>https://www.janbrennenstuhl.eu/long-password-support/</link><guid isPermaLink="true">https://www.janbrennenstuhl.eu/long-password-support/</guid><pubDate>Sat, 06 May 2023 00:00:00 +0200</pubDate><description>&lt;p&gt;A login system should accept passwords of at least 64 characters, check every character of them, and reject input above a maximum that somebody chose on purpose. Often the limit was never chosen: a form attribute, a database column or the hash function sets it. In this article I go through the places where such limits hide and how I would replace them with a single explicit one.&lt;/p&gt;
&lt;h2 id="start-with-the-two-numbers"&gt;Start with the two numbers &lt;a class="heading-anchor" href="#start-with-the-two-numbers" aria-label="Link to section: Start with the two numbers"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The US National Institute of Standards and Technology (NIST) sets both ends in &lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/authenticators/" title="NIST SP 800-63B-4: Authenticator and Verifier Requirements" class="ext"&gt;SP 800-63B-4&lt;/a&gt;. The minimum is 15 characters when the password is the only factor, and 8 when multi-factor authentication is always required. For the maximum, services &amp;ldquo;SHOULD permit a maximum password length of at least 64 characters&amp;rdquo;. I explain the reasoning behind these numbers in my article on &lt;a href="https://www.janbrennenstuhl.eu/max-password-length/" title="Password Length: The Minimum and Maximum NIST Recommends"&gt;password length&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A low maximum mostly hurts the users who do things right. A password manager can generate 40 random characters without effort, and a passphrase of five or six words is longer than 20 characters. The &lt;a href="https://dumbpasswordrules.com" title="A compilation of sites with dumb password rules" class="ext"&gt;Dumb Password Rules&lt;/a&gt; compilation collects many sites with such limits.&lt;/p&gt;
&lt;h2 id="keep-a-maximum-but-choose-it-yourself"&gt;Keep a maximum, but choose it yourself &lt;a class="heading-anchor" href="#keep-a-maximum-but-choose-it-yourself" aria-label="Link to section: Keep a maximum, but choose it yourself"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Accepting passwords of any size is not the answer either. Password hashing is slow on purpose, and an attacker can use that against the server. The Django project described the problem in a &lt;a href="https://www.djangoproject.com/weblog/2013/sep/15/security/" title="Django security releases: denial-of-service via large passwords" class="ext"&gt;security release from 2013&lt;/a&gt;. Django had no maximum length back then, and its default hasher needed more time for longer input:&lt;/p&gt;
&lt;blockquote class="quote"&gt;A password one megabyte in size, for example, will require roughly one minute of computation to check when using the PBKDF2 hasher.&lt;footer&gt;&lt;a href="https://www.djangoproject.com/weblog/2013/sep/15/security/"&gt;&lt;cite&gt;Django security release, 15 September 2013&lt;/cite&gt;&lt;/a&gt;&lt;/footer&gt;&lt;/blockquote&gt;
&lt;p&gt;A few such requests in parallel keep a server busy, and they don&amp;rsquo;t need a valid account. Django&amp;rsquo;s fix was to fail authentication for every password above 4096 bytes. NIST comes to the same conclusion in its &lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/passwords/" title="NIST SP 800-63B-4, Appendix A: Strength of Passwords" class="ext"&gt;appendix on password strength&lt;/a&gt;: users should be able to make passwords &amp;ldquo;as long as they want within reason&amp;rdquo;, and &amp;ldquo;it is reasonable to have some limit&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;I would pick the maximum between 64 characters and a few thousand bytes, write it into the password policy, and enforce the same value in every component that sees the password. A request size limit in front of the login endpoint is a good second line of defense, because it stops oversized input before it reaches the hasher.&lt;/p&gt;
&lt;h2 id="check-what-the-hash-function-accepts"&gt;Check what the hash function accepts &lt;a class="heading-anchor" href="#check-what-the-hash-function-accepts" aria-label="Link to section: Check what the hash function accepts"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Long passwords don&amp;rsquo;t need more storage. A password hash has the same size for 8 and for 800 characters, so the database column for the hash stays as it is. A column that still holds the password itself is a different and much bigger problem.&lt;/p&gt;
&lt;p&gt;The hash function can set a limit of its own. The OWASP &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html" title="OWASP Password Storage Cheat Sheet" class="ext"&gt;Password Storage Cheat Sheet&lt;/a&gt; currently recommends these settings:&lt;/p&gt;
&lt;div class="table-scroll" tabindex="0" role="region" aria-label="Table 1"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;&lt;th scope="col"&gt;Algorithm&lt;/th&gt;&lt;th scope="col"&gt;Minimum configuration (OWASP)&lt;/th&gt;&lt;th scope="col"&gt;Input limit&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Argon2id&lt;/td&gt;&lt;td&gt;19 MiB of memory, 2 iterations, 1 degree of parallelism&lt;/td&gt;&lt;td&gt;None that matters in practice&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;scrypt&lt;/td&gt;&lt;td&gt;CPU/memory cost 2^17, block size 8, parallelization 1&lt;/td&gt;&lt;td&gt;None that matters in practice&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;bcrypt (legacy systems)&lt;/td&gt;&lt;td&gt;Work factor 10 or more&lt;/td&gt;&lt;td&gt;72 bytes in most implementations&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;The bcrypt limit is the one to watch. Many implementations silently ignore everything after byte 72. The limit counts bytes, while NIST wants every Unicode code point counted as a single character. A character can take up to 4 bytes in UTF-8, so a bcrypt system can&amp;rsquo;t promise more than 18 characters to a user who types emoji. OWASP&amp;rsquo;s advice for bcrypt is to enforce a maximum of 72 bytes.&lt;/p&gt;
&lt;p&gt;A common workaround is to run the password through a fast hash such as SHA-256 first and to give the result to bcrypt. OWASP calls this approach dangerous, because the hash output can contain null bytes and because it enables an attack called password shucking. If I needed more than 72 bytes, I would move to Argon2id instead.&lt;/p&gt;
&lt;p&gt;If you accept Unicode, NIST also suggests normalizing the password (NFC) before hashing. Otherwise the same password typed on two devices can produce two different byte sequences.&lt;/p&gt;
&lt;h2 id="never-truncate-in-the-form-or-on-the-server"&gt;Never truncate, in the form or on the server &lt;a class="heading-anchor" href="#never-truncate-in-the-form-or-on-the-server" aria-label="Link to section: Never truncate, in the form or on the server"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;NIST requires services to &amp;ldquo;verify the entire submitted password (e.g., not truncate it)&amp;rdquo;. Truncation is dangerous because nobody notices it. The user believes the account has a 40-character password, while the system only ever checks the first 16.&lt;/p&gt;
&lt;p&gt;The HTML &lt;code&gt;maxlength&lt;/code&gt; attribute is the most common place where this happens. Browsers don&amp;rsquo;t show an error when a pasted password is longer than &lt;code&gt;maxlength&lt;/code&gt;. They cut the input, and the form submits the shortened value. If the sign-up form and the login form then use different values, the user can&amp;rsquo;t log in with the password they just set.&lt;/p&gt;
&lt;p&gt;I would leave &lt;code&gt;maxlength&lt;/code&gt; off password fields, or set it well above the real maximum, and show a clear message when the input is too long:&lt;/p&gt;
&lt;figure class="code" data-lang="html"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" aria-label="Code (html)" class="chroma"&gt;&lt;code data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;minlength&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;15&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password-error&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Please use at most 256 characters.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;The 256 here is an example value. Client-side checks only help the user, so the server has to apply the same minimum and maximum again and reject a password that is too long. It must not shorten it.&lt;/p&gt;
&lt;p&gt;A few test cases catch most mistakes: a password exactly at the maximum, a password a single character above it, and a password with multi-byte characters. Run them through sign-up, login, password change and password reset. Every component on the way, such as a gateway or a mobile app, has to pass the password on unchanged.&lt;/p&gt;
&lt;h2 id="move-existing-users-without-a-reset"&gt;Move existing users without a reset &lt;a class="heading-anchor" href="#move-existing-users-without-a-reset" aria-label="Link to section: Move existing users without a reset"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Raising the maximum doesn&amp;rsquo;t affect existing passwords, as all of them are shorter than the new limit. Changing the hash function needs more care, because a stored hash can&amp;rsquo;t be converted.&lt;/p&gt;
&lt;p&gt;The usual approach is to rehash at login. NIST recommends storing a reference to the hashing scheme and its cost factor with every hash &amp;ldquo;to allow migration to new algorithms and work factors&amp;rdquo;. When a user logs in and the stored hash still uses the old scheme, the server verifies the password against it, computes the new hash from the password it just received, and replaces the old hash. Accounts that never log in keep the old hash, so plan what happens to them after a deadline.&lt;/p&gt;
&lt;p&gt;One case needs a decision up front: a system that truncated passwords in the past. I haven&amp;rsquo;t seen this covered by NIST or OWASP, so take it as my own reasoning. The stored hashes of affected users belong to the shortened password. Once the system checks the full password, these users fail to log in although they type the correct one. The server could retry a failed login with the old truncation rule for hashes that are marked as old, and rehash the full password when that retry succeeds.&lt;/p&gt;
&lt;p&gt;Long password support pays off most for users with a password manager. In case you want to learn how forms can tell a password manager which lengths and characters they accept, read &lt;a href="https://www.janbrennenstuhl.eu/password-manager-friendly/" title="How to: Password-Manager Friendly Login Forms"&gt;How to: Password-Manager Friendly Login Forms&lt;/a&gt;. The rest of a policy, such as blocklists and strength estimation, is covered in &lt;a href="https://www.janbrennenstuhl.eu/password-policy/" title="How to Design a Strong &amp;amp; Usable Password Policy"&gt;How to Design a Strong &amp;amp; Usable Password Policy&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Password Length: The Minimum and Maximum NIST Recommends</title><link>https://www.janbrennenstuhl.eu/max-password-length/</link><guid isPermaLink="true">https://www.janbrennenstuhl.eu/max-password-length/</guid><pubDate>Thu, 04 May 2023 00:00:00 +0200</pubDate><description>&lt;p&gt;A password that is the only thing protecting an account should have at least 15 characters, and the service behind it should accept at least 64. Both numbers come from the US National Institute of Standards and Technology (NIST), and they are the numbers I recommend. In this article I explain where the numbers come from, why they are about length and not about special characters, and why a service may still set an upper limit.&lt;/p&gt;
&lt;h2 id="what-nist-and-owasp-recommend-today"&gt;What NIST and OWASP recommend today &lt;a class="heading-anchor" href="#what-nist-and-owasp-recommend-today" aria-label="Link to section: What NIST and OWASP recommend today"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;NIST published the fourth revision of its guideline on authentication, &lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/authenticators/" title="NIST SP 800-63B-4: Authenticator and Verifier Requirements" class="ext"&gt;SP 800-63B-4&lt;/a&gt;, in 2025. It is written for US government systems, but OWASP and many others refer to it as well. Section 3.1.1.2 lists what a service that verifies passwords has to do. The OWASP &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html" title="OWASP Authentication Cheat Sheet" class="ext"&gt;Authentication Cheat Sheet&lt;/a&gt;, for example, repeats the same length numbers and names NIST as its source.&lt;/p&gt;
&lt;div class="table-scroll" tabindex="0" role="region" aria-label="Table 1"&gt;&lt;table&gt;
&lt;thead&gt;&lt;tr&gt;&lt;th scope="col"&gt;Question&lt;/th&gt;&lt;th scope="col"&gt;NIST SP 800-63B-4&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Minimum length when the password is the only factor&lt;/td&gt;&lt;td&gt;15 characters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Minimum length when multi-factor authentication (MFA) is always required&lt;/td&gt;&lt;td&gt;8 characters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Maximum length a service should at least accept&lt;/td&gt;&lt;td&gt;64 characters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Rules such as &amp;ldquo;one digit, one symbol, one uppercase letter&amp;rdquo;&lt;/td&gt;&lt;td&gt;Not allowed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Checking only the first part of a long password&lt;/td&gt;&lt;td&gt;Not allowed&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Forced password changes on a schedule&lt;/td&gt;&lt;td&gt;Not allowed&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;The 64 in this table is easy to misread. NIST says services &amp;ldquo;SHOULD permit a maximum password length of at least 64 characters&amp;rdquo;. A limit of 64 is therefore the smallest acceptable one, and a limit of 20 or 32 characters doesn&amp;rsquo;t meet the guideline.&lt;/p&gt;
&lt;p&gt;If you want to compare an existing policy against the full list of requirements, I keep a checker in my field-guide entry on &lt;a href="https://www.janbrennenstuhl.eu/knowledge-base/account-security/password-policy-requirements/" title="What should a password policy require?"&gt;what a password policy should require&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="why-the-guideline-counts-characters-and-not-character-types"&gt;Why the guideline counts characters and not character types &lt;a class="heading-anchor" href="#why-the-guideline-counts-characters-and-not-character-types" aria-label="Link to section: Why the guideline counts characters and not character types"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An attacker who steals a database of password hashes can try guesses on their own hardware, without any rate limit. In its appendix on the &lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/passwords/" title="NIST SP 800-63B-4, Appendix A: Strength of Passwords" class="ext"&gt;strength of passwords&lt;/a&gt;, NIST speaks of &amp;ldquo;many billions of hashes per second&amp;rdquo; for such offline attacks. Every additional character multiplies the number of candidates the attacker has to try, so length is what makes guessing expensive.&lt;/p&gt;
&lt;p&gt;Composition rules were meant to have the same effect, but people respond to them in predictable ways. NIST gives this example:&lt;/p&gt;
&lt;blockquote class="quote"&gt;For example, a user who might have chosen &amp;ldquo;password&amp;rdquo; as their password would be relatively likely to choose &amp;ldquo;Password1&amp;rdquo; if required to include an uppercase letter and a number or &amp;ldquo;Password1!&amp;rdquo; if a symbol is also required.&lt;footer&gt;&lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/passwords/"&gt;&lt;cite&gt;NIST SP 800-63B-4, Appendix A&lt;/cite&gt;&lt;/a&gt;&lt;/footer&gt;&lt;/blockquote&gt;
&lt;p&gt;Attackers know these patterns and try them first. For that reason NIST dropped composition rules and asks services to compare new passwords against a blocklist of common and breached passwords. I describe how such a policy could look in &lt;a href="https://www.janbrennenstuhl.eu/password-policy/" title="How to Design a Strong &amp;amp; Usable Password Policy"&gt;How to Design a Strong &amp;amp; Usable Password Policy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Length alone has limits. A long password that appears in a breach list, or that is reused on a second site, is still easy to guess. The same appendix also points out that phishing and keystroke logging work as well against a long password as against a short one.&lt;/p&gt;
&lt;h2 id="why-a-service-may-still-set-a-maximum"&gt;Why a service may still set a maximum &lt;a class="heading-anchor" href="#why-a-service-may-still-set-a-maximum" aria-label="Link to section: Why a service may still set a maximum"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A stored password hash has the same size for a short and for a long password, so storage is no reason for a low limit. NIST still doesn&amp;rsquo;t ask for unlimited input:&lt;/p&gt;
&lt;blockquote class="quote"&gt;Users should be encouraged to make their passwords as long as they want within reason. [&amp;hellip;] However, extremely long passwords (perhaps megabytes long) could require excessive processing time to hash, so it is reasonable to have some limit.&lt;footer&gt;&lt;a href="https://pages.nist.gov/800-63-4/sp800-63b/passwords/"&gt;&lt;cite&gt;NIST SP 800-63B-4, Appendix A&lt;/cite&gt;&lt;/a&gt;&lt;/footer&gt;&lt;/blockquote&gt;
&lt;p&gt;Password hashing is slow on purpose, and for some algorithms the time grows with the length of the input. An attacker can abuse this by sending huge passwords to the login endpoint. The Django project had exactly this problem in 2013, and its &lt;a href="https://www.djangoproject.com/weblog/2013/sep/15/security/" title="Django security releases: denial-of-service via large passwords" class="ext"&gt;security release&lt;/a&gt; rejected every password above 4096 bytes.&lt;/p&gt;
&lt;p&gt;My reading is that the upper limit belongs somewhere between 64 characters and a few thousand. It should be so high that neither a person with a passphrase nor a password manager reaches it. In case you run a login system and want to know how to implement such a limit, read my article on &lt;a href="https://www.janbrennenstuhl.eu/long-password-support/" title="How to Support Long Passwords in a Login System"&gt;long password support&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-this-means-for-your-own-passwords"&gt;What this means for your own passwords &lt;a class="heading-anchor" href="#what-this-means-for-your-own-passwords" aria-label="Link to section: What this means for your own passwords"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The NIST numbers are written for services, but they translate well to personal use. My recommendation is a password manager. It generates a random password for every account and fills it in, so a length of 20 or 30 characters costs no extra effort. Set the generator to at least 15 characters, and to more where the site accepts it.&lt;/p&gt;
&lt;p&gt;Some passwords have to be typed by hand, for example the one that unlocks your computer or the password manager itself. For those, a passphrase of several random words is easier to type than random characters and reaches 15 characters quickly. The words have to be random: a quote or a song line is something an attacker&amp;rsquo;s word list may contain.&lt;/p&gt;
&lt;p&gt;A long password protects only the accounts it is not shared with. When a site leaks its passwords, attackers try the same email and password combination on other sites. I collected the numbers on that in &lt;a href="https://www.janbrennenstuhl.eu/knowledge-base/account-security/password-reuse/" title="How common is password reuse?"&gt;How common is password reuse?&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Three more points follow from the guideline:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Writing passwords down is acceptable if the note is stored safely. NIST says that recording passwords is &amp;ldquo;not necessarily vulnerable&amp;rdquo;, although some ways of doing it are. &lt;a href="https://www.troyhunt.com/only-secure-password-is-one-you-cant/" title="Troy Hunt: The only secure password is the one you can&amp;#39;t remember" class="ext"&gt;Troy Hunt&lt;/a&gt; made the same argument years ago.&lt;/li&gt;
&lt;li&gt;A good password doesn&amp;rsquo;t need to be changed on a schedule. Change it when there is a sign that it leaked.&lt;/li&gt;
&lt;li&gt;Length doesn&amp;rsquo;t help against phishing. Turn on MFA where a site offers it, or use &lt;a href="https://www.janbrennenstuhl.eu/fido-passkeys/" title="Passwordless: Critical Notes on FIDO2 Passkeys"&gt;passkeys&lt;/a&gt; if they fit your setup.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>How to Design a Strong &amp; Usable Password Policy</title><link>https://www.janbrennenstuhl.eu/password-policy/</link><guid isPermaLink="true">https://www.janbrennenstuhl.eu/password-policy/</guid><pubDate>Wed, 26 Apr 2023 00:00:00 +0200</pubDate><description>&lt;h2 id="importance-of-password-policy-best-practices"&gt;Importance of Password Policy Best Practices &lt;a class="heading-anchor" href="#importance-of-password-policy-best-practices" aria-label="Link to section: Importance of Password Policy Best Practices"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In today’s digital landscape, both password management and security are more important than ever before. With data breaches and cyberattacks on the rise, it’s crucial that organisations implement strong password policies to protect against credential stuffing, password spaying and related password attacks. However, designing a secure password policy that is both effective and user-friendly can be a challenging task. A password policy that is too complex or difficult to follow introduces friction that will lead to user frustration, while a policy that is too lax can put the organisation and its user accounts at risk.&lt;/p&gt;
&lt;p&gt;In this article, I’ll explore the key components of a strong password policy based on state-of-the-art research and provide practical tips for striking a balance between security and usability. Whether you’re a security professional looking to establish a company password policy and guidelines in your organisation, or a web developer who wants to create the ultimate user authentication experience without sacrificing security, this article is for you. So let’s dive in and discover how to design a password policy that’s user-friendly and effective.&lt;/p&gt;
&lt;h2 id="key-components-of-a-modern-password-policy"&gt;Key Components of a Modern Password Policy &lt;a class="heading-anchor" href="#key-components-of-a-modern-password-policy" aria-label="Link to section: Key Components of a Modern Password Policy"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Contrary to common believe and uncountable terribly bad examples of sites leveraging the &lt;a href="https://dumbpasswordrules.com" title="A compilation of sites with dumb password rules" class="ext"&gt;dumbest password composition policies&lt;/a&gt; in the open wild, security researchers are pretty clear on the key components of a password policy. These ingredients are essential to your password hygiene to be both effective in protecting against unauthorized access and usable for your users:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Minimum-strength&lt;/strong&gt; – First and foremost, your password policy should include minimum-strength requirements. This means that passwords must meet certain criteria in order to be considered strong enough to use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minimum-length&lt;/strong&gt; – The most important characteristic of a strong password is its length. A minimum password length should be long enough to provide a sufficient level of security. Every password policy should enforce strict minimum-length requirements while keeping usability in mind. Longer passwords are more secure passwords.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blocklist&lt;/strong&gt; – Lastly, a blocklist requirement should be included to prevent users from using easily guessable, weak passwords such as &lt;code&gt;password123&lt;/code&gt;, &lt;code&gt;12345678&lt;/code&gt; or other common passwords. A blocklist can also be used to prevent users from using passwords that showed up in data breaches, which will help to increase the overall security of your password policy even more.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By combining minimum-strength, minimum-length, and blocklist password requirements together, you can create a password policy that strikes the perfect balance between usability and security. Your users will be able to easily remember their passwords, while also feeling confident that their accounts are secure from unauthorized access. Secure passwords are difficult to guess, and hence much less susceptible to credential stuffing, dictionary attacks or brute force attacks.&lt;/p&gt;
&lt;p&gt;&lt;figure class="figure"&gt;&lt;picture&gt;&lt;source type="image/avif" srcset="https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_f4bd7403673c8365.avif 480w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_30a70947236573c0.avif 960w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_d26449d46fda1ece.avif 1440w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_61ba08444f3e5af9.avif 1536w" sizes="(min-width: 760px) 720px, calc(100vw - 2.5rem)"&gt;&lt;img src="https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_b23fb08c91768f32.webp" srcset="https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_e72150a6acc2133d.webp 480w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_1658fd059eeffc8e.webp 960w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_6d3de5ad5d6c139e.webp 1440w, https://www.janbrennenstuhl.eu/password-policy/dumb-password-rules_hu_b23fb08c91768f32.webp 1536w" sizes="(min-width: 760px) 720px, calc(100vw - 2.5rem)" width="1536" height="768" alt="Dumb Password Rules" loading="lazy" decoding="async"&gt;&lt;/picture&gt;&lt;figcaption&gt;A compilation of 292 sites with dumb password rules.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 id="why-arbitrary-password-policies-are-bad"&gt;Why Arbitrary Password Policies are Bad &lt;a class="heading-anchor" href="#why-arbitrary-password-policies-are-bad" aria-label="Link to section: Why Arbitrary Password Policies are Bad"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Arbitrary password complexity and composition policies are a common “feature” of many password policies, and they can actually do more harm than good. These complexity requirements often require users to create passwords that meet certain arbitrary requirements, such as including certain character classes like the number of uppercase letters, lowercase letters, numbers, and special characters. However, &lt;a href="https://dl.acm.org/doi/pdf/10.1145/3372297.3417882" title="Practical Recommendations for Stronger, More Usable
Passwords" class="ext"&gt;research has shown&lt;/a&gt; that these policies are no security silver bullet and can actually lead to weaker passwords and increased frustration for users:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Our experimental results provide the first concrete evidence that character-class requirements should be avoided not only because users tend to find them annoying, but also because they don’t provide substantial bene!t against attackers using state-of-the-art password-cracking tools.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="stop-password-complexity-requirements"&gt;Stop Password Complexity Requirements! &lt;a class="heading-anchor" href="#stop-password-complexity-requirements" aria-label="Link to section: Stop Password Complexity Requirements!"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To illustrate this point, consider the case of a large e-commerce organisation that implemented an arbitrary password composition policy requiring passwords to include at least one uppercase letter, one lowercase letter, one number, and one special character. After implementing this policy, they found that many users were using passwords like &lt;code&gt;P@ssword1&lt;/code&gt;, &lt;code&gt;Qwerty1!&lt;/code&gt;, and &lt;code&gt;W3lcome!&lt;/code&gt;. These passwords were easy to guess and provided little protection against attacks.&lt;/p&gt;
&lt;p&gt;Instead of relying on character classes and strict composition policies, it is better to focus on creating strong passwords that are easy for users to come up with and to remember. This core recommendation is also already standardised in the &lt;a href="https://pages.nist.gov/800-63-3/sp800-63b.html" title="NIST Digital Identity Guidelines on Authentication and Lifecycle Management" class="ext"&gt;NIST password guidelines&lt;/a&gt; within their digital identity guidelines and can be achieved by using techniques like passphrases. Passphrases typically result in longer phrases that are easy to remember but difficult for attackers to guess. By focusing on usability and secure password creation techniques, you can create a password policy that is both effective and user-friendly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sophisticated composition policies should only be leveraged when directly interacting with password managers&lt;/strong&gt; – I recently wrote about &lt;a href="https://www.janbrennenstuhl.eu/password-manager-friendly/" title="Improving password security: Become Password-Manager friendly!"&gt;How to make your login and sign-up processes password manager friendly!&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="best-practices-for-implementing-a-password-security-policy"&gt;Best Practices for Implementing a Password Security Policy &lt;a class="heading-anchor" href="#best-practices-for-implementing-a-password-security-policy" aria-label="Link to section: Best Practices for Implementing a Password Security Policy"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now that you understand the key components of a strong and user-friendly password policy, as well as reason for why difficult passwords are not the holy grail, it&amp;rsquo;s important to consider implementation practises. How can you balance security with usability when implementing a password policy? In this section, I&amp;rsquo;ll discuss password strength best practices that will help you with implementing a state-of-the-art password policy that is backed by research. By following these guidelines, you can ensure that your users will create strong passwords without frustration due to arbitrary numbers and special characters enforcement.&lt;/p&gt;
&lt;h3 id="minimum-password-length"&gt;Minimum Password Length &lt;a class="heading-anchor" href="#minimum-password-length" aria-label="Link to section: Minimum Password Length"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;What is the optimal password length for maximum security? Well, as usual the answer depends on your threat model. For organisations protecting high-value accounts without a substantial negative usability impact appetite, research suggests that a well-defined password strength policy should include a composition rule of &lt;code&gt;1c12+NN10&lt;/code&gt;. This fancy formula transformed into plain-text English basically translates to &lt;em&gt;&amp;ldquo;a password including at least one character class (&lt;code&gt;1C&lt;/code&gt;) of at least 12 characters length (&lt;code&gt;12&lt;/code&gt;) and not guessable by a neural-network based password cracker in under 10 billion tries (&lt;code&gt;NN10&lt;/code&gt;)&amp;rdquo;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;So from an academic perspective, 12 characters long passwords should be good enough for the majority of services if you can ensure that common crackers would need more than 10 billion tries to guess successfully the same password. However, eight characters seems to still be the more widespread minimum length requirement out there.&lt;/p&gt;
&lt;p&gt;How to calculate the guessability of a password will be covered in the next section when I&amp;rsquo;ll describe, how you can implement a low-budget password strength estimation.&lt;/p&gt;
&lt;h3 id="minimum-password-strength"&gt;Minimum Password Strength &lt;a class="heading-anchor" href="#minimum-password-strength" aria-label="Link to section: Minimum Password Strength"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;As you already learned, password policy best practices suggest to grant composition-freedom to the user and to rather focus on estimating how many guesses a neural-network based password cracker would need to find a match. Of course, not everyone of us always has a private neural-network at hand, but there are &lt;a href="https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_wheeler.pdf" title="Low-Budget Password Strength Estimation" class="ext"&gt;budget-friendly alternatives&lt;/a&gt;. The potentially most popular strength estimator inspired by password crackers is &lt;a href="https://github.com/dropbox/zxcvbn" title="Dropbox zxcvbn on Github" class="ext"&gt;zxcvbn by Dropbox&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Through pattern matching and conservative estimation, it recognizes and weighs 30k common passwords, common names and surnames according to US census data, popular English words from Wikipedia and US television and movies, and other common patterns like dates, repeats (aaa), sequences (abcd), keyboard patterns (qwertyuiop), and l33t speak.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Most importantly and among other useful characteristics, zxcvbn spits out rather accurate estimates on &lt;em&gt;&amp;ldquo;guesses needed to crack the password&amp;rdquo;&lt;/em&gt;. Libraries exist for pretty much every programming language and most of them can be extended with custom dictionaries and keyboard layouts.&lt;/p&gt;
&lt;h3 id="password-blocklists"&gt;Password Blocklists &lt;a class="heading-anchor" href="#password-blocklists" aria-label="Link to section: Password Blocklists"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;While common passwords definitely should be banned, other weak or stolen passwords also deserve your attention. Many regular users reuse default passwords across services, as these &lt;a href="https://www.janbrennenstuhl.eu/knowledge-base/account-security/password-reuse/" title="5 Alarming Password Reuse Studies"&gt;5 alarming password reuse studies show&lt;/a&gt;. Credential stuffing attacks using compromised credentials can be considered &lt;em&gt;&amp;ldquo;epidemic&amp;rdquo;&lt;/em&gt; and are currently one of the largest threats for user passwords and accounts.&lt;/p&gt;
&lt;p&gt;My recommendation is to perform server-side leaked password checks against a large set of leaked passwords like the &lt;a href="https://haveibeenpwned.com/Passwords" class="ext"&gt;Have I Been Pwned password list&lt;/a&gt;. As this list of breached passwords also includes all commonly used secrets and simple passwords, your password blocklist requirement should be fulfilled. Alternatively and likely with a little less friction for your users attached, you can deny compromised credential pairs (email+secret) by checking for example against the &lt;a href="https://www.politie.nl/onderwerpen/no-more-leaks.html" class="ext"&gt;No More Leaks data set&lt;/a&gt; provided by Dutch authorities. Here you would likely want to incorporate an additional common passwords blocklist, leveraging some fuzzy matching.&lt;/p&gt;
&lt;p&gt;Additionally, you definitely want to check for and deny passwords that match the corresponding username.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion &lt;a class="heading-anchor" href="#conclusion" aria-label="Link to section: Conclusion"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Striking a balance between friction and security for account security is possible – even without a sophisticated security awareness training. Moving intellectual workload away from the user and following password security approaches that truly result in measurable defense improvement while offering frictionless experiences to regular users, is the quintessence of the password policy best practices I shared in this article.&lt;/p&gt;
&lt;p&gt;As security always depends on your local security risks assessment and threat model while acceptable usability trade-offs pretty much depend on your audience, consider the following quick recap list of &lt;em&gt;&amp;ldquo;dos and don&amp;rsquo;ts&amp;rdquo;&lt;/em&gt; as general guidance, not as hard requirements:&lt;/p&gt;
&lt;h3 id="10-dos--donts-for-an-effective-password-strength-policy"&gt;10 Dos &amp;amp; Donts For An Effective Password Strength Policy &lt;a class="heading-anchor" href="#10-dos--donts-for-an-effective-password-strength-policy" aria-label="Link to section: 10 Dos &amp;amp; Donts For An Effective Password Strength Policy"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Do apply a minimal length requirement of at least 12 characters.&lt;/li&gt;
&lt;li&gt;Do apply a minimal strength requirement based on guessability indicators.&lt;/li&gt;
&lt;li&gt;Do apply active blocklisting either based on breached data or using fuzzy matching common passwords.&lt;/li&gt;
&lt;li&gt;Do prevent users from using credentials pairs were username equals secret.&lt;/li&gt;
&lt;li&gt;Do allow unicode characters. Character set, character types and classes should be up to the users.&lt;/li&gt;
&lt;li&gt;Do consider disallowing the use of known to be compromised credential pairs.&lt;/li&gt;
&lt;li&gt;Do become password manager friendly. Encouraging users to leverage secret generators is very valuable.&lt;/li&gt;
&lt;li&gt;Do provide multi factor authentication means.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t enforce a maximum length requirement, there is better ways to handle DoS.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t apply composition rules and avoid enforcing specific character classes.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t check for minimum password age or enforce users to regularly change passwords.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As usual, feel free to &lt;a href="https://infosec.exchange/@jbspeakr" class="ext"&gt;drop me message on Mastodon&lt;/a&gt; if you have any suggestions, feedback or comments!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="frequently-asked-questions-faq"&gt;Frequently Asked Questions (FAQ) &lt;a class="heading-anchor" href="#frequently-asked-questions-faq" aria-label="Link to section: Frequently Asked Questions (FAQ)"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="do-password-meters-discourage-users-from-using-complex-passwords"&gt;Do password meters discourage users from using complex passwords? &lt;a class="heading-anchor" href="#do-password-meters-discourage-users-from-using-complex-passwords" aria-label="Link to section: Do password meters discourage users from using complex passwords?"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Password meters are visual strength indicators that can help users create strong passwords by providing feedback on the strength of their previous password choices. However, some users may feel discouraged by these meters, especially if they perceive them as too strict or limiting. In some cases, this can lead to users choosing simpler and less secure passwords in order to avoid the frustration of dealing with a password meter.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/chi13b.pdf" class="ext"&gt;Research suggests&lt;/a&gt;, that these meters only make a difference &lt;em&gt;&amp;ldquo;when users are forced to change existing passwords&amp;rdquo;&lt;/em&gt;. Pure visual indicators seem to have no significant effect.&lt;/p&gt;
&lt;h3 id="should-password-meters-take-into-account-the-likelihood-of-a-password-being-guessed-by-an-attacker"&gt;Should password meters take into account the likelihood of a password being guessed by an attacker? &lt;a class="heading-anchor" href="#should-password-meters-take-into-account-the-likelihood-of-a-password-being-guessed-by-an-attacker" aria-label="Link to section: Should password meters take into account the likelihood of a password being guessed by an attacker?"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Yes, your password strength policy should definitely take into consideration how easy it is for malicious actors to guess passwords. How guessable a password is can get directly linked to it overall strength. The actual character composition should not be restricted.&lt;/p&gt;
&lt;h3 id="should-i-use-a-blacklist-of-commonly-used-passwords-to-prevent-users-from-using-weak-passwords"&gt;Should I use a blacklist of commonly used passwords to prevent users from using weak passwords? &lt;a class="heading-anchor" href="#should-i-use-a-blacklist-of-commonly-used-passwords-to-prevent-users-from-using-weak-passwords" aria-label="Link to section: Should I use a blacklist of commonly used passwords to prevent users from using weak passwords?"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Yes, using a blacklist is a good practice to prevent users from using commonly used, formerly breached and reused passwords and hence easy to guess passwords. It is important to note that relying solely on a blacklist is not enough to create a strong password policy. Other best practices such as setting a password length requirement, and implementing multi-factor authentication should also be considered. By using a combination of these measures, you can ensure that your users are creating strong and secure passwords.&lt;/p&gt;
&lt;h3 id="should-i-use-a-password-manager-to-create-and-store-strong-passwords"&gt;Should I use a password manager to create and store strong passwords? &lt;a class="heading-anchor" href="#should-i-use-a-password-manager-to-create-and-store-strong-passwords" aria-label="Link to section: Should I use a password manager to create and store strong passwords?"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Yes, and you should educate your users about the benefits of password management tooling. Creating passwords using a password management tool is a highly recommended practice to ensure better security of your online accounts. A password management system can generate long, complex, and unique passwords for each account, reducing the risk of guessing or cracking. Additionally, they can securely store your passwords and automatically fill them in when you visit a website or app, making it easier for you to use a unique and complex password without the need to remember them.&lt;/p&gt;
&lt;h3 id="is-it-safe-to-use-the-same-password-for-multiple-accounts"&gt;Is it safe to use the same password for multiple accounts? &lt;a class="heading-anchor" href="#is-it-safe-to-use-the-same-password-for-multiple-accounts" aria-label="Link to section: Is it safe to use the same password for multiple accounts?"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In short, no, it is not safe to reuse passwords (and especially credential pairs) across various services. Doing so can lead to disastrous consequences, as it drastically increases your personal account security risk. A security breach on one service can compromise all of your accounts with same passwords. For example, if you use the same password for your email, social media, and e-commerce accounts, a successful data exfiltration on a social media platform will allow malicious actors to also gain access to your other accounts.&lt;/p&gt;</description></item><item><title>How to: Password-Manager Friendly Login Forms</title><link>https://www.janbrennenstuhl.eu/password-manager-friendly/</link><guid isPermaLink="true">https://www.janbrennenstuhl.eu/password-manager-friendly/</guid><pubDate>Sun, 23 Apr 2023 00:00:00 +0200</pubDate><description>&lt;p&gt;Do you ever get tired of manually typing in your login credentials every time you need to access an online account? Luckily, there is a solution: password managers. These handy tools can automatically generate and store strong passwords, but they&amp;rsquo;re only truly useful if login forms are password-manager friendly. In this article, I explore how you can make your login forms more compatible with password managers to improve the user experience and enhance security. So, let&amp;rsquo;s dive in and unlock the key to effortless login!&lt;/p&gt;
&lt;h2 id="what-is-a-password-manager"&gt;What is a password manager? &lt;a class="heading-anchor" href="#what-is-a-password-manager" aria-label="Link to section: What is a password manager?"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A password manager (PWM) is powerful a software application designed to help users store and manage their login credentials and other sensitive information securely. It typically works by generating strong, unique passwords for each of the user&amp;rsquo;s online accounts and storing them in an encrypted database. The user only needs to remember a single master password or use other authentication methods such as biometrics to access the PWM, and it can automatically fill in the login details for the user when they visit your website or application. This can help users avoid the pitfalls of weak, reused, or easily guessed passwords, and enhance the overall security of their digital identities.&lt;/p&gt;
&lt;p&gt;If you want my recommendation for one of the best password managers, I&amp;rsquo;ve always used &lt;a href="https://1password.com" class="ext"&gt;1Password&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="understanding-the-limitations-of-traditional-login-forms"&gt;Understanding the limitations of traditional login forms &lt;a class="heading-anchor" href="#understanding-the-limitations-of-traditional-login-forms" aria-label="Link to section: Understanding the limitations of traditional login forms"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The internet seems to be full of sites that do things that are very unfriendly to users of a PWM. Common mistakes include disabling copy-pasting (or autofill) features or enforcing &lt;a href="https://dumbpasswordrules.com/sites/" class="ext"&gt;dumb password composition policies&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Just imagine you&amp;rsquo;re in a hurry to purchase that limited pair of sneakers online and need to create an account to complete the transaction. You type in your email address and password, only to realize that the site&amp;rsquo;s password requirements are arbitrarily strict and your usual password composition strategy doesn&amp;rsquo;t meet them. Frustrated, you spend precious minutes creating a new password that you know you&amp;rsquo;ll probably forget later.&lt;/p&gt;
&lt;p&gt;With modern password manager support, your login form could have easily supported a users PWM with generating a strong, unique, suitable password in seconds and saved it for future use. As identity providers and login form maintainers we must make using a password manager on our sites as easy as possible!&lt;/p&gt;
&lt;h2 id="best-practices-for-designing-password-manager-friendly-login-forms"&gt;Best practices for designing password-manager friendly login forms &lt;a class="heading-anchor" href="#best-practices-for-designing-password-manager-friendly-login-forms" aria-label="Link to section: Best practices for designing password-manager friendly login forms"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Form element improvements&lt;/strong&gt; – To improve the ease of use of password managers on your site make sure that you help browsers and tooling to autofill the password for the correct input field. Although some browsers can find the correct input heuristically even if the login form is not optimized for this purpose, web developers should correctly annotate HTML &lt;code&gt;input&lt;/code&gt; elements using the &lt;code&gt;autocomplete&lt;/code&gt; attribute.&lt;/p&gt;
&lt;p&gt;For example, the account creation form should indicate that it&amp;rsquo;s expecting a new password and that the password generator should create a new password for this input:&lt;/p&gt;
&lt;figure class="code" data-lang="html"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" aria-label="Code (html)" class="chroma"&gt;&lt;code data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;In context of user authentication, the login form should explicitly indicate that it&amp;rsquo;s expecting the email address and the current password for the user:&lt;/p&gt;
&lt;figure class="code" data-lang="html"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" aria-label="Code (html)" class="chroma"&gt;&lt;code data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;email&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;email&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;email&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;current-password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;current-password&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Strong password policies&lt;/strong&gt; – Balancing effortless login with improved password security means that arbitrary password composition policies are rightfully considered counter-productive and even harmful nowadays. Researchers and security experts suggest that the single most important characteristic of a password is its length.&lt;/p&gt;
&lt;p&gt;Password length requirements can directly be added to the password &lt;code&gt;input&lt;/code&gt; element using the &lt;code&gt;pattern&lt;/code&gt; attribute:&lt;/p&gt;
&lt;figure class="code" data-lang="html"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" aria-label="Code (html)" class="chroma"&gt;&lt;code data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;.{12,70}&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;new-password&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;This length requirement pattern will tell password managers to generate and autofill a new random password of at least 12 characters. While for many manually typing users without an automated password generator this is still achievable, it means to somewhat mis out on the great capabilities of password managers.&lt;/p&gt;
&lt;p&gt;Luckily there is a way to have your login form tell 1Password, or other tools generating passwords for you, to apply &lt;a href="https://www.janbrennenstuhl.eu/password-policy/" title="How to create a strong password policy"&gt;a way more elaborate password policy&lt;/a&gt; using the &lt;code&gt;passwordrules&lt;/code&gt; attribute on the &lt;code&gt;input&lt;/code&gt;:&lt;/p&gt;
&lt;figure class="code" data-lang="html"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" aria-label="Code (html)" class="chroma"&gt;&lt;code data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;password&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;passwordrules&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;minlength: 52; maxlength: 70; required: lower; required: upper; required: digit; required: [-];&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;…&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;Password managers like 1Password, will now auto-generate a complex password of at least 52 character length and including a good mixture of character classes.&lt;/p&gt;
&lt;p&gt;Although the &lt;code&gt;passwordrules&lt;/code&gt; attribute &lt;a href="https://github.com/whatwg/html/issues/3518" class="ext"&gt;is still a proposal&lt;/a&gt;, 1Password recommends to &lt;a href="https://developer.1password.com/docs/web/compatible-website-design/#provide-password-requirements" class="ext"&gt;provide these password requirements&lt;/a&gt;.&lt;/p&gt;
&lt;details class="details" open&gt;&lt;summary&gt;&lt;strong&gt;A Well-Known URL for Changing Passwords&lt;/strong&gt;&lt;/summary&gt;&lt;p&gt;Password managers can warn users about &lt;a href="https://www.janbrennenstuhl.eu/knowledge-base/account-security/credential-stuffing/" title="How to check for compromised credentials?!"&gt;breached credentials&lt;/a&gt;, but the lack of account security industry standards results in a lot of friction when asking users to change password. The &lt;a href="https://w3c.github.io/webappsec-change-password-url/" class="ext"&gt;change password URL standard by W3C&lt;/a&gt; solves that problem by defining a well-known URL that sites and service provider can use to make their change password forms discoverable by automated tools: &lt;code&gt;/.well-known/change-password&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you use the 1Password browser extension like I am, that leads to a really nice experience. Your users will be happy!&lt;/p&gt;
&lt;/details&gt;
&lt;h2 id="improving-accessibility-with-password-manager-friendly-login-forms"&gt;Improving accessibility with password-manager friendly login forms &lt;a class="heading-anchor" href="#improving-accessibility-with-password-manager-friendly-login-forms" aria-label="Link to section: Improving accessibility with password-manager friendly login forms"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Applying modern password security best practices on your sites and making your account creation and authentication forms more password manager friendly is possible and will result in effortless login experiences for your users. Automated login and form-filling features will have huge time-saving benefits for users with password managers.&lt;/p&gt;
&lt;p&gt;Actively supporting PWMs in authentication processes will resolve your users from friction by leveraging more automation. Users will gladly benefit from simplified password management across multiple accounts and platforms.&lt;/p&gt;
&lt;h2 id="increasing-security-with-password-manager-friendly-login-forms"&gt;Increasing security with password-manager friendly login forms &lt;a class="heading-anchor" href="#increasing-security-with-password-manager-friendly-login-forms" aria-label="Link to section: Increasing security with password-manager friendly login forms"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Becoming password-manager friendly will directly result in more super strong passwords being used by your customers. Moving the responsibility of generating strong, complex passwords from the users to their password managers enables identity providers and account security experts to truly leverage the advantages of complex password composition policies and length requirements.&lt;/p&gt;
&lt;p&gt;Helping password managers to better help your users means increasing protection against common threats not only for your users but also for your service or site. Improved overall security is a direct consequence.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion &lt;a class="heading-anchor" href="#conclusion" aria-label="Link to section: Conclusion"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While we wait for the emerging technologies and techniques like &lt;a href="https://www.janbrennenstuhl.eu/passwordless-authentication/" title="Passwordless Authentication – The Future of Login"&gt;passwordless authentication&lt;/a&gt; and &lt;a href="https://www.janbrennenstuhl.eu/fido-passkeys/" title="Critical Notes on Passkeys"&gt;FIDO Passkeys&lt;/a&gt; to become commodities and eventually resolve us from simple password schemes, we can and should make passwords easier to use. Getting rid of outdated and frustration-prone password policies while investing on making login forms more password manager friendly is a must for identity providers and web developers maintaining authentication experiences.&lt;/p&gt;
&lt;p&gt;With modern form element improvements like &lt;code&gt;autocomplete&lt;/code&gt;, &lt;code&gt;pattern&lt;/code&gt; and &lt;code&gt;passwordrules&lt;/code&gt; attributes, your sign-in process will become best friends with many password managers out in the wild!&lt;/p&gt;
&lt;p&gt;Feel free to &lt;a href="https://infosec.exchange/@jbspeakr" class="ext"&gt;drop me message on Mastodon&lt;/a&gt; if you have any suggestions or comments!&lt;/p&gt;</description></item></channel></rss>