<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Neural Core Dump &#187; .NET</title>
	<atom:link href="http://www.jeffdarlington.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffdarlington.com</link>
	<description>The personal blog of Jeffrey T. Darlington, creator of General Protection Fault</description>
	<lastBuildDate>Sat, 28 Jan 2012 20:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cryptnos 1.0 for .NET 2.0</title>
		<link>http://www.jeffdarlington.com/2010/03/23/cryptnos-1-0-for-net-2-0/</link>
		<comments>http://www.jeffdarlington.com/2010/03/23/cryptnos-1-0-for-net-2-0/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:36:27 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cryptnos]]></category>
		<category><![CDATA[WinHasher]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/?p=364</guid>
		<description><![CDATA[In the ongoing spirit of releasing pointless Open Source software, I semi-proudly announce the release of Cryptnos 1.0 for Microsoft .NET 2.0. So what is it? Cryptnos is a secure password generator. By now, I&#8217;m sure many of you have heard of various programs, especially browser plug-ins, that let you generate unique passwords for all [...]]]></description>
			<content:encoded><![CDATA[<p>In the ongoing spirit of releasing pointless Open Source software, I semi-proudly announce the release of <a title="Cryptnos for .NET" href="http://www.gpf-comics.com/dl/cryptnos/dotnet.php">Cryptnos 1.0 for Microsoft .NET 2.0</a>.</p>
<p>So what is it? Cryptnos is a secure password generator. By now, I&#8217;m sure many of you have heard of various programs, especially browser plug-ins, that let you generate unique passwords for all your various online logins. They usually do this by combining the domain name of the site with a master password you supply, then run those inputs through an MD5 hash to give you a &#8220;strong&#8221; password that is unique for that site. Many of these applets also search the page you&#8217;re currently on for the login form and attempt to pre-populate the password box for you. Well, Cryptnos is kind of like that. Only it&#8217;s not.</p>
<p>Like these other apps, Cryptnos generates a password from your master password and from some mnemonic or &#8220;site token&#8221; that you supply. But that&#8217;s where the similarities end. First of all, Cryptnos does not live in your browser, so it can be used for any application where you need a strong password. As a corollary, the mnemonic does not have to be a domain name, although it certainly can be; it can be whatever you want it to be, so long as it is unique and it helps you remember what the password is used for. Next, Cryptnos gives you unparalleled flexibility in how your password is generated. You&#8217;re not stuck using just MD5, a broken cryptographic hash that is horribly out of date and which should no longer be used. You can select from a number of hashing algorithms, as well as how many times the hash should be applied. Crytpnos also uses Base64 rather than hexadecimal to encode the output, meaning your generated passwords can have up to 64 possible options per character instead of 16, making it stronger per character than the other guys. You can further tweak your generated password by limiting the types of characters used (for those times where a site requires you to only use letters and numbers) and the length of your password. Best of all, Cryptnos remembers all of these options for you, storing them in an encrypted state that is nearly impossible to crack. Your master password is <em><strong>NEVER</strong></em> stored, nor are your generated passwords; your passwords are generated on the fly, as you need them, and cleared from memory once the application closes.</p>
<p>Cryptnos originally sprang from the &#8220;Hash Text&#8221; function of <a title="WinHasher" href="http://www.gpf-comics.com/dl/winhasher/">WinHasher</a>, which I used to generate passwords in a similar fashion for a long time. I quickly ran into limitations in using WinHasher this way, especially when it came to sites where I had to tweak the password after it was generated. I thought to myself, &#8220;I&#8217;ll never be able to remember all these tweaks for all these passwords. Why can&#8217;t I just rip this function out of WinHasher and wrap a program around it to let the computer do all the work for me?&#8221; And that&#8217;s exactly what I did. I&#8217;ve been using Cryptnos to generate and &#8220;store&#8221; my passwords for months now and I finally decided it was stable enough to release it to the world at large.</p>
<p>Right now, <a title="Cryptnos" href="http://www.gpf-comics.com/dl/cryptnos/">Cryptnos</a> is only available for Microsoft .NET 2.0, which means by default it runs on Windows. However, I&#8217;m also working on a <a title="Cryptnos for Android" href="http://www.gpf-comics.com/dl/cryptnos/android.php">Google Android version</a>, which means a pure Java implementation should be simple to extract after that. I&#8217;ve even been pursuing a PHP and/or JavaScript implementation that does everything except storing the parameter data. I&#8217;m not sure when any of these will escape from my hard drive, but anyone interested in them can drop me an e-mail and I&#8217;ll happily open a dialog.</p>
<p>Oh, and the name? Um, well, I wanted a better one, but that&#8217;s the only thing I could find that sounded &#8220;passwordy&#8221; that didn&#8217;t have a lot of hits on Google.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2010/03/23/cryptnos-1-0-for-net-2-0/' addthis:title='Cryptnos 1.0 for .NET 2.0 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2010/03/23/cryptnos-1-0-for-net-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Need help: Removing old certificate revocation lists in Windows</title>
		<link>http://www.jeffdarlington.com/2009/07/09/need-help-removing-old-certificate-revocation-lists-in-windows/</link>
		<comments>http://www.jeffdarlington.com/2009/07/09/need-help-removing-old-certificate-revocation-lists-in-windows/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 18:50:45 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[client certificate]]></category>
		<category><![CDATA[CRL]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/?p=260</guid>
		<description><![CDATA[I have a bit of a quandary that&#8217;s got me effectively stuck on a task at my day job. Thus far, Google and every other resource I&#8217;ve searched have been little help. In the unlikely event somebody out there that reads this blog (or at least gets the update notices via RSS, Twitter, or the [...]]]></description>
			<content:encoded><![CDATA[<p>I have a bit of a quandary that&#8217;s got me effectively stuck on a task at my day job. Thus far, Google and every other resource I&#8217;ve searched have been little help. In the unlikely event somebody out there that reads this blog (or at least gets the update notices via RSS, Twitter, or the other various feeds) can help me, I&#8217;m going throw this out and hope it garners some feedback.</p>
<p>I&#8217;ll try to keep this as short as possible. Our production Web site, built in ASP.NET and C# and running in IIS on Windows Server 2003, recently added authentication via client certificates stored on users&#8217; smart cards. We allow users to attach their smart card certificates to their existing account, then authenticate them by verifying their certificate, looking up the user account by that certificate&#8217;s fingerprint, and loading their profile. These certificates are signed by a trusted third-party certificate authority (CA) owned by the client and every morning we download the latest certificate revocation lists (CRLs) so we can reject certificates as they are revoked by the CA. My download process is working fine and dandy, so that&#8217;s not the problem; neither is the actual import process, as I know the command line options for Microsoft&#8217;s <code>certutil</code> command that will import the CRLs.</p>
<p>My problem stems from removing the <em>old</em> CRLs, which so far I haven&#8217;t been able to accomplish without going into the Microsoft Management Console and clicking through the GUI. We&#8217;ve had problems with the size of the certificate store, as the CRLs tend to be very large and we have to remove the old ones before the new ones can be imported. I&#8217;ve tried the few suggestions I&#8217;ve found online that haven&#8217;t seemed to work, such as a command-line switch for <code>certutil</code> that&#8217;s supposed to overwrite the old CRL with the new one (it just imports the new one and leaves the old one in place). We want to automate this process into a scheduled task, so it can run early in the morning when our users aren&#8217;t on the system and without human intervention.</p>
<p>Here are the tools available to me:</p>
<ul>
<li>As previously stated, <code>certutil</code> (part of Microsoft&#8217;s Certificate Services package);</li>
<li>Windows PowerShell;</li>
<li>Anything I can throw into a .NET assembly and build an executable out of (preferably C# code);</li>
<li>Good old fashioned batch files.</li>
</ul>
<p>I&#8217;ll tell you, I&#8217;m pretty frustrated and exhausted by this task. It&#8217;s not that I can&#8217;t do the research and figure it out for myself; I <em>have</em> done the research, and everything I&#8217;ve read applies to certificates and not CRLs, and they&#8217;re not exactly a direct swap in usage. I&#8217;d prefer not to provide much more detail than this for security reasons.</p>
<p>For the time being, I&#8217;ve been manually removing the old CRLs through MMC and then running a batch script to do the import every morning as my first task. That&#8217;s working fine for now, when I&#8217;m in the office every morning, but I&#8217;ll be taking some vacation time soon that will start to cause problems. I swear, if this was OpenSSL and Apache on Linux, I&#8217;d have this solved in a heartbeat (or at least an afternoon). If you have any suggestions, please feel to post a comment or shoot me a direct e-mail at the usual address.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2009/07/09/need-help-removing-old-certificate-revocation-lists-in-windows/' addthis:title='Need help: Removing old certificate revocation lists in Windows '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2009/07/09/need-help-removing-old-certificate-revocation-lists-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>set_bugs = 0;</title>
		<link>http://www.jeffdarlington.com/2009/02/10/set-bugs-equal-zero/</link>
		<comments>http://www.jeffdarlington.com/2009/02/10/set-bugs-equal-zero/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:21:33 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[GPF]]></category>
		<category><![CDATA[Help Desk]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/?p=196</guid>
		<description><![CDATA[This week an couple errors were reported in the custom CMS application I built at work a couple years ago. I haven&#8217;t touched this code in at least a year, so it took me bit to swap some mental virtual memory and recall how everything worked. I&#8217;m not sure if these &#8220;bugs&#8221; were something new [...]]]></description>
			<content:encoded><![CDATA[<p>This week an couple errors were reported in the custom <a title="Content Management System article on Wikipedia" href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> application I built at work a couple years ago. I haven&#8217;t touched this code in at least a year, so it took me bit to swap some mental virtual memory and recall how everything worked. I&#8217;m not sure if these &#8220;bugs&#8221; were something new that had manifested themselves after a recent platform upgrade or design flaws that had been there since the beginning only to be recently noticed. None of that really matters for the sake of this post, however. Suffice it to say there were two problems, one of which was likely to be entirely my fault but relatively easy to fix with a little bit of <a title="C# (programming language) article on Wikipedia" href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a> hacking.</p>
<p>The other problem was a bit obscure. The application is built in <a title="ASP.NET article on Wikipedia" href="http://en.wikipedia.org/wiki/ASP.NET">ASP.NET</a> 2.0 and written entirely in C#. It also makes use of <a title="Microsoft" href="http://www.microsoft.com/">Microsoft</a>&#8216;s <a title="AJAX (programming) article on Wikipedia" href="http://en.wikipedia.org/wiki/Ajax_(programming)">AJAX</a> Toolkit for ASP.NET to &#8220;pretty up&#8221; some of the interface interactions. Unfortunately, one particular user began to experience problems with the system recently. Since she&#8217;s the project manager, needless to say the problem was escalated to top priority with little to no delay. To make things more difficult, the problem was especially cryptic. In true Microsoft fashion, the pop-up <a title="JavaScript article on Wikipedia" href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> error dialog offered little to no useful information:</p>
<blockquote><p>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500</p></blockquote>
<p><a title="Google" href="http://www.google.com/">Google</a>, of course, is my friend and found <a title="Google search for PageRequestManagerServerErrorException" href="http://www.google.com/search?q=PageRequestManagerServerErrorException">no shortage of pages</a> where this turned up. The odd thing was that none of the purported causes for the error were anything that I was using.</p>
<p>After much searching, I finally happened upon <a title="Andornot Developers' Blog: ASP.NET AJAX and Sys.Webforms.PageRequestManagerServerErrorException" href="http://www.andornot.com/about/developerblog/2007/07/aspnet-ajax-and-syswebformspagerequestm.aspx">this site</a>. It seems Ted Jardine hit the same problem I did. He had narrowed it down to something to do with the .NET session, which he wasn&#8217;t really using but I was using extensively. What I found most interesting was his solution:</p>
<blockquote><p>So, based on one of the comments in one of the above posts, even though I&#8217;m not touching session on one of the problem pages, I tried a hack in one of the problem page&#8217;s Page_Load:</p>
<p>Session["FixAJAXSysBug"] = true;</p>
<p>And lo and behold, we&#8217;re good to go!</p></blockquote>
<p>I followed the various links he provided—as well as <a title="Google search for FixAJAXSysBug" href="http://www.google.com/search?q=FixAJAXSysBug">Googling for &#8220;FixAJAXSysBug&#8221;</a> itself—and found lots more anecdotal evidence to support its usefulness. I applied this &#8220;fix&#8221; to the common header of the application to make sure it took affect everywhere and, so far, all reports seem to indicate its success.</p>
<p>Needless to say, I was instantly reminded of <a title="GPF Archive: Wednesday, January 31, 2001" href="http://www.gpf-comics.com/archive.php?d=20010131">this GPF strip</a> from the crossover with <a title="Help Desk" href="http://ubersoft.net/">Help Desk</a>. I can&#8217;t remember now if that joke was my idea or Chris Wright&#8217;s. It doesn&#8217;t matter now, really&#8230; it audacity is as brilliant now as it was eight years ago. The idea of setting a simple Boolean flag to &#8220;turn off bugs&#8221; is something I will always find hilarious.</p>
<p>Now if only <em>all</em> Microsoft bugs were so easy to fix&#8230;.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2009/02/10/set-bugs-equal-zero/' addthis:title='set_bugs = 0; '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2009/02/10/set-bugs-equal-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinHasher 1.3</title>
		<link>http://www.jeffdarlington.com/2008/06/30/winhasher-13/</link>
		<comments>http://www.jeffdarlington.com/2008/06/30/winhasher-13/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 08:59:11 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WinHasher]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/?p=145</guid>
		<description><![CDATA[For both of you out there who care, WinHasher has now been bumped to version 1.3. The changes are very minor, so there&#8217;s no need to upgrade unless you find the following two new features useful: There&#8217;s now a drop-down box to choose between hexadecimal output and Base64 (RFC 2045, although without line wrapping). I [...]]]></description>
			<content:encoded><![CDATA[<p>For both of you out there who care, <a title="GPF Downloads: WinHasher" href="http://www.gpf-comics.com/dl/winhasher/">WinHasher</a> has now been bumped to version 1.3. The changes are very minor, so there&#8217;s no need to upgrade unless you find the following two new features useful:</p>
<ul>
<li>There&#8217;s now a drop-down box to choose between <a title="Hexadecimal article on Wikipedia" href="http://en.wikipedia.org/wiki/Hexadecimal">hexadecimal</a> output and <a title="Base64 article on Wikipedia" href="http://en.wikipedia.org/wiki/Base64">Base64</a> (<a title="RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" href="http://tools.ietf.org/html/rfc2045">RFC 2045</a>, although without line wrapping). I personally like using Base64 because it&#8217;s more compact than hex and more &#8220;obscure-looking&#8221;; even non-coders are familiar with hex, seeing it in error messages all the time, but are less familiar with Base64, which looks more like &#8220;random noise&#8221;. The default output is still hex, so you only need to switch modes if you really find Base64 more useful.</li>
<li>There&#8217;s now a tab in the GUI to hash arbitrary text. I added this feature because there was an extension to <a title="Firefox" href="http://www.mozilla.com/firefox/">Firefox</a> that I used all the time to do this—which I used frequently to generate &#8220;random-looking&#8221; passwords by hashing simpler plain text and using the hash as the &#8220;real&#8221; password—but the extension hasn&#8217;t been updated in forever and is no longer working in Firefox 3. So to keep myself from getting locked out of the accounts where I used hashed passwords, I threw this feature in WinHasher. The backbone was already there, so all that needed to be added was a GUI.  There&#8217;s also an <a title="Character encoding article on Wikipedia" href="http://en.wikipedia.org/wiki/Character_encoding">encoding</a> drop-down box that lets you change the text encoding if you so desire/need. To be honest, I don&#8217;t think it&#8217;s really necessary because I think <a title="Microsoft .NET Framework article on Wikipedia" href="http://en.wikipedia.org/wiki/.NET_Framework">.NET</a> uses <a title="Unicode article on Wikipedia" href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> internally all the time, but it does have a nice side-effect: if you enter text in one encoding and change the encoding setting to something radically different (say you enter Western European Windows text but change the encoding to IBM <a title="Extended Binary Coded Decimal Interchange Code article on Wikipedia" href="http://en.wikipedia.org/wiki/Extended_Binary_Coded_Decimal_Interchange_Code">EBCDIC</a> Japanese), you&#8217;ll end up with a very different hash than you would have had if you used the &#8220;right&#8221; encoding. This isn&#8217;t encryption by any means as it could be easily reverse engineered if you knew what encodings were used, but it does significantly scramble things to the point that it makes it much harder to figure out exactly what you did.</li>
</ul>
<p>I had originally started adding support for <a title="HMAC article on Wikipedia" href="http://en.wikipedia.org/wiki/HMAC">HMAC</a> signed hashes but have abandoned that for now. If there&#8217;s anyone out there who might actually find that useful, drop me a line and I&#8217;ll revisit the code to see what I might be able to add. Downloads can be found at the first link above.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2008/06/30/winhasher-13/' addthis:title='WinHasher 1.3 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2008/06/30/winhasher-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinHasher 1.2</title>
		<link>http://www.jeffdarlington.com/2007/11/30/winhasher-12/</link>
		<comments>http://www.jeffdarlington.com/2007/11/30/winhasher-12/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 02:10:04 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WinHasher]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/2007/11/30/winhasher-12/</guid>
		<description><![CDATA[I just can&#8217;t leave well enough alone. I&#8217;ve been mildly annoyed with the &#8220;hash in progress&#8221; and progress dialogs in WinHasher 1.1. The original idea was to use System.ComponentModel.BackgroundWorker to easily multi-thread very large hashes (say of CD or DVD ISOs or uncompressed video files). This had two benefits: (1) it allows the user to [...]]]></description>
			<content:encoded><![CDATA[<p>I just can&#8217;t leave well enough alone. I&#8217;ve been mildly annoyed with the &#8220;hash in progress&#8221; and progress dialogs in <a href="http://www.gpf-comics.com/dl/winhasher/" title="GPF Downloads: WinHasher">WinHasher</a> 1.1. The original idea was to use <code>System.ComponentModel.BackgroundWorker</code> to easily multi-thread very large hashes (say of CD or DVD ISOs or uncompressed video files). This had two benefits: (1) it allows the user to cancel a hash in progress and (2) gives us an opportunity to update the GUI while the hashing takes place in the background, meaning we can inform the user of the progress. Unfortunately, I couldn&#8217;t find a method right away to determine the progress of an individual hash. <code>System.Security.Cryptography.HashAlgorithm.ComputeHash()</code> by default takes a byte array or file stream and chugs the whole thing at once, spitting out the hash as a result. There&#8217;s no way with this method to determine how far along you are.</p>
<p>However, if you look at the guts of <code>ComputeHash()</code>, you&#8217;ll find it reads in chunks of bytes into a buffer, then calls two methods: <code>TransformBlock()</code> for every chunk but the last, and <code>TransformFinalBlock()</code> to hash the last chunk and finalize the hash. The result can then be obtained from the <code>HashAlgorithm.Hash</code> property. If we bypass the convenience of the single <code>ComputeHash()</code> method call, you can read chunks of bytes from the buffer, feed it to the <code>Transform...()</code> methods, and keep track of how many bytes have been read so far. Since we already know how big the file is from the start (<code>System.IO.FileStream.Length</code>), it&#8217;s trivial to calculate a percentage complete. Want the progress of a multi-file comparison? Sum the lengths of all files in the batch, then keep track of the total number of bytes hashed along the way.</p>
<p>I&#8217;ve bumped WinHasher to version 1.2. It should be available on the official site by tomorrow morning.</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2007/11/30/winhasher-12/' addthis:title='WinHasher 1.2 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2007/11/30/winhasher-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinHasher 1.0 and Mandelbrot Madness! 2.0</title>
		<link>http://www.jeffdarlington.com/2007/09/26/winhasher-10-and-mandelbrot-madness-20/</link>
		<comments>http://www.jeffdarlington.com/2007/09/26/winhasher-10-and-mandelbrot-madness-20/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 20:07:55 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[fractal]]></category>
		<category><![CDATA[Mandelbrot Madness]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WinHasher]]></category>

		<guid isPermaLink="false">http://www.jeffdarlington.com/2007/09/26/winhasher-10-and-mandelbrot-madness-20/</guid>
		<description><![CDATA[I&#8217;m not sure if anyone cares, but I&#8217;ve been doing a tiny bit of dabbling in releasing Open Source software lately. Since I don&#8217;t particularly care to announce them on the GPF News (it isn&#8217;t, after all, GPF news), I&#8217;ll announce them here. For those of you who might complain that working on these has [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if anyone cares, but I&#8217;ve been doing a tiny bit of dabbling in releasing <a href="http://www.opensource.org/" title="The Open Source Initiative">Open Source</a> software lately. Since I don&#8217;t particularly care to announce them on the <a href="http://www.gpf-comics.com/news/" title="GPF News">GPF News</a> (it isn&#8217;t, after all, <a href="http://www.gpf-comics.com/" title="General Protection Fault">GPF</a> news), I&#8217;ll announce them here. For those of you who might complain that working on these has taken precious time away from the comic, fret not. The tiny bit of time I&#8217;ve been able to squeeze in here and there to work on these have been during periods when working on the comic would be impossible, so there&#8217;s no way for there to be any conflict.</p>
<p>The first one I&#8217;ll announce is the most recent. <a href="http://www.gpf-comics.com/dl/winhasher/" title="GPF: WinHasher">WinHasher</a> is a <a href="http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx" title="Microsoft .NET Framework 2.0">Microsoft .NET Framework 2.0</a> application for generating <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" title="Cryptographic hash function article on Wikipedia">cryptographic hashes</a> of files. It is both a Windows <a href="http://en.wikipedia.org/wiki/Graphical_user_interface" title="Graphical user interface article on Wikipedia">GUI</a> applet and a console (command line) program, and it operates in two possible modes. The first mode generates the hash of a single file, which you can then use to verify a download or check to see if a file has been tampered with. The second mode takes the hashes of multiple files and compares them; in this way, you can see if two or more files have the same binary contents regardless of their names, locations, and time stamps. The Windows app supports drag-and-drop functionality, and the installer lets you also build shortcuts in your Windows Explorer &#8220;Send To&#8221; context menu so you can just right-click a file and get its hash.</p>
<p>So why did I build this? Well, the full details are on the site, but the quick version is that I&#8217;ve grown tired of not being able to validate the hashes of downloaded files because Windows doesn&#8217;t have a built-in hashing program. Linux and the other free UNIX clones have <a href="http://www.openssl.org/" title="OpenSSL">OpenSSL</a>; heck, even Mac OS has OpenSSL under the hood. Not Windows&#8230; of course. So instead of downloading a file on a Windows machine, copying it to the Linux box, validating the hash, and moving it back (or worse, just not even validating the hash at all and taking my chances), I hacked together this little program. Then I thought it might be useful enough to share, so I did. If you find it useful, please let me know.</p>
<p>For the really technically inclined out there, most of the hashes are built-in to .NET 2.0, so this was obscenely easy to implement. In fact, 2.0 has an abstract hash algorithm class (<code>System.Security.Cryptography.HashAlgorithm</code>) that all of the built-in hashes implement. The two non-standard hashes, <a href="http://en.wikipedia.org/wiki/Whirlpool_%28cryptography%29" title="Whirlpool (cryptography) article on Wikipedia">Whirlpool</a> and <a href="http://en.wikipedia.org/wiki/Tiger_%28hash%29" title="Tiger (hash) article on Wikipedia">Tiger</a>, were taken from the <a href="http://www.bouncycastle.org/csharp/" title="The Legion of the Bouncy Castle Crypto API">Legion of the Bouncy Castle Crypto API</a>, which is actually .NET 1.1 based. I (rather crudely) ported these classes to be subclasses of <code>HashAlgorithm</code>, so they can technically be used as a drop-in replacement of any .NET 2.0 hash. I plan to add additional hashes over time, provided that (a) the original source code is free and (b) I can port it to be a <code>HashAlgorithm</code> subclass.</p>
<p>The second program to mention is actually a bit of an oldie now. (I actually released it back in June.) The <a href="http://www.gpf-comics.com/dl/mandel/win32.html" title="Mandelbrot Madness! .NET Version">Windows version of <em>Mandelbrot Madness!</em></a> is back, also in a .NET 2.0 edition. I wrote the original in <a href="http://msdn.microsoft.com/visualc/" title="Microsoft Visual C++">Visual C++</a> 4.x, but have long since lost the source code. Then the <a href="http://www.gpf-comics.com/dl/mandel/java/" title="Mandelbrot Madness JAVA!">Java version</a> came into being and rapidly surpassed the Windows version, leaving it to suffer from bit rot. Both eventually languished as I lost time to work on them. Well, in December of 2005, I released the not-quite-complete-but-close-enough 4.0 version of <em>Mandelbrot Madness JAVA!,</em> declaring it abandoned. It always bugged me that I never went back and revisited the Visual C++ code, but without the source I was stuck.</p>
<p>Well, to make a long story short, my <a href="http://www.jeffdarlington.com/2006/05/25/homeward-bound/" title="Homeward Bound, May 25th, 2006">new job</a> had me <a href="http://www.jeffdarlington.com/2006/11/13/sometimes-it-makes-me-feel-dirty/" title="Sometimes it makes me feel dirty..., November 13th, 2006">learning a new programming language: C#</a>. That had me programing Web sites, but I knew you could also do Windows GUI apps in it as well. So somewhere down the line I got a wild hair and started the agonizing work of porting the Java code from the last version of <em>MMJ!</em> to C#. Actually, Java and C# are similar enough that the porting work wasn&#8217;t all that hard. Not only is <em>MM!</em> 2.0 now pretty much identical in functionality to <em>MMJ!</em> 4.0, but I introduced a number of new features that I hope to eventually port back to the Java version. While I still prefer the platform independence of Java, I&#8217;ll readily admit that the .NET version is a lot faster on Windows. I think that anyone on that platform that has actually bothered to play with the Java version (both of you) should make the switch. Anyone still using the decrepit old 1.0 version of Win32 <em>MM!</em> should enter the 21st century and upgrade too.</p>
<p>Both programs have been released under <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" title="GNU General Public License, version 2">version 2 of the GPL</a> (haven&#8217;t had time to really review <a href="http://www.gnu.org/copyleft/gpl.html" title="GNU General Public License">version 3</a> yet), so the sources are also available. If you have any suggested changes, feel free to pass them along and I might incorporate them into the official builds (giving you credit, of course).</p><div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://www.jeffdarlington.com/2007/09/26/winhasher-10-and-mandelbrot-madness-20/' addthis:title='WinHasher 1.0 and Mandelbrot Madness! 2.0 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2007/09/26/winhasher-10-and-mandelbrot-madness-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

