/// <summary> /// Creates the NTLM Hash of the specified password. /// </summary> /// <param name="password">The password to create the NTLM hash of.</param> /// <returns>The NTLM hash for the specified password.</returns> /// <exception cref="ArgumentNullException">Thrown if the password /// parameter is null.</exception> private static byte[] NtlmHash(string password) { password.ThrowIfNull("password"); byte[] data = Encoding.Unicode.GetBytes(password); using (MD4 md4 = new MD4()) { return(md4.ComputeHash(data)); } }
/// <summary> /// Creates the NTLM Hash of the specified password. /// </summary> /// <param name="password">The password to create the NTLM hash of.</param> /// <returns>The NTLM hash for the specified password.</returns> /// <exception cref="ArgumentNullException">Thrown if the password /// parameter is null.</exception> private static byte[] NtlmHash(String password) { password.ThrowIfNull("password"); byte[] data = Encoding.Unicode.GetBytes(password); using (MD4 md4 = new MD4()) { return md4.ComputeHash(data); } }