<?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>oh god, why'd it break‽ &#187; ecryptfs</title>
	<atom:link href="http://yokohead.com/tag/ecryptfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://yokohead.com</link>
	<description>screwing around with technology</description>
	<lastBuildDate>Mon, 26 Jul 2010 18:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring ecryptfs</title>
		<link>http://yokohead.com/2009/02/configuring-ecryptfs/</link>
		<comments>http://yokohead.com/2009/02/configuring-ecryptfs/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 07:59:20 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[configure]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[ecryptfs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://yokohead.com/?p=220</guid>
		<description><![CDATA[I was reading through my buddy&#8217;s security blog, Security Aegis, and realized that my current security setup in Ubuntu is absolutely terrible &#8211; I have a Truecrypt container I dump things into from time to time,  and that&#8217;s really about it.  After recently discovering the Ubuntu Pocket Guide and Reference,  I took [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading through my buddy&#8217;s security blog, <a href="http://www.securityaegis.com">Security Aegis</a>, and realized that my current security setup in Ubuntu is absolutely terrible &#8211; I have a Truecrypt container I dump things into from time to time,  and that&#8217;s really about it.  After recently discovering the <a href="http://www.ubuntupocketguide.com/index2.html">Ubuntu Pocket Guide and Reference</a>,  I took a quick look through there to see what might be available.</p>
<p>The guide mentioned Intrepid has the ability to create an automounting private folder using <em>ecryptfs‐utils </em>with next to no setup.  That&#8217;s nice,  but I&#8217;d rather have a bit more control over the folder &#8211; having it just pop up on login isn&#8217;t very appealing since my system gets used from time to time by other people.  A bit of googling around turned this up:</p>
<ol>
<li><a href="http://beginlinux.com/desktop_training/ubuntu/1084-solving-privacy-issues- ">How to auto-configure<br />
 </a></li>
<li><a href="http://www.ubuntugeek.com/how-to-create-a-private-encrypted-folder-on-ubuntu-810-intrepid.html">How to configure hands on</a></li>
<li><a href="http://tombuntu.com/index.php/2007/09/03/using-truecrypt-on-ubuntu-for-encryption/">The basic truecrypt way</a></li>
</ol>
<p><a href="http://ubuntugeek.com">Ubuntugeek</a> has a nice writeup on the under-the-hood way to use <em>ecryptfs-utils</em>.  The reason I&#8217;m going with this over <a href="http://truecrypt.org">Truecrypt</a> is I&#8217;d rather have the files encrypt on the fly without needing a set amount of space first (as in a container).  I&#8217;ll keep the containers on my thumb drives for now.</p>
<p>Started with the Ubuntugeek step by step:</p>
<ul>
<li><code>sudo aptitude install ecryptfs-utils</code></li>
<li><code>mkdir ~/crypt</code></li>
<li><code>chmod 700 ~/crypt</code></li>
<li><code>sudo mount -t ecryptfs ~/crypt ~/crypt
<ul>
<li>chose 4 for passphrase</li>
<li>created passphrase<</li>
<li>selected aes for cipher</li>
<li>16 for blocksize</li>
</ul>
<p></code></li>
</ul>
<p>After selecting my options:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; text-align: left;" dir="ltr">
Attempting to mount with the following options:
 ecryptfs_key_bytes=16
 ecryptfs_cipher=aes
 ecryptfs_sig=1c56a17407ef3160
 WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt],
 it looks like you have never mounted with this key
 before. This could mean that you have typed your
 passphrase wrong.

Would you like to proceed with the mount (yes/no)? yes
 Would you like to append sig [1c56a17407ef3160] to
 [/root/.ecryptfs/sig-cache.txt]
 in order to avoid this warning in the future (yes/no)? yes
 Successfully appended new sig to user sig cache file
 Mounted eCryptfs
</pre>
<p>Not quite sure what just happened there.  I just installed this thing,  of course I haven&#8217;t mounted with this key before.  I wasn&#8217;t asked for a plaintext passthrough either.  Check to see if it worked anyways.</p>
<ul>
<li><code>cp Firefox_wallpaper.png ~/crypt</code></li>
<li><code>ls ~/crypt</code></li>
<li><code>sudo umount ~/crypt</code></li>
<li><code>ls ~/ | grep crypt</code></li>
</ul>
<p>Crypt is still there!  Blast.</p>
<ul>
<li><code>ls ~/crypt</code></li>
</ul>
<p>It still shows my png file too!</p>
<ul>
<li><code>gnome-open ~/crypt/Firefox_wallpaper.png</code></li>
</ul>
<p>&#8220;Fatal error reading PNG image file: Not a PNG file&#8221;</p>
<p>Alright,  so that&#8217;s good,  it&#8217;s probably encrypted then.  I&#8217;ll remount and see if it&#8217;ll open.</p>
<ul>
<li><code>sudo mount -t ecryptfs ~/crypt ~/crypt -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n</code></li>
<li><code>gnome-open ~/crypt/Firefox_wallpaper.png</code></li>
</ul>
<p>Yep,  opens fine now.  Since I was expecting Truecrypt style mount behavior from Windows I was expecting the entire folder to just disapear (even though I specifically created one,  duh).  Reading through the <a href="https://launchpad.net/ecryptfs">ecryptfs page</a> and <a href=" http://www.makeuseof.com/tag/encrypt-your-files-in-linux-with-ecryptfs/">here</a> made a bit more sense.  Without pre-allocation there isn&#8217;t much of a choice anyways.  Time to turn this bulky command into an easy use alias:</p>
<ul>
<li><code>echo "alias mount-crypt='sudo mount -t ecryptfs ~/crypt ~/crypt -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=n'" | tee -a ~/.bash_aliases</code></li>
<li><code>source .bashrc</code></li>
</ul>
<p>Figuring out the above took a bit longer than those two lines&#8230;  here&#8217;s some <a href="http://dl.getdropbox.com/u/461380/whyillneverprogram.txt">insight</a> into my rookie mistakes.  (460 through 471 was me playing videos in terminal via ascii, heh.)</p>
]]></content:encoded>
			<wfw:commentRss>http://yokohead.com/2009/02/configuring-ecryptfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
