|
|
|
|
|
by tptacek
3301 days ago
|
|
The word "safe" isn't doing us any favors here. What we're really talking about is the "security margin" of the different hashes. Every hash we're talking about on this thread has a margin far beyond any plausible or foreseeable attacks. None are unsafe. |
|
On the one hand, we (rightly, in my opinion) teach people who haven't studied cryptography that they shouldn't try to implement it on their own. This is good, because cryptography is mostly applied math (hard) and careful software implementation (also hard), and mixing these two hard things without shooting yourself in the foot is very hard.
On the other hand, developers who follow this advice don't have a clear way to find the answer to questions like, "Which of these great algorithms do I want?" It's easy to find sound recommendations for which algorithms are well-studied and essentially safe; it's less easy to find guides that compare and contrast algorithms along nuanced axes like computational cost, interoperability, security margin or adaptability.
This leads developers to come to their own conclusions based on imperfect understanding of the metrics they can quantify:
"I need to encrypt something - Serpent has a much higher security margin than AES (Rijndael), I should probably go with that."
"I need to hash something - Keccak won the SHA-3 contest, so I should use that instead of BLAKE."
"I need to authenticate something - if I choose two strong algorithms it will be better than one, so I'll use AES-CTR and HMAC-SHA, instead of an AEAD."
"More bits means higher security, so I'll use AES256 and SHA-512."
I'm noticing this more and more in online discussion, where people seem to be talking past each other about things like the "safety" of algorithms without discriminating between other metrics like speed. In my opinion, it would be better for people to consider "safety" as a mostly binary property if they haven't done enough due diligence to know why one algorithm has a higher or lower security margin than another one, because the other metrics are so much more important.
There probably needs to be better cryptography education as well, something that is a bit higher than "do this, don't do this" and which provides some elaboration about the whys inherent to different security margins.