<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>ShortFusion Blog - LinkShare</title>
			<link>http://blog.shortfusion.com/index.cfm</link>
			<description>Furious Coding</description>
			<language>en-us</language>
			<pubDate>Thu, 09 Sep 2010 14:08:47 -0500</pubDate>
			<lastBuildDate>Fri, 21 Nov 2008 00:26:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>alex@shortfusion.com</managingEditor>
			<webMaster>alex@shortfusion.com</webMaster>
			<itunes:subtitle>Jason&apos;s acronym to go here</itunes:subtitle>
			<itunes:summary>Coldfusion, Flex and more tech blog</itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords>Shortfusion Blog</itunes:keywords>
			<itunes:author>ShortFusion (Alex Frates &amp; Jason Olmsted)</itunes:author>
			<itunes:owner>
				<itunes:email>alex@shortfusion.com</itunes:email>
				<itunes:name>ShortFusion (Alex Frates &amp; Jason Olmsted)</itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>ShortFusion Blog</title>
				<link>http://blog.shortfusion.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>ColdFusion HMACMD5 function</title>
				<link>http://blog.shortfusion.com/index.cfm/2008/11/21/ColdFusion-HMACMD5-function</link>
				<description>
				
				&lt;more&gt;
&lt;p&gt;Several months ago, we were integrating our LinkShare affiliate program with our ColdFusion based e-commerce system. During that process, while preparing an MD5 encrypted HMAC message signature for transmitting transaction data to our affiliate tracking account, we encountered a problem with the included encryption algorithms in CF8.&lt;/p&gt;
&lt;/more&gt;

&lt;p&gt;Even though the enterprise version of CF8 includes the hmacmd5 encryption library, we couldn&apos;t get it to work, so we reverted to a Java-based implementation wrapped in a function inside one of our Utils CFC&apos;s.&lt;/p&gt;


&lt;p&gt;Here&apos;s how we did it&lt;/p&gt;

&lt;h2&gt;HMAC MD5 Encryption Function&lt;/h2&gt;
&lt;p&gt;Place this function inside a Utilities CFC or similar, or use as an UDF&lt;/p&gt;
&lt;code&gt;
&lt;cffunction name=&quot;HMACMD5&quot; returntype=&quot;string&quot; access=&quot;public&quot; hint=&quot;Returns an MD5 encrypted message&quot;&gt;
		&lt;!--- You may choose the format of your output ---&gt;
        &lt;cfargument name=&quot;message&quot; type=&quot;String&quot; required=&quot;true&quot;&gt;
		&lt;cfargument name=&quot;key&quot; type=&quot;String&quot; required=&quot;true&quot;&gt;
		&lt;cfargument name=&quot;outputFormat&quot; type=&quot;string&quot; required=&quot;false&quot; default=&quot;String&quot; hint=&quot;String,base64,uBase64&quot;&gt;

		&lt;cfset var myMessageString = arguments.message &gt;
		&lt;cfset var myMessageByteArray = myMessageString.getBytes()&gt;

		&lt;cfset var myKey = arguments.key&gt;
		&lt;cfset var myKeyByteArray = myKey.getBytes()&gt;

		&lt;cfscript&gt;

		key = CreateObject(&quot;java&quot;,&quot;javax.crypto.spec.SecretKeySpec&quot;);
		key.init(myKeyByteArray,&quot;HmacMD5&quot;);

		hmac = CreateObject(&quot;java&quot;,&quot;javax.crypto.Mac&quot;);
		hmac = hmac.getInstance(&quot;HmacMd5&quot;);
		hmac.init(key);

		hmac.update(myMessageByteArray);

		hmac = hmac.doFinal();

		&lt;/cfscript&gt;
		
		&lt;cfswitch expression=&quot;#arguments.outputFormat#&quot;&gt;
			&lt;cfcase value=&quot;base64&quot;&gt;
				&lt;cfreturn tobase64(hmac)&gt;
			&lt;/cfcase&gt;
			&lt;cfcase value=&quot;ubase64&quot;&gt;
				&lt;cfreturn URLEncodedFormat(tobase64(hmac))&gt;
			&lt;/cfcase&gt;
			&lt;cfdefaultcase&gt;
				&lt;cfreturn toString(hmac)&gt;
			&lt;/cfdefaultcase&gt;
		&lt;/cfswitch&gt;

&lt;/cffunction&gt;
&lt;/code&gt; 
				</description>
				
				<category>Encryption</category>				
				
				<category>LinkShare</category>				
				
				<category>Coldfusion</category>				
				
				<pubDate>Fri, 21 Nov 2008 00:26:00 -0500</pubDate>
				<guid>http://blog.shortfusion.com/index.cfm/2008/11/21/ColdFusion-HMACMD5-function</guid>
				
				<enclosure url="http://blog.shortfusion.com/enclosures/hmacmd5_function.zip" length="637" type="text/plain"/>
				
			</item>
			
			<item>
				<title>Linkshare Affiliate Program with ColdFusion</title>
				<link>http://blog.shortfusion.com/index.cfm/2008/11/20/Linkshare-Affiliate-Program-with-ColdFusion</link>
				<description>
				
				&lt;p&gt;One of the latest problems we had to solve while working for our &lt;a href=&quot;http://www.imagemedia.com&quot;&gt;full color printing and direct mail marketing company&lt;/a&gt;, imageMEDIA, was integration of the &lt;a href=&quot;http://www.linkshare.com/&quot; rel=&quot;nofollow&quot;&gt;LinkShare&lt;/a&gt; affiliate program with our custom built ColdFusion e-commerce site.&lt;/p&gt;

&lt;p&gt;Here&apos;s how we quickly and dirtily solved it.&lt;/p&gt;  [More]
				</description>
				
				<category>Encryption</category>				
				
				<category>LinkShare</category>				
				
				<category>Coldfusion</category>				
				
				<pubDate>Thu, 20 Nov 2008 23:03:00 -0500</pubDate>
				<guid>http://blog.shortfusion.com/index.cfm/2008/11/20/Linkshare-Affiliate-Program-with-ColdFusion</guid>
				
				<enclosure url="http://blog.shortfusion.com/enclosures/linkshare_coldfusion.zip" length="2895" type="text/plain"/>
				
			</item>
			</channel></rss>