<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Calculating hash values with NAV2013	</title>
	<atom:link href="https://www.hougaard.com/calculating-hash-values-with-nav2013/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.hougaard.com/calculating-hash-values-with-nav2013/</link>
	<description>Do more with apps</description>
	<lastBuildDate>Fri, 26 Jan 2018 23:18:09 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Lots of new goodies hidden inside NAV2018 &#124; Hougaard.com &#8211; Applied Hacking		</title>
		<link>https://www.hougaard.com/calculating-hash-values-with-nav2013/#comment-256</link>

		<dc:creator><![CDATA[Lots of new goodies hidden inside NAV2018 &#124; Hougaard.com &#8211; Applied Hacking]]></dc:creator>
		<pubDate>Fri, 26 Jan 2018 23:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hougaard.com/?p=6#comment-256</guid>

					<description><![CDATA[[&#8230;] needed to hash some passwords in NAV. I turned to my blog (via a trip to Google) and found my old article on the subject, [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] needed to hash some passwords in NAV. I turned to my blog (via a trip to Google) and found my old article on the subject, [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: hougaard		</title>
		<link>https://www.hougaard.com/calculating-hash-values-with-nav2013/#comment-74</link>

		<dc:creator><![CDATA[hougaard]]></dc:creator>
		<pubDate>Tue, 04 Aug 2015 16:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hougaard.com/?p=6#comment-74</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.hougaard.com/calculating-hash-values-with-nav2013/#comment-73&quot;&gt;Roddy&lt;/a&gt;.

You cannot use SHA256 for HMACSHA256 - see http://security.stackexchange.com/questions/79577/whats-the-difference-between-hmac-sha256key-data-and-sha256key-data

You much recreate this C# example from Amazon in C/AL
&lt;code&gt;
static byte[] HmacSHA256(String data, byte[] key)
{
    String algorithm = &quot;HmacSHA256&quot;;
    KeyedHashAlgorithm kha = KeyedHashAlgorithm.Create(algorithm);
    kha.Key = key;

    return kha.ComputeHash(Encoding.UTF8.GetBytes(data));
}

static byte[] getSignatureKey(String key, String dateStamp, String regionName, String serviceName)
{
    byte[] kSecret = Encoding.UTF8.GetBytes((&quot;AWS4&quot; + key).ToCharArray());
    byte[] kDate = HmacSHA256(dateStamp, kSecret);
    byte[] kRegion = HmacSHA256(regionName, kDate);
    byte[] kService = HmacSHA256(serviceName, kRegion);
    byte[] kSigning = HmacSHA256(&quot;aws4_request&quot;, kService);
 
    return kSigning;
}&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.hougaard.com/calculating-hash-values-with-nav2013/#comment-73">Roddy</a>.</p>
<p>You cannot use SHA256 for HMACSHA256 &#8211; see <a href="http://security.stackexchange.com/questions/79577/whats-the-difference-between-hmac-sha256key-data-and-sha256key-data" rel="nofollow ugc">http://security.stackexchange.com/questions/79577/whats-the-difference-between-hmac-sha256key-data-and-sha256key-data</a></p>
<p>You much recreate this C# example from Amazon in C/AL<br />
<code><br />
static byte[] HmacSHA256(String data, byte[] key)<br />
{<br />
    String algorithm = "HmacSHA256";<br />
    KeyedHashAlgorithm kha = KeyedHashAlgorithm.Create(algorithm);<br />
    kha.Key = key;</p>
<p>    return kha.ComputeHash(Encoding.UTF8.GetBytes(data));<br />
}</p>
<p>static byte[] getSignatureKey(String key, String dateStamp, String regionName, String serviceName)<br />
{<br />
    byte[] kSecret = Encoding.UTF8.GetBytes(("AWS4" + key).ToCharArray());<br />
    byte[] kDate = HmacSHA256(dateStamp, kSecret);<br />
    byte[] kRegion = HmacSHA256(regionName, kDate);<br />
    byte[] kService = HmacSHA256(serviceName, kRegion);<br />
    byte[] kSigning = HmacSHA256("aws4_request", kService);</p>
<p>    return kSigning;<br />
}</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Roddy		</title>
		<link>https://www.hougaard.com/calculating-hash-values-with-nav2013/#comment-73</link>

		<dc:creator><![CDATA[Roddy]]></dc:creator>
		<pubDate>Tue, 04 Aug 2015 15:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.hougaard.com/?p=6#comment-73</guid>

					<description><![CDATA[Hi, thanks for the SHA256 code. I think I may be misusing it, I&#039;m trying to create a signature for Amazon Web Services, (http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html) as below (first step). Any help would be greatly appreciated. Thanks Roddy

&lt;b&gt;Test Input&lt;/b&gt;
key = &#039;wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY&#039; 
dateStamp = &#039;20120215&#039;

&lt;b&gt;Expected Output&lt;/b&gt;
kDate    = &#039;969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d&#039;

&lt;b&gt;Actual Output&lt;/b&gt;
kDate    = &#039;8583c661110d4c95a37df70fd6f70d92fd18418f306c9f8d54582a2c354acad4&#039;&#039;

&lt;b&gt;Sample Psuedo code from AWS&lt;/b&gt;
kDate = HMAC(&quot;AWS4&quot; + key, dateStamp)  //UTF-8

&lt;b&gt;My use of your library&lt;/b&gt;
CLEAR(SHA256Lib);
SHA256Lib.InitSHA256;
SHA256Lib.AddString(AsciiAnsiLib.Ansi2Ascii(&#039;AWS4&#039; + key));
SHA256Lib.AddLF;
SHA256Lib.AddString(DateStamp);
kDate := SHA256Lib.CalculateSHA256;]]></description>
			<content:encoded><![CDATA[<p>Hi, thanks for the SHA256 code. I think I may be misusing it, I&#8217;m trying to create a signature for Amazon Web Services, (<a href="http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html" rel="nofollow ugc">http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html</a>) as below (first step). Any help would be greatly appreciated. Thanks Roddy</p>
<p><b>Test Input</b><br />
key = &#8216;wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY&#8217;<br />
dateStamp = &#8216;20120215&#8217;</p>
<p><b>Expected Output</b><br />
kDate    = &#8216;969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d&#8217;</p>
<p><b>Actual Output</b><br />
kDate    = &#8216;8583c661110d4c95a37df70fd6f70d92fd18418f306c9f8d54582a2c354acad4&#8221;</p>
<p><b>Sample Psuedo code from AWS</b><br />
kDate = HMAC(&#8220;AWS4&#8221; + key, dateStamp)  //UTF-8</p>
<p><b>My use of your library</b><br />
CLEAR(SHA256Lib);<br />
SHA256Lib.InitSHA256;<br />
SHA256Lib.AddString(AsciiAnsiLib.Ansi2Ascii(&#8216;AWS4&#8217; + key));<br />
SHA256Lib.AddLF;<br />
SHA256Lib.AddString(DateStamp);<br />
kDate := SHA256Lib.CalculateSHA256;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
