3 ms·
In "olden times" (I guess around the fourth empire), common wisdom was to hash like this: salt = getLongRandomString(); hash = sha256(salt+password); save_in_d
by mseebach 17y ago
In "olden times" (I guess around the fourth empire), common wisdom was to hash like this:
salt = getLongRandomString(); hash = sha256(salt+password); save_in_db = salt+"$"+hash
Thus, while you don't publish them, salts aren't "secret". That's based on the assumption that a cracker would have to bruteforce each password in turn, and that takes too much time.
But no, you can't re-hash with a new salt without access to the plain-text password. If you could, so could the bad guy :)
Disclaimer: IANAC, and if I were building security for mission critical stuff, I'd ask someone who was.
- bengiuliano 17y agoBut no, you can't re-hash with a new salt without access to the plain-text password. If you could, so could the bad guy :) Yes you can, if you believe this: http://benlog.com/articles/2008/06/19/dont-hash-secrets/ http://benlog.com/articles/2008/06/19/dont-hash-secrets/ This is exactly why HMAC is more complicated than just: hash(message+secret)
- tptacek 17y agoIt's H(k, m) that's trivial to break, not H(m, k) (where the attacker has no control over the final block of the hash). H(m, k) is also much weaker than HMAC, but in trickier ways.