<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python code for fingerprint generation in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54154#M29178</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After considerable trial and error, I find that the following appears to produce the same output as the PHP version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import hmac&lt;BR /&gt;def HMAC(key,data):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(hmac.new(data,key).hexdigest())&lt;/P&gt;</description>
    <pubDate>Sat, 26 Mar 2016 03:38:51 GMT</pubDate>
    <dc:creator>gpetty</dc:creator>
    <dc:date>2016-03-26T03:38:51Z</dc:date>
    <item>
      <title>Python code for fingerprint generation</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54152#M29176</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using PHP&amp;nbsp; for a transaction posted to the SIM gateway, fingerprint generation is based on the following function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;function hmac ($key, $data)&lt;BR /&gt;{&lt;BR /&gt;return (bin2hex (mhash(MHASH_MD5, $data, $key)));&lt;BR /&gt;}&lt;/DIV&gt;&lt;P&gt;Not being very familiar with either PHP or hash functions, I'm hoping someone can tell me what the equivalent Python code is to generate a valid fingerprint (presumably using the hashlib module).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2016 02:50:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54152#M29176</guid>
      <dc:creator>gpetty</dc:creator>
      <dc:date>2016-03-26T02:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python code for fingerprint generation</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54154#M29178</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After considerable trial and error, I find that the following appears to produce the same output as the PHP version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import hmac&lt;BR /&gt;def HMAC(key,data):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(hmac.new(data,key).hexdigest())&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2016 03:38:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54154#M29178</guid>
      <dc:creator>gpetty</dc:creator>
      <dc:date>2016-03-26T03:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python code for fingerprint generation</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54160#M29182</link>
      <description>&lt;P&gt;The code posted previously needs to be corrected to reverse the order of the arguments to hmac.new().&amp;nbsp; The following is what I'm now using successfully in my Python-based interface to the gateway:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import hmac
def HMAC(key,data):
    return(hmac.new(key,data).hexdigest())&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Mar 2016 14:26:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Python-code-for-fingerprint-generation/m-p/54160#M29182</guid>
      <dc:creator>gpetty</dc:creator>
      <dc:date>2016-03-28T14:26:42Z</dc:date>
    </item>
  </channel>
</rss>

