<?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"
	>

<channel>
	<title>Parallel Interface</title>
	<atom:link href="http://www.paralint.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paralint.com/blog</link>
	<description>Programming security in Java and C++, one line at a time</description>
	<pubDate>Thu, 13 Nov 2008 04:32:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Stop internal drive showing up in &#34;Safely remove hardware&#34;</title>
		<link>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/</link>
		<comments>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 04:27:19 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Other technical]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=82</guid>
		<description><![CDATA[Like many of you, I had a drive that showed up in the &#8220;Safely remove hardware&#8221; tray icon, and was unable to remove it.
The trick is to subtract 4 from the Capabilities in the registry. Not easy, but it can be done. The only thing is that it keeps coming back after every boot ! [...]]]></description>
			<content:encoded><![CDATA[<p>Like many of you, I had a drive that showed up in the &#8220;Safely remove hardware&#8221; tray icon, and was unable to remove it.</p>
<p>The trick is to subtract 4 from the Capabilities in the registry. Not easy, but it can be done. The only thing is that it keeps coming back after every boot ! And it looks like the value cannot be edited under Vista. Here is how to fix it for good.</p>
<p><span id="more-82"></span></p>
<h3>What has to be done (but doesn&#8217;t work)</h3>
<p>Find the drive that shows up in the safely remove hardware icon in your registry. It will be somewhere under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\. My DVD drive was here :</p>
<pre class="generic:nogutter:nocontrols" name="code">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\CdRomHL-DT-ST_DVDRAM_GMA4082Nj_______________PM01____</pre>
<p>There is a numerical an alphanumerical key under that with a DWORD Capabilities value.</p>
<p><img src="http://www.paralint.com/blog/wp-content/uploads/2008/11/image.png" alt="image" width="788" height="318" /></p>
<p>It is a bit field. The bit 0010 (4 in decimal) is the REMOVABLE bit. Clear it by subtracting 4 from the value you have. The value I had was 6, so now I am down to 2.</p>
<p>If you try to do that, you will get an access denied. That&#8217;s ok, we will get around that. For now, right click on the key name and copy it (the key named 5&amp;3392c8c4&amp;0&amp;0.0.0 in my example).</p>
<h3>Same idea, that works manually under Vista</h3>
<p>You need to have the TCB privileged enabled to modify that registry key. Running regedit as an administrator (or elevated, if you have UAC) will not work. You can fix the value with this command line :</p>
<pre class="generic:nogutter:nocontrols" name="code">psexec -s reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE\CdRomHL-DT-ST_DVDRAM_GMA4082Nj_______________PM01____\5&amp;3392c8c4&amp;0&amp;0.0.0" /v Capabilities /t REG_DWORD /d 2 /f</pre>
<p>You will have to replace the key name with what you found in <span style="text-decoration: underline;">your</span> registry. Running psexec -r regedit might work, but who wants to do that every time the computer boots ?</p>
<h3>Permanent fix</h3>
<p>I hardly ever run as an administrator, so putting the above command in a script was out of the question. The solution was to create a Task using Windows Task Scheduler. I set it to run at startup, under the SYSTEM account. Don&#8217;t forget the /f (force) flag, or else the job will appear to hang, waiting a confirmation from you.</p>
<p>Create a new task. In the &#8220;General&#8221; tab, click Change User or Group and enter &#8220;SYSTEM&#8221; . Trigger on startup and enter the same command as above, but without psexec -s. Your task is running reg.exe, with everything right of that (in the command line, earlier) as optional arguments.</p>
<p><img src="http://www.paralint.com/blog/wp-content/uploads/2008/11/image1.png" alt="image" width="419" height="480" /></p>
<p>Good luck and HTH !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/11/13/stop-internal-drive-showing-up-in-safely-remove-hardware/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Full disk encryption single sing-on and secure backup</title>
		<link>http://www.paralint.com/blog/2008/11/06/full-disk-encryption-single-sing-on-and-secure-backup/</link>
		<comments>http://www.paralint.com/blog/2008/11/06/full-disk-encryption-single-sing-on-and-secure-backup/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 21:22:19 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Cryptography]]></category>

		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=67</guid>
		<description><![CDATA[I have a been a TrueCrypt user since version 4.0. I used to have an half-baked solution of TrueCrypt, EFS with SYSKEY option 2 (password). When full disk encryption was introduced, I finally got a laptop encryption scheme that I like. It features :

 Strong cryptography
Thank TrueCrypt for 256 bits AES in XTS mode. I [...]]]></description>
			<content:encoded><![CDATA[<div>I have a been a <a href="http://www.truecrypt.org/" target="_blank">TrueCrypt</a> user since version 4.0. I used to have an half-baked solution of TrueCrypt, EFS with SYSKEY option 2 (password). When full disk encryption was introduced, I finally got a laptop encryption scheme that I like. It features :</p>
<ul>
<li> <strong>Strong cryptography</strong><br />
Thank TrueCrypt for 256 bits AES in XTS mode. I think 256 bits is overkill, but 128 is not offered. I don&#8217;t see any performance hit on my modest, stock Fujitsu E8210 laptop.</li>
<li> <strong>Need to know (reduced data exposure)</strong><br />
Data is not available in clear text when I don&#8217;t need it. In other words, when I work, I have my files, when I play they stay encrypted</li>
<li> <strong>Easy encrypted backup</strong><br />
My backups are merely a copy to a file server.</li>
<li> <strong>Single sign-on to any encrypted volume</strong><br />
The pre-boot authentication password (or pass phrase, your call) is the only one you&#8217;ll ever have to enter, and yet, that password is never stored anywhere. Not even in encrypted memory. It&#8217;s only in your head.</li>
<li> <strong>Supports encrypted USB drive</strong><br />
USB drives get the same single sign-on, need to know and backup features. Doesn&#8217;t matter wheter you use file based or whole volume, although using a file based container allows you to store regular data on any computer, instead of carrying to drives.</li>
<li><strong>Platform independent</strong><br />
Works on all platforms that TrueCrypt supports</li>
</ul>
</div>
<div>All that out of the box. Well&#8230; actually there is no box, it is all open source !</div>
<div><span id="more-67"></span></div>
<p>It does not feature, but could be extended to :</p>
<ul>
<li> Plausible deniability</li>
<li> Two factor authentication to encrypted files (TrueCrypt version 6.1 required)</li>
<li>Step-up authentication to encrypted files</li>
<li>Operating system logon integration (stay tuned for that one&#8230;)</li>
<li>Full operating system backup</li>
</ul>
<p>Here is a simplified view of my setup. A laptop, a usb drive and a simple NAS server (I have a Linksys NAS200, but any remote file share or ftp will do).</p>
<p><a href="http://www.paralint.com/blog/wp-content/uploads/2008/11/tcsso.jpg"><img class="aligncenter size-full wp-image-68" title="TrueCrypt single sign-on and encrypted backup" src="http://www.paralint.com/blog/wp-content/uploads/2008/11/tcsso.jpg" alt="Full disk encryption single sign-on diagram" /></a></p>
<ol>
<li><strong>A keyfile is stored on your encrypted partition. </strong><br />
I generated a keyfile with cryptographic random noise. Let&#8217;s call it Entropy.dat. Your pre-boot password and operating system logon will give you access to that key file. It is used to single sing-on to any container. That keyfile is <span style="text-decoration: underline;">never backed up</span>, excluded it from all your backups.</li>
<li><strong>A volume header of your container (with password authentication) is backed up</strong><br />
For any file based volume you create, backup a header that has a password authentication, no keyfiles. Write that password behind a picture of yourself with your kids and send it to your mother. It will be on the her fridge if ever you need it.</li>
<li><strong>Backup a rescue disk ISO file</strong><br />
This is regular TrueCrypt procedure for full disk encryption.</li>
</ol>
<p>To set yourself up like this, follow these steps :</p>
<ol>
<li>Follow TrueCrypt&#8217;s guidelines to enable full disk encryption.</li>
<li>Create a file based TrueCrypt volume, with a strong password that you will remember or write down.</li>
<li>Backup that volume header.</li>
<li>Select (or generate) a keyfile.</li>
<li>Change the volume password to      (nothing, leave the password field blank)</li>
<li>Select the keyfile of step 4 and click Ok</li>
</ol>
<p>Repeat steps 4-5-6 for each file based container. Copy to that container the files you want to be able on a need to know basis. When you need the files, mount the container. I wrote a batch file that mounts a file based container and shows a popup with my <a href="/projects/notifu/">Notifu utility</a> (Windows only).</p>
<pre class="generic:nogutter:nocontrols" name="code">@echo off
REM Mounts a file based TrueCrypt container and displays a pop-up
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v C:\users\your_username\Clients.tc /l X /q /k "%USERPROFILE%\entropy.dat" /m ts
start "" notifu /m "TrueCrypt drive X was mounted successfully from file Clients.tc" /p "Secure drive mounted" /d 5000 /i "C:\Program Files\TrueCrypt\TrueCrypt.exe"
start "" /MIN "C:\Program Files\TrueCrypt\TrueCrypt.exe" /q background</pre>
<p>The batch is a little different for USB drives.</p>
<pre class="generic:nogutter:nocontrols" name="code">@echo off
REM Mounts a file based TrueCrypt container located on a USB drive and displays a pop-up
setlocal
REM I use this setup on many machines, and the USB drive is not
REM always given the same letter...
if exist f:\mobile.tc set TCFILE=f:\mobile.tc
if exist e:\mobile.tc set TCFILE=e:\mobile.tc
start "TrueCrypt" /MIN "C:\Program Files\TrueCrypt\TrueCrypt.exe" /v %TCFILE% /k "%USERPROFILE%\entropy.dat" /l U /a /q /m rm /m ts
start "" notifu /m "TrueCrypt drive U was mounted successfully from file %TCFILE%" /p "Secure drive mounted" /d 5000 /i "C:\Program Files\TrueCrypt\TrueCrypt.exe"
start "" /MIN "C:\Program Files\TrueCrypt\TrueCrypt.exe" /q background
endlocal</pre>
<p>Feel free to use it and adapt it to your needs !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/11/06/full-disk-encryption-single-sing-on-and-secure-backup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Aucun version 1.4 released : bug fixes, fail safe and debug support</title>
		<link>http://www.paralint.com/blog/2008/09/23/aucun-version-14-released-bug-fixes-fail-safe-and-debug-support/</link>
		<comments>http://www.paralint.com/blog/2008/09/23/aucun-version-14-released-bug-fixes-fail-safe-and-debug-support/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 04:03:12 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/09/23/aucun-version-14-released-bug-fixes-fail-safe-and-debug-support/</guid>
		<description><![CDATA[I just put online version 1.4 of my replacement Gina ! Thanks to everyone who gave me a break while I was spending more time house shopping, buying and renovating. This release is very good, thanks to everybody who wrote me about problems they were facing&#8230; Here is what&#8217;s new :

Fixed a bug where registry [...]]]></description>
			<content:encoded><![CDATA[<p>I just put online <a href="http://www.paralint.com/projects/aucun/index.html#Download">version 1.4</a> of my replacement Gina ! Thanks to everyone who gave me a break while I was spending more time house shopping, buying and renovating. This release is very good, thanks to everybody who wrote me about problems they were facing&#8230; Here is what&#8217;s new :</p>
<ul>
<li>Fixed a bug where registry keys and groups had to be present to work.  </li>
<li>Fail safe behaviour reverts to normal MSGINA.dll if anything goes wrong  </li>
<li>Better detection of the user logged in coming back to unlock </li>
<li>Registered as a logon process (Paralint shows in the Event log instead of Winlogon)  </li>
<li>Added an option to generate a debug output (off by default, see Sample.reg)  </li>
<li>Corrections and clarification in the documentation  </li>
<li>Automated build, test and release scripts </li>
</ul>
<p>Next up ? I am not sure. I am thinking about a self-service application, like a companion product, and when I get that to work, find a way to integrate that concept with Aucun. Something like after N bad logon, you are redirected to the self service application.</p>
<p>Enjoy !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/09/23/aucun-version-14-released-bug-fixes-fail-safe-and-debug-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Easy test coverage with constant Hamming distance of 1</title>
		<link>http://www.paralint.com/blog/2008/08/21/easy-test-coverage-with-constant-hamming-distance-of-1/</link>
		<comments>http://www.paralint.com/blog/2008/08/21/easy-test-coverage-with-constant-hamming-distance-of-1/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 03:47:19 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Math]]></category>

		<category><![CDATA[Other technical]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/08/21/easy-test-coverage-with-constant-hamming-distance-of-1/</guid>
		<description><![CDATA[I left a terrible bug in version 1.3 of my replacement Gina. I didn&#8217;t want to miss any test case this time, so I wrote a batch file that tests every one of them. That batch file adds a user to a group and a group to the registry. There are two possible groups in [...]]]></description>
			<content:encoded><![CDATA[<p>I left a terrible bug in version 1.3 of my <a href="http://www.paralint.com/projects/aucun/" target="_blank">replacement Gina</a>. I didn&#8217;t want to miss any test case this time, so I wrote a batch file that tests every one of them. That batch file adds a user to a group and a group to the registry. There are two possible groups in the registry, and the user can be a member of either two groups, making 2^(2+2) possibilities, 16 use cases.</p>
<p>After a few lines in, I realized that I would be less work to order the tests in a way that would minimize the change to the configuration between any two tests. In other words, when a n+1 test case required a change to the registry, then the user group membership should not change, and vice-versa. That would also make it easy to investigate a failed test, because only one thing would change between any two tests.</p>
<p>Then it hit me.</p>
<p>Well actually, I had to stop and think for a while. Kind of like my mind restoring a dusty old tape archive&#8230; I remembered that mathematician Richard Hamming had a <a href="http://en.wikipedia.org/wiki/Hamming_distance" target="_blank">code for that</a>. It&#8217;s a numbering scheme where only 1 bit changes between any two numbers. The number of bits that change is the Hamming distance between two numbers. Using four information bits to represent each possible use case, I came up with the following table. The first two rows (MSB, in blue) are user membership to a group, and the two last rows (LSB, in green) is the presence of that group in the registry. Ordering my tests that way gave me a constant Hamming distance of 1.</p>
<table border="1" cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr>
<td width="23" align="middle" valign="top"><strong>Decimal value</strong></td>
<td width="23" align="middle" valign="top"><strong>0</strong></td>
<td width="23" align="middle" valign="top"><strong>1</strong></td>
<td width="23" align="middle" valign="top"><strong>3</strong></td>
<td width="23" align="middle" valign="top"><strong>2</strong></td>
<td width="23" align="middle" valign="top"><strong>6</strong></td>
<td width="23" align="middle" valign="top"><strong>7</strong></td>
<td width="23" align="middle" valign="top"><strong>5</strong></td>
<td width="23" align="middle" valign="top"><strong>4</strong></td>
<td width="23" align="middle" valign="top"><strong>12</strong></td>
<td width="23" align="middle" valign="top"><strong>13</strong></td>
<td width="23" align="middle" valign="top"><strong>15</strong></td>
<td width="23" align="middle" valign="top"><strong>14</strong></td>
<td width="23" align="middle" valign="top"><strong>10</strong></td>
<td width="23" align="middle" valign="top"><strong>11</strong></td>
<td width="23" align="middle" valign="top"><strong>9</strong></td>
<td width="23" align="middle" valign="top"><strong>8</strong></td>
</tr>
<tr style="background-color: #B7C9E3;">
<td width="23" align="middle" valign="top"><span style="color: #000000;">Unlock</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
</tr>
<tr style="background-color: #B7C9E3;">
<td width="23" align="middle" valign="top"><span style="color: #000000;">Logoff</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
</tr>
<tr style="background-color: #c6e88c;">
<td width="23" align="middle" valign="top"><span style="color: #000000;">Unlock</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
</tr>
<tr style="background-color: #c6e88c;">
<td width="23" align="middle" valign="top"><span style="color: #000000;">Logoff</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><strong><span style="color: #000000;">1</span></strong></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">1</span></td>
<td width="23" align="middle" valign="top"><span style="color: #000000;">0</span></td>
</tr>
<tr>
<td width="23" valign="top">Expected test result</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top"><strong>Force logoff</strong></td>
<td width="23" valign="top"><strong>Force logoff</strong></td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top"><strong>Force logoff</strong></td>
<td width="23" valign="top"><strong>Unlock</strong></td>
<td width="23" valign="top"><strong>Unlock</strong></td>
<td width="23" valign="top"><strong>Unlock</strong></td>
<td width="23" valign="top"><strong>Unlock</strong></td>
<td width="23" valign="top">Gina</td>
<td width="23" valign="top">Gina</td>
</tr>
</tbody>
</table>
<p>The only drawback to this is that all the typing I saved writing my <a href="http://src.paralint.com/aucun/branches/force-logoff-bug/tests.cmd" target="_blank">test batch file</a>, I wasted on this blog post !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/08/21/easy-test-coverage-with-constant-hamming-distance-of-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>High availability for humans</title>
		<link>http://www.paralint.com/blog/2008/07/11/high-availability-for-humans/</link>
		<comments>http://www.paralint.com/blog/2008/07/11/high-availability-for-humans/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 12:30:43 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Life (the real one)]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=55</guid>
		<description><![CDATA[I noticed a new link in my GMail account (I am using gmail for your domain), showing the sessions used to connect to an account and the last time since it had activity on that session.
Pretty neat, although I doubt a regular user will be able to make sense of any of that&#8230; In my [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed a new link in my GMail account (I am using gmail for your domain), showing the sessions used to connect to an account and the last time since it had activity on that session.</p>
<p>Pretty neat, although I doubt a regular user will be able to make sense of any of that&#8230; In my case, it shows that from the last time I was online at home (IP 66.x.x.x) and the next time I was online at work (IP 199.x.x.x), there were only seven hours.</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tbody>
<tr>
<td colspan="2" valign="top"><strong>Recent activity:</strong></td>
</tr>
<tr>
<td colspan="2" valign="top">
<table border="1" cellspacing="0" cellpadding="4" width="97%">
<tbody>
<tr class="thead">
<td width="36%" valign="top"><strong>Access Type [ <a href="http://mail.google.com/support/bin/answer.py?ctx=%67mail&amp;answer=45938" target="activityHelp">?</a> ] </strong><br />
(Browser, mobile, POP3, etc.)</td>
<td width="24%" valign="top"><strong>IP address [ <a href="http://mail.google.com/support/bin/answer.py?ctx=%67mail&amp;answer=45938" target="activityHelp">?</a> ] </strong></td>
<td width="40%" valign="top"><strong>Date/Time</strong><br />
(Displayed in your time zone)</td>
</tr>
<tr>
<td valign="top">Browser</td>
<td valign="top">199.x.x.x *</td>
<td valign="top">8:16 am <strong>(0 minutes ago)</strong></td>
</tr>
<tr style="background-color: #c6e88c">
<td valign="top">Google Toolbar</td>
<td valign="top">66.x.x.x</td>
<td valign="top">12:41 am <strong>(7 hours ago) </strong></td>
</tr>
<tr>
<td valign="top">Browser</td>
<td valign="top">66.x.x.x</td>
<td valign="top">12:09 am (8 hours ago)</td>
</tr>
<tr>
<td valign="top">Browser</td>
<td valign="top">66.x.x.x</td>
<td valign="top">11:50 pm (8 hours ago)</td>
</tr>
<tr>
<td valign="top">Browser</td>
<td valign="top">199.x.x.x <strong>*</strong></td>
<td valign="top">Jul 10 (16 hours ago)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2" valign="top"><span class="subtext"> </span></td>
</tr>
</tbody>
</table>
<p>And yes, I took time to sleep, wake up the kids and have breakfast with them.</p>
<p>Time for coffee now !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/07/11/high-availability-for-humans/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Step by step guide to create your own MSCASH hashes</title>
		<link>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/</link>
		<comments>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 04:49:37 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Cryptography]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/</guid>
		<description><![CDATA[I wanted to test the relative strength of a password policy. I wanted to run a password cracking tool over different passwords, from a dictionary based password (like Banana42) to a random one (generated with Password Safe). Creating users setting passwords and running different password extraction tools was a lot of trouble.
I found a detailed [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to test the relative strength of a password policy. I wanted to run a password cracking tool over different passwords, from a dictionary based password (like Banana42) to a random one (generated with <a href="http://passwordsafe.sourceforge.net/" target="_blank">Password Safe</a>). Creating users setting passwords and running different password extraction tools was a lot of trouble.</p>
<p>I found a detailed <a href="http://www.securiteam.com/tools/5JP0I2KFPA.html" target="_blank">explanation of the MSCASH format</a>. Here is how you make your own MSCASH hashes to do close to reality benchmarks of your favourite password cracking tool.</p>
<p><span id="more-54"></span></p>
<p>The format is MD4(MD4(password) + username). password and username are in Unicode. In the explanation linked above, we have the classical &quot;user&quot; and &quot;password&quot; combination. Using notepad, type your password. Save the file using Unicode format. The first two bytes of the file will be FF and EF, a flag called the byte order mark (BOM). Delete them using <a href="http://www.mh-nexus.de/hxd/" target="_blank">an hexadecimal editor</a>. It should look like this :</p>
<pre class="generic:nogutter:nocontrols" name="code">Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  70 00 61 00 73 00 73 00 77 00 6F 00 72 00 64 00  p.a.s.s.w.o.r.d.</pre>
<p>Now calculate the first hash with openssl, with a binary output :</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">openssl dgst -md4 -binary password.unicode.txt &gt; md4.password</pre>
</p>
<p>Type and save your user name in Unicode format, remove the BOM, and concatenate the Unicode user name to the first hash.</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">copy /b md4.password + user.unicode.txt md4.password.user</pre>
</p>
<p>The file should look like this (the first 16 bytes is the md4 hash of the password) :</p>
<pre class="generic:nogutter:nocontrols" name="code">Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  88 46 F7 EA EE 8F B1 17 AD 06 BD D8 30 B7 58 6C  &#710;F&#247;&#234;&#238;.&#177;...&#189;&#216;0&#183;Xl
00000010  75 00 73 00 65 00 72 00                          u.s.e.r.</pre>
<p>Now just hash that last file, again with openssl :</p>
</p>
<pre class="generic:nogutter:nocontrols" name="code">openssl dgst -md4 md4.password.user
MD4(md4.password.user)= 2d9f0b052932ad18b87f315641921cda</pre>
</p>
<p>You can now use that MSCASH hash for your benchmarks. I hope you find it usefull. I might write a program in C to automate this, If I see good traffic on this post. Spread the word !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/07/06/step-by-step-guide-to-create-your-own-mscash-hashes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Notifu supports concatenation of parameters</title>
		<link>http://www.paralint.com/blog/2008/05/05/notifu-supports-concatenation-of-parameters/</link>
		<comments>http://www.paralint.com/blog/2008/05/05/notifu-supports-concatenation-of-parameters/#comments</comments>
		<pubDate>Mon, 05 May 2008 19:51:21 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/?p=52</guid>
		<description><![CDATA[This Notifu update allows you to concatenate multiple /m and /p switches. It is usefull when a paramater to Notifu is feed by a program you have no control over.
For example, this command line now works :
notifu /p Concatenate /p " this" /m "Hello" /m ", " /m "World"
Nothing is added to your parameters. If [...]]]></description>
			<content:encoded><![CDATA[<p>This <a title="Download Notifu" href="http://www.paralint.com/projects/notifu/download.html#Download">Notifu update</a> allows you to concatenate multiple /m and /p switches. It is usefull when a paramater to Notifu is feed by a program you have no control over.</p>
<p>For example, this command line now works :</p>
<pre class="generic:nogutter:nocontrols" name="code">notifu /p Concatenate /p " this" /m "Hello" /m ", " /m "World"</pre>
<p>Nothing is added to your parameters. If you want a space, you must add it.</p>
<p>Note to self : Got to fix my release script&#8230; A simple update takes longer to post online than to code !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/05/05/notifu-supports-concatenation-of-parameters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Notifu supports embedded quotes in parameters</title>
		<link>http://www.paralint.com/blog/2008/04/26/notifu-supports-embedded-quotes-in-parameters/</link>
		<comments>http://www.paralint.com/blog/2008/04/26/notifu-supports-embedded-quotes-in-parameters/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 02:42:16 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/04/26/notifu-supports-embedded-quotes-in-parameters/</guid>
		<description><![CDATA[I fixed a bug in notifu that made it ignore quotes that were escaped with a backslash. For example, this command line works now :

notifu /m "\"Theo Est\" test@example.com"

Thanks to Sof for the heads up ! 
]]></description>
			<content:encoded><![CDATA[<p>I fixed a bug in notifu that made it ignore quotes that were escaped with a backslash. For example, this command line works now :</p>
<p>
<pre class="generic:nogutter:nocontrols" name="code">notifu /m "\"Theo Est\" <a href="mailto:test@example.com">test@example.com</a>"</pre>
</p>
<p>Thanks to <a href="http://www.sof-paradise.info/" target="_blank">Sof</a> for the heads up ! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/04/26/notifu-supports-embedded-quotes-in-parameters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reversing WebSphere {xor} password protection</title>
		<link>http://www.paralint.com/blog/2008/03/21/reversing-websphere-xor-password-protection/</link>
		<comments>http://www.paralint.com/blog/2008/03/21/reversing-websphere-xor-password-protection/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 02:48:25 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/03/21/reversing-websphere-xor-password-protection/</guid>
		<description><![CDATA[IBM WebSphere stores its passwords in files. Everybody does that and it is hard to do otherwise. When I am confronted with the problem, I usually say that the only option you have is what file you want a password in. IBM (in WebSphere) went a little further by applying a hardcoded XOR. Each caracter [...]]]></description>
			<content:encoded><![CDATA[<p>IBM WebSphere stores its passwords in files. Everybody does that and it is hard to do otherwise. When I am confronted with the problem, I usually say that the only option you have is what file you want a password in. IBM (in WebSphere) went a little further by applying a hardcoded XOR. Each caracter is XORed with the caracter &#8216;_&#8217;, and the resulting string is encoded in base64. This is not cryptography, it is just enough encoding so that a casual glance at the file will not reveal the password.</p>
<p>If you have access to security.xml and need to know the passwords it contains, compile and run this tool. It supports :</p>
<ul>
<li>Encoded passwords on the command line (as many as you like)</li>
<li>Passwords piped in (default if no arguments are passed)</li>
<li>With or without the leading {xor}</li>
<li>It builds with Visual C++ and GNU g++ (tested with mingw32 version only)</li>
<li>A crude but working parsing so you can pipe the result of a grep, like this :<br />
<code>grep -i password security.xml | waspass</code></li>
</ul>
<p>You can get the source from my Subversion server with this command :</p>
<pre class="generic:nogutter:nocontrols" name="code">svn co http://src.paralint.com/spikes/waspass/trunk waspass</pre>
<p>I am also posting the full source inline, just to show off that <a href="http://code.google.com/p/syntaxhighlighter/" target="_blank">cool javascript code parser</a> I just installed&#8230;<strike><br />
</strike></p>
<p><span id="more-50"></span></p>
<pre name="code" class="cpp:nogutter:nocontrols">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

// get those 2 functions from
// http://src.paralint.com/spikes/waspass/trunk/waspass/base64.c
extern "C" int base64_init(void);
extern "C" int base64_decode(char *d, unsigned dlen, const char *s);

int decode_password(char *encoded_password);

//Cass decode_password, reading from the command line or stdin
int main(int argc, char* argv[])
{
	printf("Reverses WebSphere XOR password encoding.\n");
	printf("http://www.paralint.com/\n\n");

	base64_init();

	//Should we parse stdin
	if(argc == 1)
	{
		char line[2048];
		while(!feof(stdin))
		{
			fgets(line, sizeof line, stdin);
			decode_password(line);
		}
	}
	//Or read encoded passwords from the command line ?
	else for(int i=1; i&lt;argc; ++i)
	{
		decode_password(argv[i]);
	}

	return 0;
}

//Takes an encoded password like KzY4Oi0= and outputs the original password
//Supports minimal parsing: a password is the text between } and " (quote)
//either are optionnal and will be replaced by begining or end of line if
//missing
int decode_password(char *encoded_password)
{
	char *p;
	char encoded[1024];

	//naive remove the {xor} flag if present
	p = strchr(encoded_password, '}');
	if(p) ++p; else p = encoded_password;

	//naive truncate of the string
	strtok(p, "\"");

	printf("%s ", p);
	base64_decode(encoded, sizeof encoded, p);
	p = encoded;

	//stop at the trailing quote, allowing a brutal pipe from grep
	while(*p &amp;&amp; (*p != '\"'))
	{
		putc(*p++ ^ '_', stdout);
	}

	printf("\n");

	return p - encoded;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/03/21/reversing-websphere-xor-password-protection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Asymmetric cryptography mnemonic trick</title>
		<link>http://www.paralint.com/blog/2008/03/18/asymmetrick/</link>
		<comments>http://www.paralint.com/blog/2008/03/18/asymmetrick/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 17:57:35 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
		
		<category><![CDATA[Cryptography]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/03/18/asymmetrick/</guid>
		<description><![CDATA[When ever I teach cryptography to beginners, they are confused   with what you can do with the private and public key, in an   asymmetric cryptographic scheme. I start by saying the your   private key never leaves you, no matter what. No exception to the   rules.
To help with [...]]]></description>
			<content:encoded><![CDATA[<p>When ever I teach cryptography to beginners, they are confused   with what you can do with the private and public key, in an   asymmetric cryptographic scheme. I start by saying the your   private key never leaves you, no matter what. No exception to the   rules.</p>
<p>To help with the rest, I made this chart.</p>
<table id="wzwo" border="1" cellpadding="3" cellspacing="0" width="100%">
<tr>
<th>Operation (below) key used (right)</th>
<th>Public key</th>
<th>Private key</th>
</tr>
<tr>
<td>Encryption (done by the sender)</td>
<td bgcolor="#66cccc">Encrypt a message for           an individual (that &#8220;message&#8221; is often a symmetric           key)</td>
<td bgcolor="#ffcc33">Generate a digital           signature (encrypt a document hash)</td>
</tr>
<tr>
<td>Decryption (done by the           receiver)</td>
<td bgcolor="#ffcc00">Verify a digital           signature (decrypt a hash of the message)</td>
<td bgcolor="#66cccc">Decrypt a message           destined to you (that &#8220;message is often a symmetric           key)</td>
</tr>
</table>
<p>The colors in that chart indicate operations that are related to each other. To put it in words:</p>
<ul>
<li>If you use a public key for encryption, you will use your private key for decryption.</li>
<li>If you use a private key for encryption, you will use a public key for decryption</li>
</ul>
<p>But most students need some time to reach the asymmetric   cryptography enlightenment. When they do reach it, I have to   convince them that it is not the silver bullet it looks like. I   found that remembering this chart helps them cram study for an   exam.</p>
<p>Hope this helps !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/03/18/asymmetrick/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
