Hello XXXX@XXXXX.COM ,
first of all - you are mixing some terms here
Encryption - the term salt isn't commonly used here, you may think of an
IV (initialization vector) which is used to start a feedback chain when using
but i think you really mean hashing (e.g. for passwords) -
salted hashes are : H(salt+password)
reasons for salting
a) you are not leaking information, e.g. if alice and bob have the same password
- the resulting hash would be the same - not with salted hashes
b) there a tables of pre-computed hashes, so e.g. you encounter a hashed
password of "HJK)((bbnmm" - all you have to do is, look up that table for
the hash and retrieve the clear text value. If you use salted hashes, you
cannot use pre-computed tables, but have to calculate the hash on each try.
this takes time.
By using PasswordDeriveBytes with a high iteration count, you even raise
a) the attacked does not know the iteration count from looking at the hash
b) it takes even longer now to mount brute force/dictionary attacks - say
a simple hash needs 1 ms - and a iterated hash 1 s to calculate - this makes
password guessing really infeasible
this all depends of course on the password complexity and the computing power
the attackers has at his disposal.
you are basically buying time.
That said - go for salted, iterated hashes by using PasswordDeriveBytes -
or even better the new .NET 2.0 Rfc2898DeriveBytes class.
Dominick Baier - DevelopMentor