<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>nathilia-pierce</title>
    <link>https://wordsmith.social/nathilia-pierce/</link>
    <description></description>
    <pubDate>Sat, 26 Sep 2026 17:37:59 +0000</pubDate>
    <item>
      <title>How to Process Passwords as a Software Developer</title>
      <link>https://wordsmith.social/nathilia-pierce/how-to-process-passwords-as-a-software-developer</link>
      <description>&lt;![CDATA[Passwords are still the primary method of authentication today, in a form of something you know. Humans are lazy, often resulting in low entropy and reused passwords.&#xA;&#xA;Magnitudes of research and thought have been put into protecting passwords. They are known as the simplest form of a challengeâ€“response authentication scheme.&#xA;&#xA;Because the challenge &#34;What is your password?&#34; is repeated, so is the response, opening the door to possible replay attacks.&#xA;&#xA;Choose the Right Hashing Algorithm&#xA;&#xA;Argon2 is a key derivation function, the winner of the password hashing competition and should be used for new projects. In case it isn&#39;t available, use Scrypt. Any other KDF is nonoptimal.&#xA;&#xA;Argon2&#39;s &#34;i&#34; variant is resistant to side-channel attacks, while &#34;d&#34; variant is resistant to time-memory tradeoff attacks. &#34;id&#34; is the hybrid variant, resistant to both and suitable for most purposes.&#xA;&#xA;Make sure to use &#34;id&#34; variant of Argon2.&#xA;&#xA;Salt Hashes Properly&#xA;&#xA;Salts) are closely related to nonces, however, nonces are for communication protocols, not hashing. Nonces protect against replay attacks, while salts protect against precomputed hashes(aka rainbow tables). It&#39;s important to separate them, as they aren&#39;t protecting against the same things.&#xA;&#xA;The only requirements of salts are to be unique to each hash and public, however, they should be unpredictable to prevent precomputing future hashes.&#xA;&#xA;A cryptographically secure pseudo-random number generator output of 32 bytes will produce an unpredictable, and unique value.&#xA;&#xA;&#34;Pepper&#34; Hashes Properly&#xA;&#xA;If you&#39;ve been around the internet, researching password salts, you&#39;ve probably heard of the &#34;pepper&#34;. It is a cryptographic secret(secret key), that must be unpredictable and unique to each application, used in a hash function.&#xA;&#xA;Wait ... sounds a lot like an keyed-hash message authentication code, right? That&#39;s because it is. One must be extremely careful implementing &#34;peppers&#34; because it can lead to length extension attacks and nasty problems with Bcrypt.&#xA;&#xA;Argon2 actually implements a secret value in the official spec as an optional argument to act as a &#34;pepper&#34;. If you&#39;re using an implementation that does not support the secret value, encrypt the hash. If you&#39;re not using Argon2, encrypt the hash.&#xA;&#xA;Do not waste your time implementing both a &#34;pepper&#34; and encrypting the hash. You gain no practical benefit. And you might want to store your cryptographic secrets in a hardware security module.&#xA;&#xA;Use a Reasonable Policy&#xA;&#xA;Maximum length of no less than 128 characters.&#xA;Minimum length of 12 or 16 characters.&#xA;Support almost if not all unicode and whitespace.&#xA;Decline known passwords via HIBP API.&#xA;Decline passwords matching the identifier, e.g: email, username.&#xA;Don&#39;t enforce special characters, uppercase, lowercase, symbols, etc.&#xA;Don&#39;t truncate, sanitize, or format their passwords in any way shape or form!&#xA;Don&#39;t prevent them from copying and pasting into the password fields.&#xA;Don&#39;t limit what they can or cannot put into the password fields.&#xA;Don&#39;t require password changes every so often.&#xA;&#xA;What matters most, is the length and entropy. If you feel still inclined to enforce the character set above, don&#39;t. Enforce multi-factor authentication instead, their accounts will be far better with it.&#xA;&#xA;If you enforce that character set, you run the risk of them writing it down, forgetting it, annoying them, or choosing a weak password. You can also cause users to write down their passwords if you enforce password changes.&#xA;&#xA;Finally Encourage Good Practices&#xA;&#xA;Encourage the use of diceware, passphrases, password managers (like BitWarden), and multi-factor authentication(FIDO and TOTP).&#xA;&#xA;Discourage passwords with personal information like names, dates, birthdays, etc. Or sharing them if at all possible.]]&gt;</description>
      <content:encoded><![CDATA[<p>Passwords are still the primary method of authentication today, in a form of <em>something you know.</em> Humans are lazy, often resulting in low entropy and reused passwords.</p>

<p>Magnitudes of research and thought have been put into protecting passwords. They are known as the simplest form of a <a href="https://en.wikipedia.org/wiki/Challenge%E2%80%93response_authentication" rel="nofollow">challengeâ€“response authentication</a> scheme.</p>

<p>Because the challenge “What is your password?” is repeated, so is the response, opening the door to possible <a href="https://en.wikipedia.org/wiki/Replay_attack" rel="nofollow">replay attacks</a>.</p>

<h2 id="choose-the-right-hashing-algorithm">Choose the Right Hashing Algorithm</h2>

<p><a href="https://en.wikipedia.org/wiki/Argon2" rel="nofollow">Argon2</a> is a <a href="https://en.wikipedia.org/wiki/Key_derivation_function" rel="nofollow">key derivation function</a>, the winner of the <a href="https://password-hashing.net/" rel="nofollow">password hashing competition</a> and should be used for new projects. In case it isn&#39;t available, use <a href="https://www.tarsnap.com/scrypt.html" rel="nofollow">Scrypt</a>. Any other KDF is nonoptimal.</p>

<p>Argon2&#39;s “i” variant is resistant to <a href="https://en.wikipedia.org/wiki/Side-channel_attack" rel="nofollow">side-channel attacks</a>, while “d” variant is resistant to <a href="https://en.wikipedia.org/wiki/Time/memory/data_tradeoff_attack" rel="nofollow">time-memory tradeoff attacks</a>. “id” is the hybrid variant, resistant to both and suitable for most purposes.</p>

<p><strong>Make sure to use “id” variant of Argon2.</strong></p>

<h3 id="salt-hashes-properly">Salt Hashes Properly</h3>

<p><a href="https://en.wikipedia.org/wiki/Salt_(cryptography)" rel="nofollow">Salts</a> are closely related to <a href="https://en.wikipedia.org/wiki/Cryptographic_nonce" rel="nofollow">nonces</a>, however, nonces are for <em>communication protocols,</em> not hashing. Nonces protect against replay attacks, while salts protect against precomputed hashes(aka <a href="https://en.wikipedia.org/wiki/Rainbow_table" rel="nofollow">rainbow tables</a>). It&#39;s important to separate them, as they aren&#39;t protecting against the same things.</p>

<p>The only requirements of salts are to be <strong>unique to each hash and public,</strong> however, they <em>should be unpredictable to</em> prevent precomputing future hashes.</p>

<p>A <a href="https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator" rel="nofollow">cryptographically secure pseudo-random number generator</a> output of 32 bytes will produce an unpredictable, and unique value.</p>

<h3 id="pepper-hashes-properly">“Pepper” Hashes Properly</h3>

<p>If you&#39;ve been around the internet, researching password salts, you&#39;ve probably heard of the “pepper”. It is a cryptographic secret(secret key), that must be unpredictable and unique to each application, used in a hash function.</p>

<p>Wait ... sounds a lot like an <a href="https://en.wikipedia.org/wiki/HMAC" rel="nofollow">keyed-hash message authentication code</a>, right? That&#39;s because it is. One must be extremely careful implementing “peppers” because it can lead to <a href="https://en.wikipedia.org/wiki/Length_extension_attack" rel="nofollow">length extension attacks</a> and <a href="https://blog.ircmaxell.com/2015/03/security-issue-combining-bcrypt-with.html" rel="nofollow">nasty problems with Bcrypt.</a></p>

<p>Argon2 actually implements a <code>secret value</code> in the official spec as an optional argument to act as a “pepper”. If you&#39;re using an implementation that does not support the <code>secret value</code>, <strong>encrypt the hash.</strong> If you&#39;re not using Argon2, <strong>encrypt the hash.</strong></p>

<p>Do not waste your time implementing both a “pepper” and encrypting the hash. You gain no practical benefit. And you might want to store your cryptographic secrets in a <a href="https://en.wikipedia.org/wiki/Hardware_security_module" rel="nofollow">hardware security module.</a></p>

<h2 id="use-a-reasonable-policy">Use a Reasonable Policy</h2>
<ul><li>Maximum length of <em>no less</em> than 128 characters.</li>
<li>Minimum length of 12 or 16 characters.</li>
<li>Support almost if not all unicode and whitespace.</li>
<li>Decline known passwords via <a href="https://haveibeenpwned.com/API/v3" rel="nofollow">HIBP API</a>.</li>
<li>Decline passwords matching the identifier, e.g: email, username.</li>
<li>Don&#39;t enforce special characters, uppercase, lowercase, symbols, etc.</li>
<li>Don&#39;t truncate, sanitize, or format their passwords in any way shape or form!</li>
<li>Don&#39;t prevent them from copying and pasting into the password fields.</li>
<li>Don&#39;t limit what they can or cannot put into the password fields.</li>
<li>Don&#39;t require password changes every so often.</li></ul>

<p>What matters most, is the length and entropy. If you feel still inclined to enforce the character set above, don&#39;t. <strong>Enforce multi-factor authentication instead,</strong> their accounts will be far better with it.</p>

<p>If you enforce that character set, you run the risk of them writing it down, forgetting it, annoying them, or choosing a weak password. You can also cause users to write down their passwords if you enforce password changes.</p>

<h3 id="finally-encourage-good-practices">Finally Encourage Good Practices</h3>

<p>Encourage the use of <a href="http://world.std.com/~reinhold/diceware.html" rel="nofollow">diceware</a>, <a href="https://www.useapassphrase.com/" rel="nofollow">passphrases</a>, password managers (like <a href="https://bitwarden.com/" rel="nofollow">BitWarden</a>), and multi-factor authentication(<a href="https://fidoalliance.org/" rel="nofollow">FIDO</a> and <a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm" rel="nofollow">TOTP</a>).</p>

<p>Discourage passwords with personal information like names, dates, birthdays, etc. Or sharing them if at all possible.</p>
]]></content:encoded>
      <guid>https://wordsmith.social/nathilia-pierce/how-to-process-passwords-as-a-software-developer</guid>
      <pubDate>Sat, 19 Oct 2019 09:14:44 +0000</pubDate>
    </item>
  </channel>
</rss>