title: recreating pythons werkzeug.security generate_password_hash in C#
body: <p>Seems simple enough, and there are plenty of examples but I just can't seem to get hashes that verify with werkzeug.security's check_password_hash in python.</p>
  <pre><code>    private string Generate_Passwd_Hash()
      {
          string _password = &quot;Password&quot;;
          string _salt = &quot;cXoZSGKkuGWIbVdr&quot;;
          SHA256 MyHash = SHA256.Create();
          byte[] hashable = System.Text.Encoding.UTF8.GetBytes(_salt + _password);
          byte[] resulthash = MyHash.ComputeHash(hashable);
  
          return &quot;sha256$&quot; + _salt + &quot;$&quot; + BitConverter.ToString(resulthash).Replace(&quot;-&quot;, &quot;&quot;).ToLower();
      }
  </code></pre>
  <p>this should generate;<br>
  sha256$cXoZSGKkuGWIbVdr$7f5d63e849f0a2c0c5c2bd6ae4e45ead2ac730c853a1ed3460e227c06c567f49<br>
  but doesn't.</p>
  <p>EDIT<br>
  Reading through the python code for generate_password_hash and it has a default number of iterations of 260000.  Which is probably what I'm missing.</p>