title: API Signature using MD5 has as key for sha256
body: <p>I'm trying to use Python to access the trading API at coinnest.co.kr, a cryptocurrency exchange. To do this I must follow the documentation found here: <a href="https://www.coinnest.co.kr/doc/private.html" rel="nofollow noreferrer">https://www.coinnest.co.kr/doc/private.html</a></p>
  <blockquote>
  <p>We get a key pair of public key: asdf-asdf-asdf-asdf and private key: qwer-qewr-qwer-qwer.</p>
  <p>The request parameters are:</p>
  </blockquote>
  <pre><code>&quot;key&quot;:&quot;asdf-asdf-asdf-asdf&quot;,
  &quot;nonce&quot;:1505209177,
  &quot;coin&quot;:&quot;btc&quot;,
  &quot;id&quot;:3
  </code></pre>
  <blockquote>
  <p>Then the string to be signed will be:</p>
  </blockquote>
  <pre><code>key=asdf-asdf-asdf-asdf&amp;nonce=1505209278&amp;coin=btc&amp;id=3
                  
  </code></pre>
  <blockquote>
  <p>Now we use the md5 hash of qwer-qewr-qwer-qwer as the key and encrypt the above string by sha256 and we get 66b2935f3ba82a4a17074d439adab1043a63df4a177af68fe76a3f4f350ef55d, which will be used as the signature.</p>
  </blockquote>
  <p>My current issue is that I am unable to get the same result as the example.  I am unsure if their example is accurate.  Is the private key &quot;qwer-qewr-qwer-qwer&quot; or &quot;qwer-qwer-qwer-qwer&quot;. Is the nonce &quot;1505209177&quot; or &quot;1505209278&quot;?</p>
  <pre><code>#!/usr/bin/python2.7
  import hashlib
  import hmac
  
  secret = 'qwer-qewr-qwer-qwer'
  message = 'key=asdf-asdf-asdf-asdf&amp;nonce=1505209278&amp;coin=btc&amp;id=3'
  key = hashlib.md5(secret).hexdigest()
  print hmac.new(key, message, hashlib.sha256).hexdigest()
  </code></pre>
  <p>Using the code above, I obtain a signature of <code>&quot;afdfb1c331670d95c93868948ff769719b28d879ac94589fa44c4d5b8eacab04&quot;</code> versus the expected result of
  <code>&quot;66b2935f3ba82a4a17074d439adab1043a63df4a177af68fe76a3f4f350ef55d&quot;</code></p>