You're Probably Storing Passwords Incorrectly

a href="http://en.wikipedia.org/wiki/Crypt_"http://en.wikipedia.org/wiki/Crypt_/a(Unix) talks about some salted password system commonly used in UNIX-like systems.

The one currently used in Linux and some of the BSDs is the salted MD5 system mentioned on that page.

As Wikipedia puts it:
"First the passphrase and salt are hashed together, yielding an MD5 message digest. Then a new digest is constructed, hashing together the passphrase, the salt, and the first digest, all in a rather complex form. Then this digest is passed through a thousand iterations of a function which rehashes it together with the passphrase and salt in a manner that varies between rounds. The output of the last of these rounds is the resulting passphrase hash.

The fixed iteration count has caused this scheme to lose the computational expense that it once enjoyed. Variable numbers of rounds are now favoured."

(The article does not explain how you would determine the variable numbers the last sentence refers to).

If you ever look at a hashed unix password that uses this system, it looks something like this: $1$RsDzxp4K$y6ARJtx/TRDYnPWp.3vGy/
Which is broken down as follows:
$1$ = Tells the crypt() system call that this is using the algorithm mentioned above
RsDzxp4K = The salt
$ = salt/password delimiter
y6ARJtx/TRDYnPWp.3vGy/ = password hash
(for the record, the password was “test”)