, 7 tweets, 2 min read
My Authors
Read all threads
Periodic reminder that you should NEVER use MD5 or SHA1 in any new project/system.

What to use:
- Password hashing: argon2i
- Cryptographically secure hashes (most usecases): BLAKE2 (fastest) or SHA3 (if needed for compatibility)
- Non-CS hashes: xxhash (faster than MD5)
Q: When do you need a cryptographically secure hash function?
A: When an attacker tampering with it in *any* way would cause a security issue. That's almost always, *including* for file deduplication on shared systems.

Q: What about scrypt/bcrypt?
A: Okay if needed for compat.
Q: What about PBKDF2?
A: It's easy to unknowingly misuse, so it's best to avoid it. If absolutely *needed* for compatibility, it can be an acceptable option. But only with a secure digest function, not MD5/SHA1!
Q: But I think MD5 is fine here, because it's only broken in a specific way!
A: When *any* security property gets broken, that means the original design made a wrong assumption, and more breaks will follow. Why bother with MD5 anyway, when BLAKE2 is faster *and* more secure?
Q: So if I want fast hashing, I should use xxhash?
A: No. You should *only* use xxhash (or a similar non-CS hashing function) if you are *very sure* that you do not need cryptographic security. If you're doing anything related to security at all, you need a CS hash, not xxhash.
Another addendum:

Design your systems so that you can change the hashing function later, when the one you've used gets broken.

However, *do not* trust any user input to tell you what function to use, or you'll end up making the same mistake as JWT/JOSE: paragonie.com/blog/2017/03/j…
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Sven Slootweg @ 36C3

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!