If I want to protect myself from implementation of algorithm issues and inherent design flaws of algorithms in password hashing, what would be most secure way to combine two hashes?
- bcrypt(pbkdf2(pw))
- pbkdf2(bcrypt(pw))
- f, l = split(pw); pw = bcrypt(f) + pbkdf2(l) # loses entropy, bad
- pw = bcrypt(pw) + pbkdf2(pw) ## one broken, both broken, particularly bad
Something else? Should I do variation of 1-2 where I'll add entropy?
Why isn't this common/best-practice when storing user data in databases? Using any single hash algorithm seems risky when you combine implementation + design risks. Using SHA seems odd choice, as it's designed to be fast.
Seems odd that end-user needs to think about this and figure out safe way to store PWs.
I don't want to make perfect-world bcrypt or perfect-world pbkdf2 better by this means, I simply want to assume that there are scenarios where in particular environment one of them may be bad to begin with at least. Or in future one of them is found to be not as nearly secure as it was thought to be, giving me safety margin to migrate to another combo of hashes, without going into panic mode.