crypt is used to generate password hashes with a salt:
perl -e ‘print crypt(“password”, “\$6\$somesalt”) . “\n”‘
Generating ASP.NET password hashes
HashAlgorithm _algorithm = null;
private string EncodePassword(string pass, string salt)
{
_algorithm = HashAlgorithm.Create("SHA1");
byte[] bytes = Encoding.Unicode.GetBytes(pass);
byte[] src = Convert.FromBase64String(salt);
byte[] dst = new byte[src.Length + bytes.Length];
byte[] inArray = null;
Buffer.BlockCopy(src, 0, dst, 0, src.Length);
Buffer.BlockCopy(bytes, 0, dst, src.Length, bytes.Length);
inArray = _algorithm.ComputeHash(dst);
return Convert.ToBase64String(inArray);
}