This function crypts a password with an algorithm based on MD5 hashing.
If salt is left out, an 8 character long salt (max length) will
be randomized.
Verification can be done by supplying the crypted password as salt:
crypt_md5(typed_pw, crypted_pw) == crypted_pw