Here is the text of the NIST sp800-63b Digital Identity Guidelines.

  • Amanduh@lemm.ee
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 months ago

    Can you elaborate further? Why would someone want to truncate passwords to begin with?

    • essteeyou@lemmy.world
      link
      fedilink
      English
      arrow-up
      23
      ·
      2 months ago

      To save a few megabytes of text in a database somewhere. Likely the same database that gets hacked.

      • orclev@lemmy.world
        link
        fedilink
        English
        arrow-up
        28
        ·
        2 months ago

        Which shouldn’t even matter because passwords are salted and hashed before storing them, so you’re not actually saving anything. At least they better be. If you’re not hashing passwords you’ve got a much bigger problem than low complexity passwords.

        • essteeyou@lemmy.world
          link
          fedilink
          English
          arrow-up
          32
          ·
          2 months ago

          The place that truncates passwords is probably not the place to look for best practices when it comes to security. :-)

          • orclev@lemmy.world
            link
            fedilink
            English
            arrow-up
            6
            arrow-down
            1
            ·
            2 months ago

            Hashing passwords isn’t even best practice at this point, it’s the minimally acceptable standard.

              • pivot_root@lemmy.world
                link
                fedilink
                English
                arrow-up
                8
                ·
                edit-2
                2 months ago

                Use a library. It’s far too easy for developers or project managers to fuck up the minimum requirements for safely storing passwords.

                But, if you are wanting to do it by hand…

                • Don’t use a regular hashing algorithm, use a password hashing algorithm
                • Use a high iteration count to make it too resource-intensive to brute force
                • Salt the hash to prevent rainbow tables
                • Salt the hash with something unique to that specific user so identical passwords have different hashes
                • Laser@feddit.org
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  2 months ago

                  Salt the hash with something unique to that specific user so identical passwords have different hashes

                  Isn’t that… the very definition of a Salt? A user-specific known string? Though my understanding is that the salt gets appended to the user-provided password, hashed and then checked against the record, so I wouldn’t say that the hash is salted, but rather the password.

                  Also using a pepper is good practice in addition to a salt, though the latter is more important.

                  • frezik@midwest.social
                    link
                    fedilink
                    English
                    arrow-up
                    4
                    ·
                    2 months ago

                    Some implementers reuse the same salt for all passwords. It’s not the worst thing ever, but it does make it substantially easier to crack than if everything has its own salt.

            • frezik@midwest.social
              link
              fedilink
              English
              arrow-up
              2
              arrow-down
              1
              ·
              edit-2
              2 months ago

              Sorta. Not really.

              Key derivation algorithms are still hashes in most practical ways. Though they’re derived directly from block ciphers in most cases, so you could also say they’re encrypted. Even though people say to hash passwords, not encrypt them.

              I find the whole terminology here to be unenlightening. It obscures more than it understands.

              • orclev@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                2 months ago

                A KDF is not reversible so it’s not encryption (a bad one can be brute forced or have a collision, but that’s different from decrypting it even if the outcome is effectively the same). As long as you’re salting (and ideally peppering) your passwords and the iteration count is sufficiently high, any sufficiently long password will be effectively unrecoverable via any known means (barring a flaw being found in the KDF).

                The defining characteristic that separates hashing from encryption is that for hashing there is no inverse function that can take the output and one or more extra parameters (secrets, salts, etc.) and produce the original input, unlike with encryption.

                • frezik@midwest.social
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  edit-2
                  2 months ago

                  OK. How do you reconcile that with “Hashing passwords isn’t even the best practice at this point”? Key derivation functions are certainly the recommended approach these days. If they are hashes, then your earlier post is wrong, and if they aren’t hashes, then your next post was wrong.

                  • orclev@lemmy.world
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    2 months ago

                    The rest of that sentence is important. Hashing passwords is the minimum practice, not best practice. You should always be at least hashing passwords. Best practice would be salting and peppering them as well as picking a strong hashing function with as high a number of iterations as you can support. You would then pair that with 2FA (not SMS based), and a minimum password length of 16 with no maximum length.

      • frezik@midwest.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 months ago

        Lots of older databases had fixed length fields, and you had to pad it if it was smaller. VARCHAR is a relatively new thing. So it’s not just saving space, but that old databases tended to force the issue.

        Nobody has an excuse today. Even Cobol has variable length strings.