<?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; C#</title>
	<atom:link href="http://www.jeffdarlington.com/tag/c-sharp/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, 24 Jul 2010 19:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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>]]></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>]]></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>]]></content:encoded>
			<wfw:commentRss>http://www.jeffdarlington.com/2009/02/10/set-bugs-equal-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
