Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    Client-side hashing can prevent an application from accidentally logging the password. Commented Feb 15, 2024 at 13:32
  • Yes, that would be an example for the short window between receiving and hashing the password on the server. However, this still only helps protecting other application when the client has made the major mistake of reusing the password. For the current application, the client-side hash is just as useful for attackers as the original password. Commented Feb 15, 2024 at 13:45
  • @Ja1024 thank you, great answer. The only thing that confuses me is the password-based key derivation terminology. Isn't every hashing algorithm that? It just uses some password and creates a kind of hash/key from that. Or how is a key differnet from a hash? Commented Feb 15, 2024 at 14:36
  • A key in this context means a key for an encryption algorithm (or some other keyed algorithm like a message authentication code). Since different algorithms have different key lengths, a generic hash algorithm which produces a fixed-length output like SHA-256 is unsuitable for key generation. It's also unsuitable for password hashing due to its high performance. On the other hand, an algorithm originally meant for deriving keys from passwords can also be used for password hashing, because it's computationally expensive by design (to prevent brute-force attacks). Commented Feb 15, 2024 at 15:04
  • @Ja1024 But Argon2 was not originally meant to derive keys from passwords right? Because in your initial answer you say that pbkdf2 should be replaced with more modern algorithms such as Argon2, but if we say the web crypto API standardizes Argon2, would PBKDF2 not still be more suitable if I wanted to first transform the password into a key on the client side and then hash that derived key later on with argon2 on the server? Or is hashing two times with Argon2 more beneficial? So argon2.hash(argon2.hash(value)) Sorry if these comments are stupid, but I find some stuff a bit confusing Commented Feb 15, 2024 at 15:38