5 ms·
This is a common misconception, but a "global salt" isn't actually a salt. Not sure what a "basic salt" is though. > A new salt is randomly generated for each
by judofyr 13y ago
This is a common misconception, but a "global salt" isn't actually a salt. Not sure what a "basic salt" is though.
> A new salt is randomly generated for each password. In a typical setting, the salt and the password are concatenated and processed with a cryptographic hash function, and the resulting output (but not the original password) is stored with the salt in a database.
http://en.wikipedia.org/wiki/Salt_%28cryptography%29 http://en.wikipedia.org/wiki/Salt_%28cryptography%29
- aw3c2 13y agoAh, I did not know that. And I wrote some password hashing with a global salt myself. So I stand by my comment with "one laughing and one crying eye". I thought salts were mostly against precomputed rainbow tables for specific hash functions, but of course if my hashes are valuable enough, a global salt makes cracking them easier than if I used a random/unique one per hash.
- sillysaurus2 13y agoThis is why programmers should stop trying to write their own password systems.
- amenod 13y agoTo be exact, programmers should stop using their own password systems (unless - well, let's not go there :). Writing them is actually an excellent exercise, and humbling one too. Especially if you show your code to some skilled hacker / security expert.
- jtheory 13y agoFrom what I understand rainbow tables are not really used anymore -- they were useful when it took longer to calculate hashes, but nowadays you just need a decent graphics card to calculate a few billion hashes (MD5 or SHA1) PER SECOND. Per-hash salts don't really slow that down at all, unfortunately. Short-version: don't use the hash algorithms that are designed to be fast for protecting sensitive data; use something solid with a work factor instead.
- jwilliams 13y agoPepper is the more common term I've seen for a global salt - although I've never seen it implemented independently of a salt.
- oliwary 13y agoIsn't there value in having a long global salt to make bruteforcing harder in case the database but not the server code is compromised, though?
- judofyr 13y agoThink about it like this: Using a SHA256 + global salt is nothing different from using SHA256 with a different set of constants/initial values.
- oliwary 13y agoTrue, but if the global salt is secret, it'll at least make it slightly harder for the attacker to figure out the password. For example, if the password is "a" and an unique salt is available in the database, it'll be trivial to brute force. If the password function is something like this, however: sha256("longsalt" + password + salt) the attacker will first have to figure out longsalt which can be slow if it's long. Or am I completely mistaken?
- Buge 13y agoBut if hackers can break in and steal your database, they'll probably also be able to steal the global salt.
- 13y ago