Python hmac (sha1) calculation
<p>I am trying to calculate the HMAC-SHA1 value in Python, but results don't match with the standard tool I am using as reference (openSSL):</p>

<p><strong>Python</strong></p>

<pre><code>k = "ffffffffffffffffffffffffffffffff"
m = "ffffffffffffffffffffffffffffffff"
key = k.decode("hex")
msg = m.decode("hex")
print xlong(hmac.new(key, msg=msg, digestmod=hashlib.sha1).digest())
</code></pre>

<p>Result: <code>801271609151602865551107406598369208989784139177</code></p>

<p><strong>OpenSSL</strong></p>

<pre><code>echo -n ‘ffffffffffffffffffffffffffffffff’ | xxd -r -p | openssl dgst -sha1 -mac HMAC -macopt hexkey:ffffffffffffffffffffffffffffffff
</code></pre>

<p>Result: <code>8c5a42f91479bfbaed8dd538db8c4a76b44ee5a9</code></p>