<?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>Parallel Interface &#187; Cryptography</title>
	<atom:link href="http://www.paralint.com/blog/category/cryptography/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>
	<lastBuildDate>Thu, 26 Aug 2010 17:24:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<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. [...]]]></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>
		<slash:comments>0</slash:comments>
		</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 [...]]]></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>
		<slash:comments>0</slash:comments>
		</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 the rest, I made this chart. Operation [...]]]></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>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gathering entropy from children</title>
		<link>http://www.paralint.com/blog/2008/01/13/gathering-entropy-from-children/</link>
		<comments>http://www.paralint.com/blog/2008/01/13/gathering-entropy-from-children/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 02:53:37 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Life (the real one)]]></category>

		<guid isPermaLink="false">http://www.paralint.com/blog/2008/01/13/gathering-entropy-from-children/</guid>
		<description><![CDATA[Here is a trick I found that solved an old problem: How can coin flipping ever be fair if only one person chooses head or tail ? I remember Chrissy complaining about that to Jack in an episode of &#8220;Three&#8217;s Company&#8221;. Above the humour, I remember thinking about fair coin flipping back then, many years [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a trick I found that solved an old problem: How can coin flipping ever be fair if only one person chooses head or tail ?</p>
<p>I remember <a href="http://en.wikipedia.org/wiki/Chrissy_Snow" target="_blank">Chrissy</a> complaining about that to Jack in an episode of &#8220;Three&#8217;s Company&#8221;. Above the humour, I remember thinking about fair coin flipping back then, many years before I learned anything about cryptography.</p>
<p>The other day, I was asked the very same question by my daughter. Children are great entropy generators (you can tell by the mess they make of their toys). I found a way to solve the problem by having both of them part of the coin flipping. Well I don&#8217;t flip a coin. I hide it in one of my hands, behind my back. Here is how it goes:</p>
<ol>
<li>I lay out the outcome first. Something like &#8220;If you get the coin, you&#8217;re the one who take her bath first&#8221;</li>
<li>I start shuffling the coin from one hand to the other, behind my back.</li>
<li>One of them says &#8220;stop&#8221;.</li>
<li>I leave the coin in the hand it was when I was told to stop.</li>
<li>I show both hands (fists, actually) to my other kid, who gets to choose a hand.</li>
</ol>
<p>(The entropy gathering is at step 3). If she gets the coin, she knows the outcome. No more &#8220;it&#8217;s not fair&#8221; complaints <img src='http://www.paralint.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.paralint.com/blog/2008/01/13/gathering-entropy-from-children/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
