4 ms·
I'm floored by the amount of people with "fancy" titles from supposed "consulting" companies in the link discussion. The question was "I want to store password
by Alupis 12y ago
I'm floored by the amount of people with "fancy" titles from supposed "consulting" companies in the link discussion.
The question was "I want to store password[s] in encrypted form." The answer should have been immediately -- "you don't encrypt passwords, you hash passwords using a well known, established, and tested cryptographic hashing algorithm + a salt, damnit!"
- sarciszewski 12y agoYeah, I attempted to do that (politely) with my first post. Though I made a few mistakes (it's password_hash() not hash_password()). As the discussion grew on, I became less nice.
- Alupis 12y agoI saw that -- but then a bunch of "titles" came in and flooded the discussion with the worst possible advice. I mean, seriously, have these guys been living under a rock? This is (well, should be) common sense by now.
- sarciszewski 12y agoHeh. And they all probably get paid a heck of a lot more than I do too. Oi. :]
- farmdve 12y agoNot to mention that encryption means being able to take some input and generate what appears to be a random sequence of characters,numbers etc, but being able to transform it back to plaintext/original format by using the corresponding decryption key. Indeed too many people there failed.
- owenmarshall 12y ago> The answer should have been immediately -- "you don't encrypt passwords, you hash passwords using a well known, established, and tested cryptographic hashing algorithm + a salt, damnit!" Your answer is as wrong as anything posted on that discussion. The correct answer is that you don't encrypt passwords. You also don't hash passwords with a salt. Instead, you use a key derivation function such as PBKDF2, bcrypt, or scrypt.
- sarciszewski 12y agohttps://github.com/defuse/password-hashing/issues/39#issuecomment-52799173 https://github.com/defuse/password-hashing/issues/39#issueco... "Therefore all KDF functions are cryptographic hash functions. All hash functions are not KDFs, due to speed."
- owenmarshall 12y ago"Cryptographic hash" has been used to refer to non-invertable hash functions since the late 70s. Using that term to refer to a KDF is exceptionally misleading and foolish. If you gave that answer to those PHP developers, they'd come out thinking MD5 and a salt would Work Just Fine.
- sarciszewski 12y agoPoint of order: The post you replied to was not "as wrong" as the participants in that forum ;)
- owenmarshall 12y agoA KDF, as your link notes, meets all the properties of a cryptographic hash. The important property it has that other non-cryptographic hashes do not have is speed (actually, a lack thereof) and (typically) the ability to tune that speed. If we want "technically correct" points I won't grant them (;-)) because KDFs have a property (slowness) cryptographic hashes do not. It would be technically correct to state that KDFs are strict supersets of cryptographic hashes. Practically speaking, calling a KDF a cryptographic hash is very harmful because the average programmer doesn't have the understanding to make the distinction. It's important to give them two very clearly separated categories - cryptographic hashes are {SHA1, RIPEMD160, ...} and are FAST, KDFs are {scrypt, bcrypt, ...} and are SLOW - and a clear rule that "you MUST always use a KDF to store passwords". If you blur the lines between the two, the average programmer will misunderstand and use the wrong tool for the job.
- 12y ago
- DanBC 12y ago> I'm floored by the amount of people with "fancy" titles from supposed "consulting" companies in the link discussion. I'm gently curious if black hats will now target some of those companies? Or are there enough low-hanging fruit available from www searches for them to not worry?
- danielweber 12y agoIn many lines of work, it's more important to be visible than to be correct.