3 ms·
This is silly, true, but "you are not a cryptographer, use bcrypt" is not helpful. You could design an equally silly password hashing scheme using pbkdf2 and bc
by oconnore 14y ago
This is silly, true, but "you are not a cryptographer, use bcrypt" is not helpful. You could design an equally silly password hashing scheme using pbkdf2 and bcrypt, the recommended alternatives:
sillysalt(user):=user+date+mersenne_twister()
sillykdf(user,password):=pbkdf2(sillysalt($user)+
shuffle(bcrypt($password)))
persist( sillysalt($user)+":"+$outer_pbkdf2_salt+":"+
$inner_bcrypt_salt+":"+sillykdf($user,$password))
A scheme like this is designed to thwart offline attacks on the password verifier (for example, an attacker acquires a dump of your database).
His user+date+mersenne salt accomplishes the goal of (mildly) increasing the cost of precomputed attacks. He should use a CSRNG instead.
He uses existing cryptographic hash algorithms, SHA1 and MD5.
His shuffling does not add or detract from the security of the scheme.
He does not perform any significant key strengthening. Weak (most) passwords will be very cheap to brute force.
- yread 14y agoCan you, please, explain why passwords will be cheap to brute force? He is bcrypting them and the attacker will have to bcrypt them as well, or not? How should it be done (in the context of your example) done properly?
- oconnore 14y agoSorry that was not clear. I was referring to his SHA1/MD5 version. My version is not cheap to brute force, but it is silly.
- marshray 14y ago> His user+date+mersenne salt accomplishes the goal of (mildly) increasing the cost of precomputed attacks. Most password crackers these days are using GPUs and don't even bother with precomputed rainbow tables. So the salt is not increasing their cost at all.
- oconnore 14y agoYou didn't actually disagree with what I wrote. What you wrote is also true.