<?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>John Hobbs on coding, Omaha, and life in general &#187; Security</title>
	<atom:link href="http://www.velvetcache.org/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.velvetcache.org</link>
	<description>I Love Darcy. I Love Code. I love Omaha.</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:00:07 +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>Linux Encrypted Laptop</title>
		<link>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop</link>
		<comments>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop#comments</comments>
		<pubDate>Fri, 25 Jan 2008 05:22:40 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop/</guid>
		<description><![CDATA[This post will (try to) explain how to set up a working system of hard drive encryption on a Debian system, in this case sidux. I&#8217;m going to outline the specific course of action I took to set up my own laptop, but will try to provide generic enough instructions alongside that to help the [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/25/linux-and-western-digital' rel='bookmark' title='Permanent Link: Linux And Western Digital'>Linux And Western Digital</a></li>
<li><a href='http://www.velvetcache.org/2008/01/16/submitting-assignments-in-blackboard-with-linux' rel='bookmark' title='Permanent Link: Submitting Assignments In Blackboard With Linux'>Submitting Assignments In Blackboard With Linux</a></li>
<li><a href='http://www.velvetcache.org/2007/03/18/digipro-tablet-and-linux' rel='bookmark' title='Permanent Link: DigiPro Tablet And Linux'>DigiPro Tablet And Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>
This post will (try to) explain how to set up a working system of hard drive encryption on a Debian system, in this case <a href="http://www.sidux.com/">sidux</a>.  I&#8217;m going to outline the specific course of action I took to set up my own laptop, but will try to provide generic enough instructions alongside that to help the reader adapt it for themselves.  Please excuse the wild tense changing and poor overall writing style, I&#8217;m not that good at this stuff.
</p>
<p>
This post <u>is not</u> aimed at the novice Linux user.  I&#8217;m not going to hold your hand, so be comfortable with the command line and competent enough to get your system back if you screw up along the way.  Also, <u>do not</u> skip the backup step!  Finally, this is (obviously) not a wholly original and independent work, I owe a great deal to the sources I&#8217;ve listed at the bottom.  Enjoy!
</p>
<p>
<b>The Context</b><br/>I run Linux on my laptop and I want to encrypt the important parts of my hard drive because there is a lot of my personal life on there.  Most specifically I&#8217;m interested in my passwords, many of which I store in <span style="text-decoration: line-through;">firefox</span> Iceweasel for convenience, and my financial data which is in the form of KMyMoney files and pdf receipts.
</p>
<p>
Here&#8217;s the layout of my disk, and yes I know I have outrageous sizes on some of these partitions, I just like to have breathing room. Please see <a href="#sources"><sup>[1]</sup></a> for a good guide to partitioning.</p>
<table>
<tr>
<td>/dev/sda1</td>
<td>ntfs</td>
<td>/windows</td>
<td>40.00 GB</td>
</tr>
<tr>
<td>/dev/sda2</td>
<td>ext3</td>
<td>/</td>
<td>15.00 GB</td>
</tr>
<tr>
<td>/dev/sda3</td>
<td>EXTENDED</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda6</td>
<td>swap</td>
<td></td>
<td>509.81 MB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda7</td>
<td>ext3</td>
<td>/tmp</td>
<td>1.00 GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda8</td>
<td>ext3</td>
<td>/var</td>
<td>5.00 GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda9</td>
<td>ext3</td>
<td>/home</td>
<td>39.51GB</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;/dev/sda5</td>
<td>fat32</td>
<td>/winshare</td>
<td>9.98 GB</td>
</tr>
<tr>
<td>/dev/sda4</td>
<td>ext3</td>
<td>/data</td>
<td>121.88 GB</td>
</tr>
</table>
<p>
What we need to encrypt on there are: /home, /tmp, /data and /swap.  I&#8217;ll be treating the /windows and the /winshare as dirty and never let anything important touch those partitions, I rarely boot into XP for anything but school work anyway.
</p>
<p>
<b>The Tools</b><br/>You&#8217;ll need a very few pieces of software, and possibly a piece of hardware.  For the software side you just need &#8220;<tt>cryptsetup</tt>&#8221; and possibly a partitioning tool if you want to change your layout.  You&#8217;ll also be needing some spare hard drive space to hold your existing data if you have any.  I used an 80 GB external drive I had on hand.
</p>
<p>
<b>Backup</b><br/>I&#8217;m using an existing system as my base, so I have to copy off my /home and /data partitions.  Once we are backed up, it&#8217;s important to write down somewhere the /dev names of the file system.  I made a little table, like the one above, by using gparted.
</p>
<p>
<b>Unmounting</b><br/>Now I&#8217;m going to go down to run level 3.  This is just to minimize noise on the system.  We need to unmount /home, /data and /tmp.  When unmounting file systems, you might get something like the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">root@asuka:/home/jmhobbs# umount /tmp
umount: /tmp: device is busy
umount: /tmp: device is busy
root@asuka:/home/jmhobbs#</pre></div></div>

<p>This just tells us there is an open file descriptor on /tmp, we can see who has it with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>asuka:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>jmhobbs<span style="color: #666666; font-style: italic;"># lsof | grep /tmp</span>
COMMAND    PID    USER   FD   TYPE     DEVICE SIZE   NODE NAME
atievents <span style="color: #000000;">3037</span>    root    4r   DIR      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">4096</span>  <span style="color: #000000;">29249</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.X11-unix
kdeinit   <span style="color: #000000;">5418</span> jmhobbs    8u  unix 0xf31fc000       <span style="color: #000000;">11568</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ksocket-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>kdeinit-
gconfd-<span style="color: #000000;">2</span>  <span style="color: #000000;">6127</span> jmhobbs   11wW  REG      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span>  <span style="color: #000000;">625</span> <span style="color: #000000;">102371</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>gconfd-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>0t1201112611ut204480u1000p6127r1358695165k3219666472 <span style="color: #7a0874; font-weight: bold;">&#40;</span>deleted<span style="color: #7a0874; font-weight: bold;">&#41;</span>
konqueror <span style="color: #000000;">6627</span> jmhobbs   12u   REG      <span style="color: #000000;">254</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">1270</span>  <span style="color: #000000;">58498</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>kde-jmhobbs<span style="color: #000000; font-weight: bold;">/</span>konqueror-crash-y2tzca.log
root<span style="color: #000000; font-weight: bold;">@</span>asuka:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>jmhobbs<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>Now in the above example it is obvious that I did not go down to run level 3, X11 and kde are still running.  So just weed out the open files and then unmount them when there are none left.
</p>
<p>
<b>Encrypting</b><br/>This is where that /dev table you made earlier (you did make it right?) comes in handy.    Be sure that you are backed up, because this is the point of no return.  Setting up an encrypted partition is dead simple.  As root you&#8217;ll want to run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--verify-passphrase</span> luksFormat <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9</pre></div></div>

<p>Where /dev/sda9 is your /home partition.  I encourage you to go read the man pages for cryptsetup <a href="#sources"><sup>[2]</sup></a>.  I just went with the values on a post I found <a href="#sources"><sup>[3]</sup></a>.
</p>
<p>
Now we need to open and format that, so we use cryptsetup to open it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup luksOpen <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9 chome</pre></div></div>

<p>This is going to create a mapper device called &#8220;chome&#8221; in /dev/mapper/chome.  You don&#8217;t need to call it chome, I just do it to keep track of whats what.
</p>
<p>
Now to format it we need to do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkfs.ext3 <span style="color: #660033;">-j</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-O</span> dir_index,filetype,sparse_super <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>chome</pre></div></div>

<p>The file system really doesn&#8217;t matter, you can use ext2, reiserfs, whatever your heart desires.  Once you&#8217;ve done that, you&#8217;ll want to close it again.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cryptsetup luksClose chome</pre></div></div>

</p>
<p>
We need to repeat that process for /data, but since it&#8217;s essentially the same procedure I&#8217;m not going to run through it here.
</p>
<p>
The /tmp partition is a different story.  You&#8217;ve got an existing file system on there that we need to blow away.  The first way that came into my head was to use <tt>dd</tt> to copy zeros over it, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda7</pre></div></div>

<p>That&#8217;ll probably take a while and not report in.  You can force it to give you a status by stopping it, sending it a <tt>USR1</tt> signal then restarting it.  Not really a big deal though, I just waited it out.
</p>
<p>
It also might be wise to increase the block size on that, and you might not have to do the whole thing either.  Again, refer to the man pages <a href="#sources"><sup>[4]</sup></a> if it concerns you.
</p>
<p>
<b>Set Up crypttab And fstab</b><br/>We now need to update our fstab and the crypt equivalent, crypttab.  This is going to vary for everyone, but there are a few key things to note.  Let&#8217;s look at crypttab first.  Here&#8217;s mine, and I&#8217;ll walk you through it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># &lt;target name&gt; &lt;source device&gt;         &lt;key file&gt;      &lt;options&gt;</span>
chome   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda9                       none luks
cdata    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>                               none luks
cswap   <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random     swap
ctmp    <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda7       <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>random     tmp</pre></div></div>

</p>
<p>
So the major things here are the target, which is what the device will be called in /dev/mapper.  I picked the easy to associate: chome,cdata, cswap, and ctmp.  Next is the source device, which are the partitions we messed with earlier.  The key file is set to /dev/random on cswap and ctmp because those are going to be one time file systems, and the key should just be random garbage.
</p>
<p>
Finally we get to options.  chome and cdata have &#8220;none&#8221; in there.  This is just saying &#8220;prompt us for the password&#8221;.  You could put the password in there and it would happily take care of it for you, but that seems like a stupid thing to do to me.  The &#8220;luks&#8221; just tells it to use the luks extensions.  cswap and ctmp both use special options.  The swap and tmp options basically say &#8220;reformat this then encrypt it&#8221;. They are reformatted on boot to linux-swap and ext2 file systems, respectively.  For more information check out the, you guessed it, man page <a href="#sources"><sup>[5]</sup></a>.
</p>
<p>
Now that we&#8217;ve got the crypttab set up we need to modify out fstab.  Again, I&#8217;ll show you the relevant parts of mine, and walk you through.  It&#8217;s pretty simple though.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/fstab - static information about the filesystems - fstab(5)</span>
<span style="color: #666666; font-style: italic;"># &lt;filesystem&gt;  &lt;mountpoint&gt;    &lt;type&gt;          &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part2, /dev/sda2</span>
<span style="color: #007800;">UUID</span>=60a14eae-a8c7-4ecb-a222-79a0e97fd73e       <span style="color: #000000; font-weight: bold;">/</span>       ext3    defaults,noatime,<span style="color: #007800;">errors</span>=remount-ro      <span style="color: #000000;">0</span>       <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part7, /dev/sda7</span>
<span style="color: #666666; font-style: italic;">#UUID=0da43c8e-2a64-4f45-b967-91504b4aa167      /tmp    ext3    defaults,noatime        0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>ctmp                                <span style="color: #000000; font-weight: bold;">/</span>tmp    ext2    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part9, /dev/sda9</span>
<span style="color: #666666; font-style: italic;">#UUID=3ee7225e-f04a-4d96-b28d-e867ed38a73c      /home   ext3    defaults,noatime        0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>chome                               <span style="color: #000000; font-weight: bold;">/</span>home   ext3    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part4, /dev/sda4, LABEL=\x2fdata</span>
<span style="color: #666666; font-style: italic;">#UUID=e3e9105b-1820-4edc-a660-7d569bc61900       /data   ext3    auto,users,exec,noatime 0       2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>cdata                               <span style="color: #000000; font-weight: bold;">/</span>data   ext3    defaults,noatime        <span style="color: #000000;">0</span>       <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># automatically added, WDC_WD2500BEVS-0-WD-WXC607403544-part6, /dev/sda6</span>
<span style="color: #666666; font-style: italic;">#UUID=21ac314b-704b-4675-bf5e-769745b46f7a      none    swap    sw      0       0</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>cswap                               none    swap    sw      <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span></pre></div></div>

</p>
<p>
Okay, so, the basic idea is that we find the old /tmp, /home, /data and swap entries, and replace them with the mapped ones.  One important item here is that you&#8217;ll want to set that last digit to a <b>0</b> on /tmp.  This is what says &#8220;Hey, fsck me!&#8221; at boot time, and we don&#8217;t want to bother with a checking a brand new file system, right?
</p>
<p>
<b>cryptdisks And cryptdisks-early</b><br/>These two are the init scripts for starting up your disks.  They should be in /etc/init.d, which on my system just lead to /lib/cryptsetup/cryptdisks.functions.  I tried using bum to add them, but I wasn&#8217;t getting them to run before the mounting took place.  I poked around on the sidux forums and found a post <a href="#sources"><sup>[6]</sup></a> (in German) that had another way of adding them.  I don&#8217;t know if this is a Debian issue or not, but the following worked for me, as root.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update-rc.d <span style="color: #660033;">-f</span> cryptdisks-early remove
update-rc.d <span style="color: #660033;">-f</span> cryptdisks remove
update-rc.d cryptdisks-early start <span style="color: #000000;">26</span> S . start <span style="color: #000000;">59</span> <span style="color: #000000;">0</span> <span style="color: #000000;">6</span> .
update-rc.d cryptdisks start <span style="color: #000000;">28</span> S . start <span style="color: #000000;">48</span> <span style="color: #000000;">0</span> <span style="color: #000000;">6</span> .</pre></div></div>

</p>
<p>
<b>Reboot</b><br/>Now you should be able to just reboot and be good to go.  I&#8217;m not 100% on this guide as I made it after the fact, so I may have spaced off some small things.  If I did, they should be very, very minor and shouldn&#8217;t cause any problems.  Please do leave comments if you have an issue, I&#8217;d like to correct any errors I may have made.  There are some additional sources below, please read up if you have the time.  Good luck!
</p>
<p>
<a name="sources"></a><br />
<b>Sources</b></p>
<style type="text/css">
ol li {
  list-style-type: decimal;
background: none;
margin: 0px;
padding: 0px;
}
</style>
<ol>
<li><a href="http://www.linuxsa.org.au/tips/disk-partitioning.html">Linux Tips &#8211; Disk Partitioning</a></li>
<li><a href="http://linux.die.net/man/8/cryptsetup">cryptsetup(8)</a></li>
<li><a href="http://www.fsckin.com/2008/01/15/howto-setup-and-benchmark-encrypted-partitions-in-ubuntu/">HowTo: Setup and Benchmark Encrypted Partitions in Ubuntu</a></li>
<li><a href="http://linux.die.net/man/1/dd">dd(1)</a></li>
<li><a href="http://linux.die.net/man/5/crypttab">crypttab(5)</a></li>
<li><a href="http://forums.sidux.com/PNphpBB2-viewtopic-t-8029-highlight-cryptdisksearly.html">Startskript &#8220;cryptdisks-early&#8221; wird zu spät ausgef</a></li>
<li><a href="http://www.enterprisenetworkingplanet.com/netsecur/article.php/3683011">Protect Your Stuff With Encrypted Linux Partitions</a> &#8211; <a href="http://www.enterprisenetworkingplanet.com/netsecur/article.php/3683996">(And Part 2)</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/25/linux-and-western-digital' rel='bookmark' title='Permanent Link: Linux And Western Digital'>Linux And Western Digital</a></li>
<li><a href='http://www.velvetcache.org/2008/01/16/submitting-assignments-in-blackboard-with-linux' rel='bookmark' title='Permanent Link: Submitting Assignments In Blackboard With Linux'>Submitting Assignments In Blackboard With Linux</a></li>
<li><a href='http://www.velvetcache.org/2007/03/18/digipro-tablet-and-linux' rel='bookmark' title='Permanent Link: DigiPro Tablet And Linux'>DigiPro Tablet And Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2008/01/25/linux-encrypted-laptop/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BlowPass Has Taken Over</title>
		<link>http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over</link>
		<comments>http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over#comments</comments>
		<pubDate>Thu, 07 Dec 2006 08:29:58 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BlowPass]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over/</guid>
		<description><![CDATA[So I thought that I had moved past BlowPass. I guess I was wrong. I&#8217;ve been spending every spare moment working on it. I found what I feel is a better Blowfish library at www.farfarfar.com. I still can&#8217;t implement any of the vector tests because they&#8217;re all in hex and translate into nasty characters. This [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/12/04/passletcom' rel='bookmark' title='Permanent Link: Passlet.com'>Passlet.com</a></li>
<li><a href='http://www.velvetcache.org/2007/07/07/blowpass-alpha-release' rel='bookmark' title='Permanent Link: BlowPass Alpha Release'>BlowPass Alpha Release</a></li>
<li><a href='http://www.velvetcache.org/2007/01/30/blowpass-v060-a-major-revision' rel='bookmark' title='Permanent Link: BlowPass V0.60 &#8211; A Major Revision'>BlowPass V0.60 &#8211; A Major Revision</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So I <a href="http://www.velvetcache.org/2006/12/04/passletcom/" target="_blank">thought that I had moved past BlowPass</a>.  I guess I was wrong.  I&#8217;ve been spending every spare moment working on it.  I found what I feel is a better Blowfish library at <a href="http://www.farfarfar.com/scripts/encrypt/" target="_blank">www.farfarfar.com</a>.  I still can&#8217;t implement any of the vector tests because they&#8217;re all in hex and translate into nasty characters.  This means I have no actual idea if the crypt is working. I also quickly stopped trying to write my own Twofish implementation.  I could handle it in C I think, but not JavaScript, I don&#8217;t know enough of it and it&#8217;s little oddities.</p>
<p>Regardless of all that, I&#8217;ve got my prototype AJAX down pat now (okay, AHAH) and I&#8217;m working up my own open source version of <a href="http://www.passlet.com/" target="_blank">passlet.com</a>.  Here&#8217;s a nice list of features/todo&#8217;s.</p>
<ul>
<li>Uses a non-proprietary algorithm (Blowfish)</li>
<li>Has AJAX-y-ness</li>
<li>Uses PHP</li>
<li>Uses a database abstraction library TODO</li>
<li>Slick animations (mootools?) TODO</li>
</ul>
<p>You can check out the current version at <a href="http://static.velvetcache.org/projects/blowpass/demo/">http://static.velvetcache.org/projects/blowpass/demo/</a> to play around.</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/12/04/passletcom' rel='bookmark' title='Permanent Link: Passlet.com'>Passlet.com</a></li>
<li><a href='http://www.velvetcache.org/2007/07/07/blowpass-alpha-release' rel='bookmark' title='Permanent Link: BlowPass Alpha Release'>BlowPass Alpha Release</a></li>
<li><a href='http://www.velvetcache.org/2007/01/30/blowpass-v060-a-major-revision' rel='bookmark' title='Permanent Link: BlowPass V0.60 &#8211; A Major Revision'>BlowPass V0.60 &#8211; A Major Revision</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Passlet.com</title>
		<link>http://www.velvetcache.org/2006/12/04/passletcom</link>
		<comments>http://www.velvetcache.org/2006/12/04/passletcom#comments</comments>
		<pubDate>Mon, 04 Dec 2006 21:51:59 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BlowPass]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2006/12/04/passletcom/</guid>
		<description><![CDATA[I saw on my Ajaxian feed today a neat service called Passlet. Essentially it is a password keeper, like KisKis or the one built into Firefox. The novelty here is that it uses JavaScript to handle all the encrypting and decrypting on the client side. That means no transmission of clear text information, not even [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over' rel='bookmark' title='Permanent Link: BlowPass Has Taken Over'>BlowPass Has Taken Over</a></li>
<li><a href='http://www.velvetcache.org/2007/07/07/blowpass-alpha-release' rel='bookmark' title='Permanent Link: BlowPass Alpha Release'>BlowPass Alpha Release</a></li>
<li><a href='http://www.velvetcache.org/2007/03/08/bitwise-operators-and-blowfish' rel='bookmark' title='Permanent Link: Bitwise Operators And Blowfish'>Bitwise Operators And Blowfish</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I saw on my <a href="http://ajaxian.com/archives/passlet-ajax-password-manager-with-aes-client-side-encryption" target="_blank">Ajaxian</a> feed today a neat service called <a href="https://www.passlet.com/" target="_blank">Passlet</a>.  Essentially it is a password keeper, like <a href="http://kiskis.sourceforge.net/" target="_blank">KisKis</a> or the one built into Firefox.  The novelty here is that it uses JavaScript to handle all the encrypting and decrypting on the client side.  That means no transmission of clear text information, not even over SSL.</p>
<p>I happily admit I&#8217;d been thinking about this concept for at least 4 months.  See, I liked KisKis a lot.  It was Java, used good, solid encryption and had a nice interface.  Problem was, it&#8217;s hard to keep my thumb drive version synced to my box versions, and I rarely remembered to anyway.  So I thought, why not make a web based password keeper that used JavaScript to keep it secure?</p>
<p>The result was <a href="http://static.velvetcache.org/projects/blowpass/" target="_blank">BlowPass</a> which uses a JavaScript implementation of the Blowfish cipher.  I was working on the Ajax stuff when I got frustrated with mootools and left it alone. It has several key weaknesses, and I suppose I could learn from Passlet, but, I may as well just use it instead of finishing BlowPass.  If you want the source to BlowPass leave me a note.  Thats my GPL disclaimer since the Blowfish implementation was GPL&#8217;d.</p>
<div class="update">
<p><b>Update (01/11/07)</b><br/>BlowPass is semi-active now, you can get more information and try it out at <a href="http://static.velvetcache.org/projects/blowpass" target="_blank">http://static.velvetcache.org/projects/blowpass</a>.  It&#8217;s still a rather raw version though.  If you aren&#8217;t concerned about the &#8220;open-source&#8221; aspect (e.g. don&#8217;t want to host it and mod it yourself) I&#8217;d go use passlet or passpack.</p>
</div>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/12/07/blowpass-has-taken-over' rel='bookmark' title='Permanent Link: BlowPass Has Taken Over'>BlowPass Has Taken Over</a></li>
<li><a href='http://www.velvetcache.org/2007/07/07/blowpass-alpha-release' rel='bookmark' title='Permanent Link: BlowPass Alpha Release'>BlowPass Alpha Release</a></li>
<li><a href='http://www.velvetcache.org/2007/03/08/bitwise-operators-and-blowfish' rel='bookmark' title='Permanent Link: Bitwise Operators And Blowfish'>Bitwise Operators And Blowfish</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/12/04/passletcom/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WLAN Router Monitor BASH Script</title>
		<link>http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script</link>
		<comments>http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script#comments</comments>
		<pubDate>Thu, 16 Nov 2006 07:46:45 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script/</guid>
		<description><![CDATA[I was reading some material on WEP and WPA cracking, and decided to write a monitor for our router. I was curious if anyone other than us hooked up. I&#8217;ve turned off the MAC filtering on it and got my BASH script working. I&#8217;m kinda proud of it actually. I wrote it from scratch, just [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2007/10/08/easy-makefiles' rel='bookmark' title='Permanent Link: Easy Makefiles'>Easy Makefiles</a></li>
<li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2010/01/13/fh-init-script-additions-throttle-unthrottle' rel='bookmark' title='Permanent Link: F@h Init Script Additions: throttle &#038; unthrottle'>F@h Init Script Additions: throttle &#038; unthrottle</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was reading some material on WEP and WPA cracking, and decided to write a monitor for our router. I was curious if anyone other than us hooked up.  I&#8217;ve turned off the MAC filtering on it and got my BASH script working.</p>
<p>I&#8217;m kinda proud of it actually.  I wrote it from scratch, just hit up the man pages on my system for hints.  I wanted to use <tt>lynx -dump</tt> on the &#8220;Attached Devices&#8221; page, but I couldn&#8217;t get lynx to authenticate from the command line.  I decided to use <tt>wget</tt> instead, since it worked just fine.  I also knew I had <tt>html2txt</tt> installed from something else, so that was good too.</p>
<p>Here&#8217;s the script, password removed of course. The slickness is all in that last line, pardon my WP plug-in&#8217;s poor highlighting.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>routerLog
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>routerLog
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> - http:<span style="color: #000000; font-weight: bold;">//</span>admin:PASSWORD<span style="color: #000000; font-weight: bold;">@</span>192.168.1.1<span style="color: #000000; font-weight: bold;">/</span>DEV_device.htm <span style="color: #000000; font-weight: bold;">|</span> html2text <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>routerLog</pre></td></tr></table></div>

<p>The one tough feature to find was getting <tt>wget</tt> to print to the stdout instead of to a file.  Thats what the <tt>-O - </tt> does.</p>
<p>It works nice, but it has a lot of extra spacing in it.  I tried to do a <tt>sed</tt> line to filter out multiple newlines, but I&#8217;ve never actually used <tt>sed</tt>, and I couldn&#8217;t get it working.  Maybe it&#8217;s my regex: <tt>s/\n{2,}//g</tt>.  Dunno, not a biggie.  I hooked up a cron job for every 15 minutes, we&#8217;ll see what I catch (and how bloated that log file will get)</p>
<p>P.S. The router is a NetGear WGR614 v5</p>
<p>P.P.S. I got to thinking about that comment about MAC filtering.  With a big network you could camp out with Kismet, grab some attached devices MAC, wait until it disconnects and change your MAC to it&#8217;s.  While you wait you can crack the WEP too.  MAC filtering really isn&#8217;t as good as I thought.  Same with <a href="http://www.blackalchemy.to/project/fakeap/" target="_blank">fakeap</a>.  If only one ap has attached devices&#8230;uh, that&#8217;d be the real one&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2007/10/08/easy-makefiles' rel='bookmark' title='Permanent Link: Easy Makefiles'>Easy Makefiles</a></li>
<li><a href='http://www.velvetcache.org/2007/11/03/recursive-word-count-with-bash' rel='bookmark' title='Permanent Link: Recursive Word Count With Bash'>Recursive Word Count With Bash</a></li>
<li><a href='http://www.velvetcache.org/2010/01/13/fh-init-script-additions-throttle-unthrottle' rel='bookmark' title='Permanent Link: F@h Init Script Additions: throttle &#038; unthrottle'>F@h Init Script Additions: throttle &#038; unthrottle</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Does this look exploited to you?</title>
		<link>http://www.velvetcache.org/2006/10/20/does-this-look-exploited-to-you</link>
		<comments>http://www.velvetcache.org/2006/10/20/does-this-look-exploited-to-you#comments</comments>
		<pubDate>Sat, 21 Oct 2006 01:09:52 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2006/10/20/does-this-look-exploited-to-you/</guid>
		<description><![CDATA[I was wandering through my log files and saw this failed http request:/fluxbuntu/xf0j/t/x1b/x16/v+/xf0j/t/x1b/x14(-/xf0 That looks like escaped hex or something to me. Except the j&#8217;s, don&#8217;t get where they fit in. Anyway, Google gave me nothing, so I suppose it&#8217;s just an oddity I&#8217;ll never know about. Related posts:Amarok REST API


Related posts:<ol><li><a href='http://www.velvetcache.org/2009/01/01/amarok-rest-api' rel='bookmark' title='Permanent Link: Amarok REST API'>Amarok REST API</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was wandering through my log files and saw this failed http request:<br/><tt>/fluxbuntu/xf0j/t/x1b/x16/v+/xf0j/t/x1b/x14(-/xf0</tt></p>
<p>That looks like escaped hex or something to me.  Except the j&#8217;s, don&#8217;t get where they fit in.  Anyway, Google gave me nothing, so I suppose it&#8217;s just an oddity I&#8217;ll never know about.</p>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2009/01/01/amarok-rest-api' rel='bookmark' title='Permanent Link: Amarok REST API'>Amarok REST API</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/10/20/does-this-look-exploited-to-you/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Case Of Shortsighted Politicians</title>
		<link>http://www.velvetcache.org/2006/09/22/another-case-of-shortsighted-politicians</link>
		<comments>http://www.velvetcache.org/2006/09/22/another-case-of-shortsighted-politicians#comments</comments>
		<pubDate>Fri, 22 Sep 2006 18:04:59 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.velvetcache.org/2006/09/22/another-case-of-shortsighted-politicians/</guid>
		<description><![CDATA[I just finished reading a quick blurb on The Register about a proposed German law that deals with hacking. The part I really find bad is &#8216;a provision in the draft laws that would make it an offense to create or distribute &#8220;hacking tools&#8221; &#8216;. Outlawing the various tools of the trade is absurd and [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I just finished reading a quick blurb on The Register about a proposed German law that deals with hacking.  The part I really find bad is &#8216;a provision in the draft laws that would make it an offense to create or distribute &#8220;hacking tools&#8221; &#8216;.  Outlawing the various tools of the trade is absurd and dangerous.</p>
<p>Illegal to posses a port scanner?  I can&#8217;t imagine the offense it would be to subscribe to a full disclosure mailing list.  What&#8217;s more is that the black hats aren&#8217;t going to let this slow them down, but law-abiding white hats just might.  That means less discovery of flaws, less disclose, and a more insecure world.  Why don&#8217;t they think these things through?</p>
<p><a href="http://www.theregister.co.uk/2006/09/22/german_hacking_law_update/" target="_blank">The Article At The Register</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/09/22/another-case-of-shortsighted-politicians/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foxmarks Insecurities</title>
		<link>http://www.velvetcache.org/2006/08/04/foxmarks-insecurities</link>
		<comments>http://www.velvetcache.org/2006/08/04/foxmarks-insecurities#comments</comments>
		<pubDate>Fri, 04 Aug 2006 18:29:00 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.velvetcache.org/2006/08/04/foxmarks-insecurities/</guid>
		<description><![CDATA[Newsflash! Foxmarks bookmark synchronizer transmits your username and password in cleartext. I had LiveHTTP Headers open while trying to figure out a post error to a server at work when foxmarks went ahead and sync&#8217;d up. I noticed the extra header info and was mildly surprised to find that it had sent my username and [...]


Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/07/facebook-apis' rel='bookmark' title='Permanent Link: Facebook API&#8217;s'>Facebook API&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script' rel='bookmark' title='Permanent Link: WLAN Router Monitor BASH Script'>WLAN Router Monitor BASH Script</a></li>
<li><a href='http://www.velvetcache.org/2006/12/04/passletcom' rel='bookmark' title='Permanent Link: Passlet.com'>Passlet.com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Newsflash! <a href="http://www.foxcloud.com/wiki/Main_Page">Foxmarks </a>bookmark synchronizer transmits your username and password in cleartext.</p>
<p>I had <a href="http://livehttpheaders.mozdev.org/">LiveHTTP Headers</a> open while trying to figure out a post error to a server at work when foxmarks went ahead and sync&#8217;d up.  I noticed the extra header info and was mildly surprised to find that it had sent my username and password in <u>cleartext</u> over an insecure connection, like so,</p>
<p>http://username:password@sync.foxcloud.com/home/username/foxmarks.xml</p>
<p>So whats this mean for us? Well, anyone sniffing your traffic (can you say &#8220;insecure wireless network&#8221;?) will get instant access to your account.  There are no real solutions but you can do a few things to limit the damage.</p>
<ul>
<li>Don&#8217;t use that password on any other site or service.</li>
<li>Don&#8217;t auto synchronize on a wireless connection, wait for a hardline if you can.</li>
<li>Don&#8217;t put sensitive links or information into foxmarks</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.velvetcache.org/2006/09/07/facebook-apis' rel='bookmark' title='Permanent Link: Facebook API&#8217;s'>Facebook API&#8217;s</a></li>
<li><a href='http://www.velvetcache.org/2006/11/16/wlan-router-monitor-bash-script' rel='bookmark' title='Permanent Link: WLAN Router Monitor BASH Script'>WLAN Router Monitor BASH Script</a></li>
<li><a href='http://www.velvetcache.org/2006/12/04/passletcom' rel='bookmark' title='Permanent Link: Passlet.com'>Passlet.com</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.velvetcache.org/2006/08/04/foxmarks-insecurities/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
