<?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>Aaron Toponce</title>
	<atom:link href="http://pthree.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://pthree.org</link>
	<description>Linux.  GNU.  Freedom.</description>
	<lastBuildDate>Sun, 06 May 2012 14:41:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta2-20489</generator>
		<item>
		<title>Zombie Proccess- What They Are and How To Handle Them</title>
		<link>http://pthree.org/2012/04/27/zombie-proccess-what-they-are-and-how-to-handle-them/</link>
		<comments>http://pthree.org/2012/04/27/zombie-proccess-what-they-are-and-how-to-handle-them/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 20:07:04 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2381</guid>
		<description><![CDATA[First off, a zombie process isn&#8217;t really a process. At least it&#8217;s not executing anymore. A zombie process is more of a &#8220;state&#8221;, and that state is &#8220;defunct&#8221;. However, we typically refer to them as &#8220;zombie processes&#8221;, so I&#8217;ll stick with convention here. Second, a zombie process on a Unix system is a child process [...]]]></description>
			<content:encoded><![CDATA[<p>First off, a zombie process isn&#8217;t really a process. At least it&#8217;s not executing anymore. A zombie process is more of a &#8220;state&#8221;, and that state is &#8220;defunct&#8221;. However, we typically refer to them as &#8220;zombie processes&#8221;, so I&#8217;ll stick with convention here. Second, a zombie process on a Unix system is a child process that has not been waited on by the parent. In a typical scenario, when a child process is finished executing its task, the chain of events will go something like this:</p>
<ol>
<li>Child process issues the signal SIGCHLD to the parent.</li>
<li>Parent receives SIGCHLD, issues the &#8220;wait()&#8221; system call.</li>
<li>Parent now receives the exit code of the child.</li>
<li>Parent reaps the child from the process table.</li>
</ol>
<p>So, when the child process has finished execution of its task, it will report the exit code to the parent. At this point, the child process will remain in the process table until it receives further instruction from the parent. This wait is the defunct, or zombie state. So, in reality, child processes are in this state all the time. It&#8217;s just that normally, the parent process acts on it immediately. When the parent does not respond, then we have the zombie state of that child process.</p>
<p>You can check if there are any zombie processes on your system with the following command:</p>
<pre>$ ps -eo pid,ppid,user,args,stat --sort stat</pre>
<p>Any state of &#8220;Z&#8221; is a zombie state. So, the question becomes, how do you clean out the zombie, if it is causing issues with your system? Well, you have 3 options:</p>
<ol>
<li>Physically wait around. Sometimes, the parent is busy, and just hasn&#8217;t acknowledged the child. When the parent is free, it could clean it up.</li>
<li>Send the &#8220;SIGCHLD&#8221; signal to the parent process. The above command will give you that output in the &#8220;PPID&#8221; column.</li>
<li>Fully kill the parent process. Any child processes will be orphaned, and picked up by INIT. INIT does frequent reaping of child processes and will reap any zombie states.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/04/27/zombie-proccess-what-they-are-and-how-to-handle-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install ZFS on Debian GNU/Linux</title>
		<link>http://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/</link>
		<comments>http://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 20:10:40 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2357</guid>
		<description><![CDATA[UPDATE (May 06, 2012): I apologize for mentioning it supports encryption. Pool version 28 is the latest source that the Free Software community has. Encryption was not added until pool version 30. So, encryption is not supported natively with the ZFS on Linux project. However, you can use LUKS containers underneath, or you can use [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (May 06, 2012)</strong>: I apologize for mentioning it supports encryption. Pool version 28 is the latest source that the Free Software community has. Encryption was not added until pool version 30. So, encryption is not supported natively with the ZFS on Linux project. However, you can use LUKS containers underneath, or you can use Ecryptfs for the entire filesystem, which would still give you all the checksum, scrubbing and data integrity benefits of ZFS. Until Oracle gets their act together, and releases the current sources of ZFS, crypto is not implemented.</p>
<p>Quick post on installing ZFS as a kernel module, not FUSE, on Debian GNU/Linux. The documents already exist for getting this going, I&#8217;m just hoping to spread this to a larger audience, in case you are unaware that it exists.</p>
<p>First, the <a href="https://www.llnl.gov/">Lawrence Livermore National Laboratory</a> has been working on porting the native Solaris ZFS source to the Linux kernel as a kernel module. So long as the project remains under contract by the Department of Defense in the United States, I&#8217;m confident there will be continuous updates. You can track the progress of that porting at <a href="http://zfsonlinux.org">http://zfsonlinux.org</a>.</p>
<p>Now, download the SPL and ZFS sources. I&#8217;m running the latest RC, which seems to be quite stable:</p>
<pre>$ mkdir ~/src/{spl,zfs}
$ cd ~/src/spl
$ wget http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc8.tar.gz
$ cd ~/src/zfs
$ wget http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc8.tar.gz</pre>
<p>At this point, you will need to install the dependencies for SPL, then go ahead and compile and make the necessary .deb files:</p>
<pre>$ sudo aptitude install build-essential gawk alien fakeroot linux-headers-$(uname -r)
$ cd ~/src/spl
$ tar -xf spl-0.6.0-rc8.tar.gz
$ cd spl-0.6.0-rc8
$ ./configure
$ make deb
$ sudo dpkg -i *.deb</pre>
<p>Now do the same for ZFS:</p>
<pre>$ sudo aptitude install zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted lsscsi
$ cd ~/src/zfs
$ tar -xf zfs-0.6.0-rc8.tar.gz
$ cd zfs-0.6.0-rc8
$ ./configure
$ make deb
$ sudo dpkg -i *.deb</pre>
<p>If you&#8217;re running Ubuntu, which I know most of you are, you can install the packages from the Launchpad PPA <a href="https://launchpad.net/~zfs-native">https://launchpad.net/~zfs-native</a>.</p>
<p><strong>A word of note:</strong> the manpages get installed to /share/man/. I found this troubling. You can modify your $MANPATH variable to include /share/man/man8/, or by creating symlinks, which is the approach I took:</p>
<pre># cd /usr/share/man/man8/
# ln -s /share/man/man8/zdb.8 zdb.8
# ln -s /share/man/man8/zfs.8 zfs.8
# ln -s /share/man/man8/zpool.8 zpool.8</pre>
<p>Now, make your zpool, and start playing:</p>
<pre>$ sudo zpool create test raidz sdd sde sdf sdg sdh sdi</pre>
<p>It is stable enough to run a ZFS root filesystem on a GNU/Linux installation for your workstation as something to play around with. It is copy-on-write, supports compression, deduplication, file atomicity, off-disk caching, <del datetime="2012-05-06T14:32:22+00:00">encryption,</del> and much more. At this point, unfortunately, I&#8217;m convinced that ZFS as a Linux kernel module will become &#8220;stable&#8221; long before Btrfs will be stable in the mainline kernel. Either way, it doesn&#8217;t matter to me. Both are Free Software, and both provide the long needed features we&#8217;ve needed with today&#8217;s storage needs. Competition is healthy, and I love having choice. Right now, that choice might just be ZFS.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Mount Raw Images</title>
		<link>http://pthree.org/2012/04/16/mount-raw-images/</link>
		<comments>http://pthree.org/2012/04/16/mount-raw-images/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 20:39:12 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2351</guid>
		<description><![CDATA[Just recently, I needed to mount a KVM raw image file, because it was depending on a network mount that was no longer accessible, and any attempts to interact with the boot process failed. So, rather than booting off a live CD, or some other medium, I decided to mount the raw image file. After [...]]]></description>
			<content:encoded><![CDATA[<p>Just recently, I needed to mount a KVM raw image file, because it was depending on a network mount that was no longer accessible, and any attempts to interact with the boot process failed. So, rather than booting off a live CD, or some other medium, I decided to mount the raw image file. After all, it is ext4.</p>
<p>However, mounting an image file means knowing where the root filesystem begins, which means knowing how to offset the mount, so you can access your data correctly. I used the following:</p>
<p>First, I setup a loop back device, so I could gather information about its partition setup:</p>
<pre># losetup /dev/loop0 virt01.img
# fdisk -l /dev/loop0

Disk /dev/loop0: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009bdb7

      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1        37943296    41940991     1998848   82  Linux swap / Solaris
/dev/loop0p2   *        2048    37943295    18970624   83  Linux

Partition table entries are not in disk order</pre>
<p>In this case, the virtual machine filesystem is 21.5 GB in size, in reads and writes in 512 byte blocks. Further, it appears as though swap occupies the second partition, while the ext4 root filesystem occupies the first, and begins at sector 2048, or byte 2048*512=1048576.</p>
<p>So, now I just need to tear down the loop back device, and create it again with an offset of 1048576 bytes, at which point, I should be able to mount the device:</p>
<pre># losetup -d /dev/loop0
# losetup /dev/loop0 virt01.img -o 1048576
# mount /dev/loop0 /mnt
# ls /mnt
bin/   home/            lib32/       mnt/   run/      sys/  vmlinuz@
boot/  initrd.img@      lib64/       opt/   sbin/     tmp/  vmlinuz.old@
dev/   initrd.img.old@  lost+found/  proc/  selinux/  usr/
etc/   lib/             media/       root/  srv/      var/</pre>
<p>At this point, I can edit my problematic /mnt/etc/fstab file to fix the troubled boot, and boot it up.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/04/16/mount-raw-images/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tighten the Security of &#8220;Security Questions&#8221;</title>
		<link>http://pthree.org/2012/03/05/tighten-the-security-of-security-questions/</link>
		<comments>http://pthree.org/2012/03/05/tighten-the-security-of-security-questions/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 22:48:40 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2338</guid>
		<description><![CDATA[Some of you may remember the email hack of Sarah Palin&#8217;s email by David Kernell in 2008. The Wikipedia article describes how this was done: The hacker, David Kernell, had obtained access to Palin&#8217;s account by looking up biographical details such as her high school and birthdate and using Yahoo!&#8217;s account recovery for forgotten passwords. [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may remember the email hack of Sarah Palin&#8217;s email by David Kernell in 2008. <a href="http://en.wikipedia.org/wiki/Sarah_Palin_email_hack">The Wikipedia article</a> describes how this was done:</p>
<blockquote><p>The hacker, David Kernell, had obtained access to Palin&#8217;s account by looking up biographical details such as her high school and birthdate and using Yahoo!&#8217;s account recovery for forgotten passwords.</p></blockquote>
<p>Ever since then, I decided to change how I answer these &#8220;security questions&#8221; on websites. Knowing what I know about security and cryptography, I applied what I knew to these security questions. Here&#8217;s how I handle them now:</p>
<ol>
<li>Generate a random string of characters, known as a &#8220;salt&#8221;. Something like &#8220;Ga0Au1Ieshea&#8221;.</li>
<li>Answer the question. If the question is &#8220;What is your mother&#8217;s maiden name?&#8221;, suppose the answer is &#8220;Smith&#8221;.</li>
<li>Apply MD5(salt+answer). In this case, it would be MD5(Ga0Au1IesheaSmith) which results in &#8220;28e03f4c2d90b8c1120bf541927976f1&#8243;.</li>
</ol>
<p>So, when the site is asking you &#8220;What is your mother&#8217;s maiden name?&#8221;, the answer you would provide is &#8220;28e03f4c2d90b8c1120bf541927976f1&#8243;.</p>
<p>Obviously, there are a couple concerns that you should be aware of. First, the form field might have a character limit. Adjust accordingly. You could provide the first x-characters, based on the restriction. Personally, I&#8217;ve never seen this restriction, but I certainly won&#8217;t say that it hasn&#8217;t been implemented. Second, it&#8217;s critical that you generate a strong random salt, and that you keep the salt private. If the salt is known, or weak, then this whole thing falls apart, and you&#8217;re no better off than just providing the answer to the question.</p>
<p>But, if you do everything correct, then you have tightened down these lame &#8220;security questions&#8221;, and the attacker will not be any more successful than hacking your account password. And, by using a cryptographically secure hashing algorithm, the output will always be the same. Feel free to use SHA1 or some other hashing algorithm instead of MD5.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/03/05/tighten-the-security-of-security-questions/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Hello ZNC</title>
		<link>http://pthree.org/2012/03/03/hello-znc/</link>
		<comments>http://pthree.org/2012/03/03/hello-znc/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 14:45:36 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[irssi]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2336</guid>
		<description><![CDATA[After nearly 6 years of running Irssi behind GNU Screen and Tmux, I&#8217;ve ditched it in favor of ZNC. Don&#8217;t panic, I&#8217;m still running Irssi locally, but this does allow be to try out different IRC clients, without being disruptive to the channels I&#8217;m in (including giving yet another assessment to WeeChat), and it will [...]]]></description>
			<content:encoded><![CDATA[<p>After nearly 6 years of running Irssi behind GNU Screen and Tmux, I&#8217;ve ditched it in favor of ZNC. Don&#8217;t panic, I&#8217;m still running Irssi locally, but this does allow be to try out different IRC clients, without being disruptive to the channels I&#8217;m in (including giving yet another assessment to WeeChat), and it will actually deliver the back buffer, unlike the irssi-proxy module.</p>
<p>Setting it up was rather painless. I installed it using my operating system vendor&#8217;s packaging system, ran ZNC, and it asked my some questions out the gate. I accepted only defaults during this first run, but made sure that I loaded the web admin module, and bound to a port via SSL. After the installer finished, I logged into the web interface (securely), and began configuring ZNC the way I would like it.</p>
<p>The web interface is easy to use. It is loaded with plenty of options and features, and the layout is clean and intuitive. One thing that I learned quickly was how users are setup. Unlike Irssi, where you setup network definitions for the network you want to connect to, then assign nicknames based on those networks, with ZNC, a username IS a network. So, because I connect to multiple IRC servers, I need a username (and password) for each. So, setup a username, tell it the server you will be connecting to, set other options, such as buffer backlog, and save. Do this for each server you wish to connect to. Lastly, poke a hole in your firewall for your clients to connect through, and you&#8217;re set.</p>
<p>So far, I&#8217;ve been very pleased with ZNC. It&#8217;s a solid IRC bouncer. And it&#8217;s great to not need to setup an SSH tunnel to bind to Irssiproxy, so I can load local clients securely (this was a pain to setup on Android (which BTW, <a href="http://www.yaaic.org/">Yaaic</a> is a SOLID Android client)). Suspect more posts about ZNC on this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/03/03/hello-znc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Encrypt Your Irssi Config</title>
		<link>http://pthree.org/2012/02/28/encrypt-your-irssi-config/</link>
		<comments>http://pthree.org/2012/02/28/encrypt-your-irssi-config/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 14:28:55 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[irssi]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2327</guid>
		<description><![CDATA[Actually, this can work for any config that you want to encrypt. Because I&#8217;m such an IRC addict (admittidly), and use Irssi as my client of choice, AND the fact that others have asked me about it after blogging about encrypting your IMAP/SMTP passwords with Mutt, I figured this was an appropriate title. The Problem [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, this can work for any config that you want to encrypt. Because I&#8217;m such an IRC addict (admittidly), and use Irssi as my client of choice, AND the fact that others have asked me about it after blogging about <a href="http://pthree.org/2012/01/07/encrypted-mutt-imap-smtp-passwords/">encrypting your IMAP/SMTP passwords with Mutt</a>, I figured this was an appropriate title.</p>
<p><strong>The Problem</strong><br />
You are running Irssi on a shared shell provider. Many people also have logins to the provider. You worry that the administrators of the service could see your usernames and passwords in your software configs.</p>
<p><strong>The Solution</strong><br />
In all reality, just don&#8217;t put your login credentials in the configuration file, if the utility does not support encrypting them. Plain and simple. It sucks typing in your credentials every time you run the software, but it <i>is</i> the best solution. However, if you want the convenience of having your credentials automatically provided, yet you want them securely stored, then this may be the next best solution.</p>
<p>First, have the site administrator install the <a href="https://launchpad.net/ecryptfs">eCryptfs</a> utilities:</p>
<pre>% sudo aptitude install ecryptfs-utils</pre>
<p>Now, create a private encrypted mount, mount it, move your Irssi config (or whatever) into the private directory, create a symlink, start the application, then unmount the encrypted mount:</p>
<pre>% ecryptfs-setup-private
% ecryptfs-mount-private
% mkdir ~/Private/configs
% mv ~/.irssi/config ~/Private/configs/irssi-config
% ln -s ~/Private/config/irssi-config ~/.irssi/config
% irssi
% ecryptfs-umount-private</pre>
<p>There are a few drawbacks to this setup, that you should be aware of. First, you won&#8217;t be able to &#8220;/reload&#8221; or &#8220;/save&#8221; unless you remount the encrypted ~/.Private filesystem. Second, anything else that Irssi is doing, will not be encrypted on disk, such as autologging channels and queries. You could put those in the encrypted filesystem as well, but then you would not be able to unmount it. It would need to remain mounted, which means the site administrators would still be able to see the login credentials. Third, the encrypted filesystem in ~/.Private/ could be removed or corrupted by the site administrators (at which point, I would stop using the service). Regardless, you would be without an Irssi config entirely. Best to keep a backup.</p>
<p>Until Irssi provides a way to allow encrypting the server or NickServ passwords with GnuPG, OpenSSL, or some other utility, this seems to be the best way to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/28/encrypt-your-irssi-config/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Setup Network Interfaces in Debian</title>
		<link>http://pthree.org/2012/02/26/setup-network-interfaces-in-debian/</link>
		<comments>http://pthree.org/2012/02/26/setup-network-interfaces-in-debian/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 02:57:23 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2321</guid>
		<description><![CDATA[If you&#8217;re not using NetworkManager or Wicd, or some other similar tool to automatically manage your network interfaces for you, this post is for you. In the Debian world, you have a single file that manages your network interfaces. It can manage VLANs, bonded interfaces, virtual interfaces and more. You can establish rules on what [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re not using NetworkManager or Wicd, or some other similar tool to automatically manage your network interfaces for you, this post is for you. In the Debian world, you have a single file that manages your network interfaces. It can manage VLANs, bonded interfaces, virtual interfaces and more. You can establish rules on what the interface should do before brought online, what it can do while online, and what it can do after online. These same rules could be applied for taking the interface down as well. Let&#8217;s look at some of these.</p>
<p>First, let&#8217;s look at the basic setup for getting an interface online with DHCP. The file we&#8217;ll be looking at this entire time is the /etc/network/interfaces file:</p>
<pre>auto eth0
allow-hotplug eth0
iface eth0 inet dhcp</pre>
<p>The first line tells the kernel to bring the &#8220;eth0&#8243; interface up when the system boots. The second line tells the kernel to start the interface if a &#8220;hotplug&#8221; event is triggered. The third line defines the configuration of the &#8220;eth0&#8243; interface. In this case, it should use IPv4, and should request an IP address from a DHCP server. A static configuration could look like this:</p>
<pre>auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 10.19.84.2
    network 10.19.84.0
    gateway 10.19.84.1
    netmask 255.255.255.0</pre>
<p>The first two lines remain the same. In the third line, we have decided to use static addressing, rather than dynamic. Then, we followed through by configuring the interface. It&#8217;s important to note that the indentation is not required. I only indented it for my benefit.</p>
<p>What about bonding? Simple enough. Suppose you have 2 NICs, one on the motherboard, and other in a PCI slot, and you want to ensure high availability, should the PCI card die. Then you could do something like this:</p>
<pre>auto eth0
iface eth0 inet manual
    post-up ifconfig $IFACE up
    pre-down ifconfig $IFACE down

auto eth1
iface eth1 inet manual
    post-up ifconfig $IFACE up
    pre-down ifconfig $IFACE down

auto bond0
iface bond0 inet static
    bond-slaves eth0 eth1
    # LACP configuration
    bond_mode 802.3ad
    bond_miimon 100
    bond_lcap_rate faste
    bond_xmit_hash_policy layer2+3
    address 10.19.84.2
    network 10.19.84.0
    gateway 10.19.84.1
    netmask 255.255.255.0</pre>
<p>Technically, I don&#8217;t need to tell the kernel to bring up interfaces eth0 and eth1, if I tell the kernel to bring up bond0, and slave the eth0 and eth1 interfaces. But, this configuration illustrates some points. First, there are the pre-up, up, post-up, pre-down, down, and post-down commands that you can use in your network interfaces(5) file. Each does something to the interface at different times during the configuration. Also notice I&#8217;m using the $IFACE variable. There are others that exist, that allow you to create scripts for your interfaces. See <a href="http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_scripting_with_the_ifupdown_system">http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_scripting_with_the_ifupdown_system</a> for more information.</p>
<p>On the bonded interface, I&#8217;m putting in two slaves, then setting some bonding configuration that I want, such as using 802.3ad mode. Of course, the interface is static, so I provided the necessary information.</p>
<p>What if we wanted to add our bonded interface to a VLAN? Simple. Just append a dot &#8220;.&#8221; and the VLAN number you want the interface in. Like so:</p>
<pre>auto bond0
iface bond0 inet manual
    bond-slaves eth0 eth1
    # LACP configuration
    bond_mode 802.3ad
    bond_miimon 100
    bond_lcap_rate faste
    bond_xmit_hash_policy layer2+3

auto bond0.42
iface bond0.42 inet static
    address 10.19.84.2
    network 10.19.84.0
    gateway 10.19.84.1
    netmask 255.255.255.0
    # necessary due to a bonding bug in vlan tools
    vlan-raw-device bond0</pre>
<p>Bring the interface up, the verify that the kernel has assigned it to the right VLAN:</p>
<pre>$ sudo cat /proc/net/vlan/config
VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
bond0.42        | 42  | bond0</pre>
<p>Notice that I specified &#8220;vlan-raw-device bond0&#8243;. This is due to a bonding bug in the VLAN tools, where merely specifying which VLAN the interface should be in by its name is not enough. You must also tell the kernel the bonded interface that the VLAN interface should be in.</p>
<p>How about bridged devices:</p>
<pre>auto bond0
iface bond0 inet manual
    bond-slaves eth0 eth1
    # LACP configuration
    bond_mode 802.3ad
    bond_miimon 100
    bond_lcap_rate faste
    bond_xmit_hash_policy layer2+3

auto bond0.42
iface bond0.42 inet manual
    post-up ifconfig $IFACE up
    pre-down ifconfig $IFACE down
    # necessary due to a bonding bug in vlan tools
    vlan-raw-device bond0

auto br42
iface br42 inet static
    bridge_ports bond0.42
    address 10.19.84.1
    netmask 255.255.255.0
    network 10.19.84.0
    gateway 10.19.84.1</pre>
<p>The only new thing here is the &#8220;bridge_ports&#8221; command. In this case, our bridged device is bridging our bond0.42 interface, which is in VLAN 42. Imagine having a KVM or Xen hypervisor that has a guest that needs to be in several VLANs. How would you setup all those bridges? Simple. Just create a VLAN interface for each VLAN, then create a bridge for each bonded interface in that VLAN.</p>
<p>Lastly, what about virtual IPs? I&#8217;ve heard that you can assign multiple IP addresses to a single NIC. How do you set that up? Simple. Just add a colon &#8220;:&#8221; the append a unique number. For example, say I have only one NIC, but wish to have 2 IP addresses, each in different networks:</p>
<pre>auto eth0
iface eth0 inet static
    address 10.19.84.2
    netmask 255.255.255.0
    network 10.19.84.0
    gateway 10.19.84.1

auto eth0:1
iface eth0:1 inet static
    address 10.13.37.2
    netmask 255.255.255.0
    network 10.13.37.0</pre>
<p>It&#8217;s important to note that you generally only need one default gateway to get out. Your kernel will route packets accordingly. If you must specify multiple gateways, then you must manually make edits to the kernel&#8217;s routing table, if everything isn&#8217;t setup correctly.</p>
<p>Of course, we could combine everything we learned here. See if you can make out what each interface is doing:</p>
<pre>auto eth0
iface eth0 inet manual
    pre-up ifconfig $IFACE up
    post-down ifconfig $IFACE down

auto eth1
iface eth1 inet manual
    pre-up ifcanfig $IFACE up
    post-down ifconfig $IFACe down

auto bond0
iface bond0 inet manual
    bond-slaves eth0 eth1 eth2 eth3
    # LACP configuration
    bond_mode 802.3ad
    bond_miimon 100
    bond_lacp_rate faste
    bond_xmit_hash_policy layer2+3

auto bond0.42
iface bond0.42 inet static
    address 10.19.84.2
    netmask 255.255.255.0
    netwark 10.19.84.0
    gateway 10.19.84.1
    # necessary due to a bonding up in vlan tools
    vlan-raw-device bond0

auto bond0.42:1
iface bond0.42:1 inet manual
    pre-up ifconfig $IFACE up
    post-down ifconfig $IFACE down
    # necessary due to a bonding bug in vlan tools
    vlan-raw-device bond0

auto br42
iface br42 inet static
    bridge_ports bond0.42:1
    address 10.13.37.2
    netmask 255.255.255.0
    network 10.13.37.0</pre>
<p>Lastly, MTU. There is a lot of misinformation out there about frame size. In my professional experience, setting the MTU to 9000 bytes does not result in improved performance. Not noticeably at least. But it does have an effect on the CPU. Setting a larger frame size can result in much lower CPU usage, both on the switch, and in your box. However, some protocols, such as UDP, might break with a 9k MTU. So, use appropriately. At any event, here is how I generally set my MTU when dealing with multiple interfaces:</p>
<pre>auto eth0
iface eth0 inet manual
    pre-up ifconfig $IFACE up
    post-down ifconfig $IFACE down
    mtu 9000

auto eth1
iface eth1 inet manual
    pre-up ifcanfig $IFACE up
    post-down ifconfig $IFACe down
    mtu 9000

auto bond0
iface bond0 inet manual
    bond-slaves eth0 eth1
    # LACP configuration
    bond_mode 802.3ad
    bond_miimon 100
    bond_lacp_rate faste
    bond_xmit_hash_policy layer2+3
    mtu 9000

auto bond0.42
iface bond0.42 inet static
    address 10.19.84.2
    netmask 255.255.255.0
    network 10.19.84.0
    gateway 10.19.84.1
    mtu 9000
    # necessary due to a bug in vlan tools
    vlan-raw-device bond0

auto bond0.43
iface bond0.43 inet static
    address 10.13.37.2
    netmask 255.255.255.0
    network 10.13.37.0
    mtu 1500
    # necessary due to a bug in vlan tools
    vlan-raw-device bond0</pre>
<p>Note that I set the MTU to 9000 on all interfaces except for bond0.43, which is 1500. This is perfectly acceptable. In all reality, setting the MTU to 1500 on bond0.43 is just capping what bond0 can really do. But, it is important to set the MTU on each interface, otherwise the frame size of 1500 bytes will get set, and you&#8217;ll end up chopping up your packets anyway. You must also set the MTU to 9000 on the switch ports as well, and any other server and interfaces that you want jumbo frames on.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/26/setup-network-interfaces-in-debian/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Randomize First, Then Encrypt Your Block Device</title>
		<link>http://pthree.org/2012/02/20/randomize-first-the-encrypt-your-block-device/</link>
		<comments>http://pthree.org/2012/02/20/randomize-first-the-encrypt-your-block-device/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 22:44:44 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2273</guid>
		<description><![CDATA[This blog post is in continuation of the previous post, where I showed why you should not use ECB when encrypting your data. Well, when putting down an encrypted filesystem, such as LUKS, you&#8217;ve probably been told that you should put random data down on the partition first BEFORE encrypting the disk. Well, this post [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post is in continuation of <a href="http://pthree.org/2012/02/17/ecb-vs-cbc-encryption/">the previous post</a>, where I showed why you should not use ECB when encrypting your data. Well, when putting down an encrypted filesystem, such as LUKS, you&#8217;ve probably been told that you should put random data down on the partition first BEFORE encrypting the disk. Well, this post will illustrate why, and it&#8217;s simple enough to do on your own GNU/Linux system.</p>
<p>I&#8217;ll be using bitmaps in this example, as I did in the previous, except I&#8217;ll use a different image. First, let&#8217;s create a &#8220;random filesystem&#8221;. Encrypted data should appear as nothing more than random data to the casual eye. This will be our target image for this exercise.</p>
<pre>$ dd if=/dev/urandom of=target.bmp bs=1 count=480054
$ dd if=glider.bmp of=target.bmp bs=1 count=54 conv=notrunc</pre>
<p>Here is what my target &#8220;encrypted filesystem&#8221; should look like (converting to GIF format for this post). Click to zoom:</p>
<p><center></p>
<table>
<tr>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/glider.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/glider.bmp-150x150.gif" /></a></td>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/target.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/target.bmp-150x150.gif" /></a></td>
</tr>
<tr>
<td align="center">Plaintext image</td>
<td align="center">Target filesystem</td>
</tr>
</table>
<p></center></p>
<p>Now let&#8217;s create a file full of binary zeros. This file will be the basis for our block device, and imitates an unused hard drive quite well. I have chosen ext2 over other filesystems, mostly because the size restriction with these files. Feel free to increase the file sizes, and use ext3, ext4, XFS, JFS, or whatever you want.</p>
<p>The file &#8220;400&#215;400.bmp&#8221; is a white bitmap that is 400&#215;400 pixels in size, rather than the 200&#215;200 pixel &#8220;glider.bmp&#8221;. This is to accommodate for the larger filesystems used in this post, and make the illustrations more clear. For your convenience, download the <a href="http://pthree.org/wp-content/uploads/2012/02/400x400.bmp">400&#215;400.bmp</a> and <a href="http://pthree.org/wp-content/uploads/2012/02/glider.bmp">glider.bmp</a> for this exercise.</p>
<p>In these commands, &#8220;$&#8221; means running the command as an unprivileged user, &#8220;#&#8221; means running as root.</p>
<pre>$ dd if=/dev/zero of=plain-zero-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 plain-zero-ext2.bmp
# mkfs.ext2 /dev/loop0
# mount /dev/loop0 /mnt
# cp glider.bmp /mnt
# umount /mnt
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=plain-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>This should give us a reference image to see what a &#8220;plaintext&#8221; filesystem would look like with our file copied to it. Now, let&#8217;s setup two encrypted filesystems, one using ECB and the other using CBC, and we&#8217;ll compare the three files together:</p>
<p>First the ECB filesystem:</p>
<pre>$ dd if=/dev/zero of=ecb-zero-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 ecb-zero-ext2.bmp
# cryptsetup -c aes-ecb create ecb-disk /dev/loop0
# mkfs.ext2 /dev/mapper/ecb-disk
# mount /dev/mapper/ecb-disk /mnt
# cp glider.bmp /mnt
# umount /mnt
# dmsetup remove ecb-disk
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=cbc-zero-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>Now the CBC filesystem:</p>
<pre>$ dd if=/dev/zero of=cbc-zero-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 cbc-zero-ext2.bmp
# cryptsetup create cbc-disk /dev/loop0
# mkfs.ext2 /dev/mapper/cbc-disk
# mount /dev/mapper/cbc-disk /mnt
# cp glider.bmp /mnt
# umount /mnt
# dmsetup remove cbc-disk
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=ecb-zero-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>What do we have? Here are the results of my filesystems. Click to zoom:</p>
<p><center></p>
<table>
<tr>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/plain-zero-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/plain-zero-ext2.bmp-150x150.gif" /></a></td>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/ecb-zero-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/ecb-zero-ext2.bmp-150x150.gif" /></a></td>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/cbc-zero-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/cbc-zero-ext2.bmp-150x150.gif" /></a></td>
</tr>
<tr>
<td align="center">Plaintext filesystem</td>
<td align="center">ECB filesystem</td>
<td align="center">CBC filesystem</td>
</tr>
</table>
<p></center></p>
<p>How do they compare to our target filesystem? Well, not close really. Even when using CBC mode with AES, we can clearly see where the encrypted data resides, and where it doesn&#8217;t. Now, rather than filling our disk with zeros, let&#8217;s fill it with random data, and go through the same procedure as before:</p>
<p>First the &#8220;plaintext&#8221; filesystem:</p>
<pre>$ dd if=/dev/urandom of=plain-urandom-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 plain-urandom-ext2.bmp
# mkfs.ext2 /dev/loop0
# mount /dev/loop0 /mnt
# cp glider.bmp /mnt
# umount /mnt
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=plain-urandom-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>Now the ECB filesystem:</p>
<pre>$ dd if=/dev/urandom of=ecb-urandom-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 ecb-urandom-ext2.bmp
# cryptsetup -c aes-ecb create ecb-disk /dev/loop0
# mkfs.ext2 /dev/mapper/ecb-disk
# mount /dev/mapper/ecb-disk /mnt
# cp glider.bmp /mnt
# umount /mnt
# dmsetup remove ecb-disk
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=cbc-urandom-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>Finally, the CBC filesystem:</p>
<pre>$ dd if=/dev/urandom of=cbc-urandom-ext2.bmp bs=1 count=480054
# losetup /dev/loop0 cbc-urandom-ext2.bmp
# cryptsetup create cbc-disk /dev/loop0
# mkfs.ext2 /dev/mapper/cbc-disk
# mount /dev/mapper/cbc-disk /mnt
# cp glider.bmp /mnt
# umount /mnt
# dmsetup remove cbc-disk
# losetup -d /dev/loop0
$ dd if=400x400.bmp of=ecb-urandom-ext2.bmp bs=1 count=54 conv=notrunc</pre>
<p>Check our results. Click to zoom:</p>
<p><center></p>
<table>
<tr>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/plain-urandom-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/plain-urandom-ext2.bmp-150x150.gif" /></a></td>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/ecb-urandom-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/ecb-urandom-ext2.bmp-150x150.gif" /></a></td>
<td><a href="http://pthree.org/wp-content/uploads/2012/02/cbc-urandom-ext2.bmp.gif"><img src="http://pthree.org/wp-content/uploads/2012/02/cbc-urandom-ext2.bmp-150x150.gif" /></a></td>
</tr>
<tr>
<td align="center">Plaintext filesystem</td>
<td align="center">ECB filesystem</td>
<td align="center">CBC filesystem</td>
</tr>
</table>
<p></center></p>
<p>Much better! By filling the underlying disk with (pseudo)random data first, then encrypting the filesystem with AES using CBC, we have a hard time telling the difference between it and our target filesystem, which was our main goal.</p>
<p>So, please, for the love of security, before putting down an encrypted filesystem on your disk, make sure you fill it with random data FIRST! The Debian installer, and many others, does this by default. Let it run to completion, even if it takes a few hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/20/randomize-first-the-encrypt-your-block-device/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>ECB vs CBC Encryption</title>
		<link>http://pthree.org/2012/02/17/ecb-vs-cbc-encryption/</link>
		<comments>http://pthree.org/2012/02/17/ecb-vs-cbc-encryption/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 14:11:55 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2264</guid>
		<description><![CDATA[This is something you can do on your computer fairly easily, provided you have OpenSSL installed, which I would be willing to bet you do. Take a bitmap image (any image will work fine, I&#8217;m just going to use bitmap headers in this example), such as the Ubuntu logo, and encrypt it with AES in [...]]]></description>
			<content:encoded><![CDATA[<p>This is something you can do on your computer fairly easily, provided you have OpenSSL installed, which I would be willing to bet you do. Take a bitmap image (any image will work fine, I&#8217;m just going to use bitmap headers in this example), such as the Ubuntu logo, and encrypt it with AES in ECB mode. Then encrypt the same image with AES in CBC mode. Apply the 54-byte bitmap header to the encrypted files, and open up in an image viewer. Here are the commands I ran:</p>
<pre>$ openssl enc -aes-256-ecb -in ubuntu.bmp -out ubuntu-ecb.bmp
$ openssl enc -aes-256-cbc -in ubuntu.bmp -out ubuntu-cbc.bmp
$ dd if=ubuntu.bmp of=ubuntu-ecb.bmp bs=1 count=54 conv=notrunc
$ dd if=ubuntu.bmp of=ubuntu-cbc.bmp bs=1 count=54 conv=notrunc</pre>
<p>Now, open all three files, ubuntu.bmp, ubuntu-ecb.bmp and ubuntu-cbc.bmpp, and see what you get. Here are my results with the password &#8220;chi0eeMieng7Ohe8ookeaxae6ieph1&#8243;:</p>
<p><center></p>
<table>
<tr>
<td><img src="http://pthree.org/wp-content/uploads/2012/02/ubuntu.bmp"/></td>
<td><img src="http://pthree.org/wp-content/uploads/2012/02/ubuntu-ecb.bmp"/></td>
<td><img src="http://pthree.org/wp-content/uploads/2012/02/ubuntu-cbc.bmp"/></td>
</tr>
<tr>
<td align="center">Plaintext</td>
<td align="center">ECB Encrypted</td>
<td align="center">CBC Encrypted</td>
</tr>
</table>
<p></center></p>
<p>Feel free to play with different passwords, and notice the colors change. Or use a different block cipher such as &#8220;bf-ecb&#8221;, &#8220;des-ecb&#8221;, or &#8220;rc2-ecb&#8221; with OpenSSL, and notice details change.</p>
<p>What&#8217;s going on here? Why can I clearly make out the image when encrypted with EBC? Well, EBC, or electronic codeblock, is a block cipher that operates on individual blocks at a time. ECB does not use an initialization vector to kickstart the encryption. So, each block is encrypted with the same algorithm. If any underlying block is the same as another, then the encrypted output is exactly the same. Thus, all &#8220;#000000&#8243; hexadecimal colors in our image, for example, will have the same encrypted output, per block (thus, why you see stripes).</p>
<p>Compare this to CBC, or cipher-block chaining. An initialization vector must be used before the encryption can begin. Because I chose AES in 256-bit mode, AES is operating on 256-bit blocks at a time. The password in our case is our initialization vector. It is hashed to provide a 256-bit output, then AES encrypts the hash, plus the first block to provide a 512-bit output, 256-bits for the next vector, and 256-bits encrypted output. That vector is then used to encrypt the next 256-bits. This chaining algorithm continues to the end of the file. This ensures that every &#8220;#000000&#8243; hexadecimal color will have a different output, thus causing the file to appear as random (I have an attacking algorithm to still leak information out of a CBC-encrypted file, but that will be for another post).</p>
<p>Hopefully, this simple illustration convinces you to use CBC, or at least to not use ECB, when encrypting data that might be public.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/17/ecb-vs-cbc-encryption/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Why I Cryptographically Sign My Email</title>
		<link>http://pthree.org/2012/02/14/why-i-cryptographically-sign-my-email/</link>
		<comments>http://pthree.org/2012/02/14/why-i-cryptographically-sign-my-email/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 12:03:02 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2219</guid>
		<description><![CDATA[Yesterday, I received a disturbing phone call. Someone very close to me, call him John, might lose his job, because a slanderous, offensive email was sent with forged headers, claiming to be John. John certainly did not send the mail, and those close to John know that the tone of the mail does not seem [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I received a disturbing phone call. Someone very close to me, call him John, might lose his job, because a slanderous, offensive email was sent with forged headers, claiming to be John. John certainly did not send the mail, and those close to John know that the tone of the mail does not seem like something John would send. The email made its way to John&#8217;s boss, human resources, IT, and other departments. The director of IT said that whoever sent the email, will get fired. Hopefully, they understand the principle of innocent until proven guilty, and all that John has to do, is cast reasonable doubt that he sent the mail. Examining the mail headers should deliver that doubt. I&#8217;ve told John that I would be willing to examine the headers, along with his IT department, to help in any way I can. Hopefully, this ends well.</p>
<p>I&#8217;ve never known anyone personally that this has happened to, until now. But, I&#8217;ve been cryptographically signing my email since 2004. Every single one. I have almost 10,000 emails in my Sent folder, all of which are signed. Further, I think I&#8217;ve been very clear to my friends and family, that it is their responsibility to verify the signature. Should they receive an email claiming to come from me, they should doubt the authenticity of the mail if it is not signed.</p>
<p>Of course, this does not prove anything about future email. I may wish to stop signing my mail at anytime. But, all I need to do is cast reasonable doubt that I sent the mail. A back history of over 7 years and 10,000 cryptographically signed emails should cast enough reasonable doubt as to the message is question, should I be placed in that situation. Along with anyone being able to forge email headers, it&#8217;s all over. Unless you can clearly, logically, and rationally prove that I sent the mail, there is enough doubt surrounding it, that I remain innocent.</p>
<p>I know others don&#8217;t see email the same way I do, and treat their email experience differently, such as John. And in all reality, if setting up OpenPGP or S/MIME wasn&#8217;t such a major PITA, it might be more widely used. But for the time being, all I can do is continue to lead by example. For me, the 15 minutes it took for initial setup, and having to provide a passphrase every time I wish to send an email, is peanuts compared to threats, such as this. Of course, if the organization John worked for required S/MIME on their email (I&#8217;ve worked for one such organization that made this requirement), then it would be clear that the mail was a fake.</p>
<p><strong>UPDATE:</strong> Turns out that this organization has a utility to send messages to anyone in the organization. It&#8217;s not email, but some custom, proprietary application. Further, it requires no authentication. Anyone can send messages to anyone pretending to be whoever they wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/14/why-i-cryptographically-sign-my-email/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>DISCLAIMER</title>
		<link>http://pthree.org/2012/02/05/disclaimer/</link>
		<comments>http://pthree.org/2012/02/05/disclaimer/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 14:33:06 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2199</guid>
		<description><![CDATA[DISCLAIMER: By sending me email, you agree to the following: I am, by definition, &#8220;the intended recipient&#8221;. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please. [...]]]></description>
			<content:encoded><![CDATA[<p>DISCLAIMER: By sending me email, you agree to the following:</p>
<ul>
<li>I am, by definition, &#8220;the intended recipient&#8221;.</li>
<li>All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please.</li>
<li>I may take the contents as representing the views of your company.</li>
<li>This disclaimer overrides any disclaimer or statement of confidentiality that may be included on your message.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/02/05/disclaimer/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Protesting SOPA/PIPA</title>
		<link>http://pthree.org/2012/01/17/protesting-sopa-pipa/</link>
		<comments>http://pthree.org/2012/01/17/protesting-sopa-pipa/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 21:50:50 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2189</guid>
		<description><![CDATA[Starting Jan 18, 2011 at 00:00 UTC, this blog will be joining many others to protest SOPA and PIPA. I strongly oppose the views outlined in the bill, and with a Google Pagerank of 4/10, with almost 650 RSS readers, and about 1,500 hits to my site per day, I&#8217;ll be taking advantage of these [...]]]></description>
			<content:encoded><![CDATA[<p>Starting Jan 18, 2011 at 00:00 UTC, this blog will be joining many others to protest SOPA and PIPA. I strongly oppose the views outlined in the bill, and with a Google Pagerank of 4/10, with almost 650 RSS readers, and about 1,500 hits to my site per day, I&#8217;ll be taking advantage of these numbers, and showing my disgust for SOPA/PIPA. Join me, and many others, by joining the strike at <a href="http://americancensorship.org">http://americancensorship.org</a>. Now, a note to my (current and future) political representatives in Utah.</p>
<p>Dear Jim Matheson, Rob Bishop, Jason Chaffetz, Orrin Hatch and Mike Lee:</p>
<p>If you vote in favor of supporting SOPA and PIPA passing, not only will you not get a vote from me, I&#8217;ll launch an online campaign to make sure I take as many people with me this November in doing the same (I&#8217;ll tell you right now Mr. Hatch, that <a href="http://peteashdown.org">Pete Ashdown</a> already has my vote, but its not too late to withold the campaign). The ball is in your court.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/01/17/protesting-sopa-pipa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypted Mutt IMAP/SMTP Passwords</title>
		<link>http://pthree.org/2012/01/07/encrypted-mutt-imap-smtp-passwords/</link>
		<comments>http://pthree.org/2012/01/07/encrypted-mutt-imap-smtp-passwords/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 15:16:56 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2183</guid>
		<description><![CDATA[Rather than storing your IMAP and SMTP passwords in plain text on disk, you can store them encrypted using GnuPG, OpenSSL, the GNOME Keyring, or any other method of password storage encryption. It still requires a &#8220;master password&#8221; from you to decrypt the file(s) on the fly, and set the appropriate passwords, but then it [...]]]></description>
			<content:encoded><![CDATA[<p>Rather than storing your IMAP and SMTP passwords in plain text on disk, you can store them encrypted using GnuPG, OpenSSL, the GNOME Keyring, or any other method of password storage encryption. It still requires a &#8220;master password&#8221; from you to decrypt the file(s) on the fly, and set the appropriate passwords, but then it will remain in RAM in plain text for the duration Mutt is running, and no worries about the password in plain text going to disk.</p>
<p>Here&#8217;s how I set mine up using my GnuPG key. First, I created a ~/.mutt/passwords file. The file is in plain text. Before encrypting it, here are its contents:</p>
<pre>set imap_pass="password"
set smtp_pass="password"</pre>
<p>I then encrypt that file with the following command:</p>
<pre>% gpg -r your.email@example.com -e ~/.mutt/passwords
% ls ~/.mutt/passwords*
/home/user/.mutt/passwords /home/user/.mutt/passwords.gpg
% shred ~/.mutt/passwords
% rm ~/.mutt/passwords</pre>
<p>The last two commands are to ensure that the temporary file you created for encryption is securely wiped from the disk using the GNU Shred utility. Now, you should only have an encrypted binary data file that contains your passwords. All that is left is to configure Mutt to decrypt them when starting up. You can set that easily in your Muttrc:</p>
<pre>source "gpg -d ~/.mutt/passwords.gpg |"</pre>
<p>The string is just a standard string. Also, it&#8217;s important to have &#8220;|&#8221; at the end of the command, to pipe the output to Mutt, so it can be appropriately sourced.</p>
<p>At this point, you should be able to launch Mutt, be asked for the passphrase for your private GnuPG key, and it should log you in to your IMAP account. You should also be able to send mail as normal, logging automatically into your SMTP account. The only time you are asked for a password, is your GnuPG passphrase when starting Mutt. If your &#8220;gpg-agent&#8221; is already running, and you&#8217;ve configured GnuPG to use the agent and added your private key to it, then starting Mutt won&#8217;t ask you for your key passphrase, and will use the agent instead.</p>
<p>Other than temporarily creating the plain text file to encrypt, which stores your passwords, and which you promptly and securely shred later, your IMAP/SMTP passwords for your remote account are never on disk in plain text.</p>
<p>Happy encrypted hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/01/07/encrypted-mutt-imap-smtp-passwords/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My Google Voice Rant</title>
		<link>http://pthree.org/2012/01/05/my-google-voice-rant/</link>
		<comments>http://pthree.org/2012/01/05/my-google-voice-rant/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 09:01:50 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2172</guid>
		<description><![CDATA[So, I&#8217;ve been a Google Voice subscriber for about 2 years. I have one of the most awesome phone numbers you can get: 686-8086 (it has an inside geek reference to x86-based CPU architectures, and also to my PGP key ID of 0x8086060F. Awesome, eh?!). I&#8217;ve used it for SMS text messaging, receiving calls, and [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been a Google Voice subscriber for about 2 years. I have one of the most awesome phone numbers you can get: 686-8086 (it has an inside geek reference to x86-based CPU architectures, and also to my PGP key ID of 0x8086060F. Awesome, eh?!). I&#8217;ve used it for SMS text messaging, receiving calls, and placing calls (almost 4,000 total calls). I&#8217;ve used it for conference calls as well. I&#8217;ve blocked spammers, recorded calls, transferred calls, and pretty much have used it fully. After all this, I have some gripes.</p>
<ul>
<li>I get A LOT of missed calls when people call my Google Voice number.</li>
<li>I get A LOT of static on the line versus calling my cell directly (I honestly don&#8217;t understand why).</li>
<li>Managing the &#8220;other&#8221; numbers for contacts is messy.</li>
<li>Conference calls only support 4 people- you, and 3 other callers.</li>
<li>Conference calls can only be initiated when people call your Voice number (you cannot invite people to the call).</li>
<li>When using SMS on Android, the notifications are filled with the name presented twice- once for the Google Contact contact, and then again for the Voice Caller ID.</li>
<li>Unless you&#8217;re using Android (or maybe other OSes), calling from your phone will not show the Google Voice number on their caller ID, unless you call your Voice number first, then follow the phone tree to dial the number you wish to call (a PITA).</li>
<li>Some cell phone providers offer unlimited minutes when calling other cellular phones. Using Voice means calling a landline, which means using your minutes, regardless of who made the call.</li>
</ul>
<p>I like the spam options of the service. It has come in handy. And I&#8217;ve recorded a few phone calls for logging reasons. However, I&#8217;ve found that using Google Voice in totality is becoming more of a pain than a benefit. Losing calls is especially annoying, definitely when you&#8217;re waiting for a job offer (ugh). I&#8217;ll continue to hand out the number to companies and people that I don&#8217;t care much about, but I&#8217;ve been handing my cell phone number out more and more lately, because Voice is just getting in the way.</p>
<p>Anyway, just had to get this off my chest (missing a call this morning was REALLY upsetting, and sparked the post).</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2012/01/05/my-google-voice-rant/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Making Sense of Hashed Hosts in ~/.ssh/known_hosts</title>
		<link>http://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/</link>
		<comments>http://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 21:19:57 +0000</pubDate>
		<dc:creator>Aaron Toponce</dc:creator>
				<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://pthree.org/?p=2168</guid>
		<description><![CDATA[I don&#8217;t expect you to follow this post completely, but it&#8217;s so amazingly cool, I have to blog it. Consider the hashed sections of ~/.ssh/known_hosts file for (recent) OpenSSH clients, not including the public key parts: &#124;1&#124;kFJT5z0x3ndyutgZ4E5pRk+ORBA=&#124;hzXvdYUudo+qK9BGlFWtSAUXlXc= &#124;1&#124;8wo1+FO0hkATPgQZoeNHeIlvAjw=&#124;dt/a9jz9CnLKP72j+Jr8MKMjgEE= &#124;1&#124;pvBQEKEGLnH0RCJr+8Dmqqnvlrs=&#124;fJJvjyG/TmHFnuIX57nDThq/C4M= &#124;1&#124;HKV4DzgDkajXoUHf9B82JBu7J10=&#124;c/K+MdJvWaZeJFs/W7iqhqo0wvE= &#124;1&#124;rtvQhRVnNanQZYkLUMbjoBGNhn0=&#124;0U6a1LUQqLL6P1T2Wji3VWw69pw= &#124;1&#124;0ziSYi4c+xBXGEBZcNN1LMhYUc4=&#124;qRSN5GSPyQi+fmaVz2zNwkmKoy8= &#124;1&#124;6nv6Vpk3AYgICHxJGVgVdsYRuq0=&#124;fBNOIz1l3RW+N61jyDPunKX9n7E= &#124;1&#124;+b4uA+Mq7RHRAFW21qv8aO3rIRs=&#124;1eizMri01IxEKrXquBnwTYP61Ow= &#124;1&#124;BkB0PZu2qtsLID/Ibe/D68gANQU=&#124;qW6uAzcpecOOKNI4zEvngyfpGkI= &#124;1&#124;n+QrRn7QXeAJ5hRe2M8v8IspihE=&#124;EqUxXdSeIF1cl1fQjl5zILebkGY= &#124;1&#124;BOKuKnWojy028tJf9Y671lws0d0=&#124;SuBQJmJZp5JNVYG/rP9yb9ZhJcE= &#124;1&#124;WACsxtodOiM89kf4rNPLgF1CXZ4=&#124;UTccVeLDZJF3wlH8V05XJNlsOBw= &#124;1&#124;o6FFoirXYblM7wBMdeJDYGMPI58=&#124;5jJB7T7itY702ZHHByXtSpGk9SE= The column fields are similar to [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t expect you to follow this post completely, but it&#8217;s so amazingly cool, I have to blog it. Consider the hashed sections of ~/.ssh/known_hosts file for (recent) OpenSSH clients, not including the public key parts:</p>
<pre>|1|kFJT5z0x3ndyutgZ4E5pRk+ORBA=|hzXvdYUudo+qK9BGlFWtSAUXlXc=
|1|8wo1+FO0hkATPgQZoeNHeIlvAjw=|dt/a9jz9CnLKP72j+Jr8MKMjgEE=
|1|pvBQEKEGLnH0RCJr+8Dmqqnvlrs=|fJJvjyG/TmHFnuIX57nDThq/C4M=
|1|HKV4DzgDkajXoUHf9B82JBu7J10=|c/K+MdJvWaZeJFs/W7iqhqo0wvE=
|1|rtvQhRVnNanQZYkLUMbjoBGNhn0=|0U6a1LUQqLL6P1T2Wji3VWw69pw=
|1|0ziSYi4c+xBXGEBZcNN1LMhYUc4=|qRSN5GSPyQi+fmaVz2zNwkmKoy8=
|1|6nv6Vpk3AYgICHxJGVgVdsYRuq0=|fBNOIz1l3RW+N61jyDPunKX9n7E=
|1|+b4uA+Mq7RHRAFW21qv8aO3rIRs=|1eizMri01IxEKrXquBnwTYP61Ow=
|1|BkB0PZu2qtsLID/Ibe/D68gANQU=|qW6uAzcpecOOKNI4zEvngyfpGkI=
|1|n+QrRn7QXeAJ5hRe2M8v8IspihE=|EqUxXdSeIF1cl1fQjl5zILebkGY=
|1|BOKuKnWojy028tJf9Y671lws0d0=|SuBQJmJZp5JNVYG/rP9yb9ZhJcE=
|1|WACsxtodOiM89kf4rNPLgF1CXZ4=|UTccVeLDZJF3wlH8V05XJNlsOBw=
|1|o6FFoirXYblM7wBMdeJDYGMPI58=|5jJB7T7itY702ZHHByXtSpGk9SE=</pre>
<p>The column fields are similar to that of the /etc/shadow file on GNU systems, except where the &#8220;$&#8221; is the column delimiter, &#8220;|&#8221; is in this case. If the string was &#8220;|1|o6FFoirXYblM7wBMdeJDYGMPI58=|5jJB7T7itY702ZHHByXtSpGk9SE=&#8221;, then the breakdown is as follows:</p>
<ul>
<li><strong>|1</strong>- HASH_MAGIC. This tells the client that the host information has been salted and hashed with the SHA1 algorithm.</li>
<li><strong>|o6FFoirXYblM7wBMdeJDYGMPI58=</strong> This is the salt applied to the host- base 64 encoded 160-bit string.</li>
<li><strong>|5jJB7T7itY702ZHHByXtSpGk9SE=</strong> This is the base 64 encoded version of the hashed host</li>
</ul>
<p>Now, if you want to get at the actual strings, not base 64 encoded, you could run the following command (I admit, not elegant, and could probably be better solved without nesting, and a single awk(1) statement, but I&#8217;ll get to that later):</p>
<pre>% echo $(echo o6FFoirXYblM7wBMdeJDYGMPI58= | openssl base64 -d | xxd | cut -c 10-48) | sed 's/ //g'
a3a145a22ad761b94cef004c75e24360630f239f
% echo $(echo 5jJB7T7itY702ZHHByXtSpGk9SE= | openssl base64 -d | xxd | cut -c 10-48) | sed 's/ //g'
e63241ed3ee2b58ef4d991c70725ed4a91a4f521</pre>
<p>There you have it. Very cool. Now, the only question is how to apply the salt to the hostname, to get to the hash? I&#8217;m working that out, but I wasn&#8217;t motivated enough to get to it. Of course, there&#8217;s no application to this, that I can tell, unless you want to brute force the known_hosts file.</p>
]]></content:encoded>
			<wfw:commentRss>http://pthree.org/2011/12/30/making-sense-of-hashed-hosts-in-sshknown_hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

