title: HMAC sha256 returning different values in c# than python
body: <p>I need to port some python code into c# and I'm having some trouble with this line:</p>
  
  <blockquote>
    <p>Python</p>
  </blockquote>
  
  <pre><code>hmac.new(key, message,digestmod=hashlib.sha256).digest()
  </code></pre>
  
  <blockquote>
    <p>C#</p>
  </blockquote>
  
  <pre><code>HMACSHA256 hm = new HMACSHA256(key);
  byte[] result = hm.ComputeHash(enc.GetBytes(message));
  </code></pre>
  
  <p>Why am I getting a different result in C# when key and message are the same (checked byte-by-byte) ? </p>