Re: Confused by salt



On 28 May 2007 15:00:25 -0700, ianpiper@xxxxxxxxx wrote:

Hi all,

I hope someone can help clear my confusion. I wrote a program some
time back that used a hash function to store a password. Someone
advised me that I really ought to use a salt with this in order to add
greater security. Having done some reading I am a bit confused. I
understand the principle of adding a number of random characters to
the string before hashing it in order to increase its security. What
confuses me is how you then store the salt in such a way that you can
use it but the bad guys can't. I read somewhere that you can just
store the salt in plain text along with the hashed salted password,
but then surely that defeats the object - your attacker just needs to
prepend or append any dictionary words with that salt and hash the
result before comparing to your stored password. But if you encrypt
the salt, you need a key to decrypt it.

Any illumination greatly welcomed.


Ian.

Roger Schlafly describes it fairly clearly.

If your password is strong, and hard to guess, and the hash is
cryptograhically strong, then adding a random salt to the password,
hashing that value, and prepending the plain salt to the hash is good.

You can have a million representations of the exact same passphrase
that look different and for all intents and purposes are different.

Storing the salt in plain view gives the attacker nothing extra
special, and makes them do the work without cutting corners.

It thwarts pattern recognition.

Salting is an aspect of simple crypto that works.

.



Relevant Pages

  • Re: Hidden Application Data
    ... The reason I want to hide the user's credentials is not from the user ... If you must keep things locally then do not store the ... For a new application you should use SHA-256 as the hash. ... cryptographic salt seehttp://en.wikipedia.org/wiki/Salt_. ...
    (microsoft.public.dotnet.languages.csharp)
  • Confused by salt
    ... I hope someone can help clear my confusion. ... time back that used a hash function to store a password. ... advised me that I really ought to use a salt with this in order to add ...
    (sci.crypt)
  • Re: Hashed password secure?
    ... > would be comparing hash values of keyand this hash value would be ... What if I were to salt the password with N bits and *NOT* store the ... second average to check whether a password is correct? ...
    (sci.crypt)
  • Re: Hidden Application Data
    ... How can I store my application's data in a hidden way? ... username/password but instead store a cryptographic hash of the ... For extra security use some random salt as well. ... For a new application you should use SHA-256 as the hash. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Hashed password secure?
    ... ]> would be comparing hash values of keyand this hash value would be ... ]What if I were to salt the password with N bits and *NOT* store the ... ]can store 65,536 numbers in 16 bits). ... ]attacks, the PC would check all 65,536 Salts anyway. ...
    (sci.crypt)