<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="0.92" xml:base="http://www.applefritter.com">
<channel>
 <title>Applefritter - Security</title>
 <link>http://www.applefritter.com/taxonomy/term/270/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Overview of Encryption II</title>
 <link>http://www.applefritter.com/encryption_2</link>
 <description>	In last weeks article, we &lt;a href = "http://www.applefritter.com/encryption_1"&gt;discussed symmetrical key encryption&lt;/a&gt;, or encryption where the same key is used to encrypt and decrypt the content.  The obvious drawback of this is that if the key is made public then it becomes useless, as anybody can read your messages.  Because of this, a trusted courier or initial contact is required in order to set the key.  For two people wanting to communicate without ever meeting each other, this is impractical.

	So how can we generate a shared key without the two parties ever meeting?  One method of this is Diffie-Hellman-Merkle key exchange.

	Diffie-Hellman-Merkle key exchange is a method where two parties can arrive at a common numerical key without ever transmitting the key in plaintext, or in a format that can be cracked without &lt;a href = "http://en.wikipedia.org/wiki/Brute_force_attack"&gt;brute force&lt;/a&gt;.  To start with, both parties agree on two numbers.  These numbers are plaintext and are assumed to be readable by anyone.  "P" must be a prime number.  The larger the prime the better.  In our example we'll be using "83" just to make it simple.  "G" is a common base number.  This can be any integer.  In our example we'll use 4.

	Let's say Bob and Alice want to establish a shared key.  Bob's never met Alice, all he has is her address.  He can send her a letter proposing encrypted communication, and in it send the values of "G" and "P".  In our case, "4" and "83".

	Once these are established, Alice and Bob both choose any integer they want.  We'll say that Alice chooses 2 and Bob chooses 5.  These are labeled "A" and "B" respectively.

	Alice performs this equation on her side:

		G ^ A mod P or, once we substitute in values, 4^2 mod 83.

		This results in the value 16.  Alice packages this into a letter and sends "16" to Bob.

	Bob performs:

		G ^ B mod P or, 4^5 mod 83.

		His result is "28".  He writes Alice a letter with the number 28 enclosed.

	Now Bob and Alice both have a copy of the others number, but they need to find the same number.  This is achieved by Alice using the following equation:

	(G ^ B mod P) ^ A mod P

	Alice doesn't have "B", as it was never sent plaintext to her.  She does however have the answer to G ^ B mod P, which is 28.  She substitutes in the values she has and finds the equation is now:

	(28)^2 mod 83

	This results in the number "37".  This is the final key.

	Bob receives Alices envelope and must execute the equation:

	(G ^ A mod P) ^ B mod P

	Alice has given him G ^ A mod P without ever revealing A.  He substitutes in his values and gets:

	(16)^5 mod 83

	This resolves out to the value "37".  Both now have a shared key.  Any eavesdropper cannot establish the key without knowing either A or B, neither of which have been sent in the plaintext.  In this way, with sufficiently large values, we can negotiate a common key, secure except for the possibility of an eavesdropper using brute force to break their encryption.
</description>
 <pubDate>Thu, 19 Jan 2006 22:04:49 -0800</pubDate>
</item>
<item>
 <title>Overview of Encryption I</title>
 <link>http://www.applefritter.com/encryption_1</link>
 <description>&lt;b&gt;Codes&lt;/b&gt;

	Codes and ciphers are used as a way to make sure that only the intended recipient is able to comprehend the meaning of a message sent via an untrusted route.  While codes will translate a phrase into something completely unrelated, a cipher actually is a permutation of the original data.

	A code would take a phrase like this:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		We attack at dawn
	&lt;/tt&gt;

	and transform it into something like this:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		Cheese is special.
	&lt;/tt&gt;

	Because the translated message is completely unrelated to the original, it's only possible to find out what the original message was by having a code book.  The code book is a specific set of phrases that may be used and their transformed versions.  Using codes has several downsides:

    &lt;ul&gt;
	&lt;li&gt; Both sides must have a full copy of the code book
	&lt;li&gt; For each trusted sender, the recipient must keep another code book
	&lt;li&gt; Both sides must have previously communicated with each other
	&lt;li&gt; Only the information which was predicted to have to be sent can be sent.
	&lt;/ul&gt;

	The upside of using a code book is that without capturing a copy, anybody attempting to intercept the message is completely unable to decode it reliably.  In other words, as long as the book is protected, a code cannot be translated without correlating messages to events.

&lt;b&gt;Substitution Ciphers&lt;/b&gt;

	A cipher operates on the actual letters in the message to allow for any message you may want to send.  Without anticipating a message, you can't send it with code.  You can send any message with a cipher.  You are also only required to keep a copy of the ciphers key, or method of decryption, in order to read the contents.

	Simple ciphers, like substitution ciphers work like this:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		a b c d e f g h i j k l m n o p q r s t u v w x y z
		n o p q r s t u v w x y z a b c d e f g h i j k l m 	&lt;/tt&gt;

	The plaintext is lined up letter by letter with a different character.  "A" is transformed into "N", "B" is transformed into "O", and so on.

	A substitution cipher would take:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		We attack at dawn
	&lt;/tt&gt;

	and transform it into something like this:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		Jr nggnpx ng qnja.
	&lt;/tt&gt;

	The example above is done with the "ROT13" cipher, or by displacing the alphabet 13 characters.  "ROT13" is short for "ROTate 13".

	Substitution ciphers have a couple of downsides.

    &lt;ul&gt;
	&lt;li&gt; Both sides must know the key
	&lt;li&gt; For each cipher used, both sides must know the key
	&lt;li&gt; Both sides must have previously communicated with each other
	&lt;li&gt; Ciphers are breakable by trying various permutations of letters matching to characters in the message.
    &lt;/ul&gt;
    
&lt;b&gt;One Time Pads&lt;/b&gt;

	A one time pad is a cipher that cannot be broken.  It can only be used once, as the name implies.  Basically both sides have an agreed upon random key which is used to cipher the plaintext.

	In order to use a one time pad, the pad (a random key) must be of a longer length than the message to be transmitted.  The pad and the plaintext message are then combined using one of various mathematical techniques. 

	To give an example, let's say that we have our plaintext message:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		We attack at dawn
	&lt;/tt&gt;

	We also need a one time pad.  Both parties must have a copy of this key.  Perhaps they sent it by trusted courier or met personally.  Most likely they have a large number of one-time pads and just use the next one in sequence for the next message.  Let's say that particular key is:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		oxjelijqmfdsosdthsalqnsi
	&lt;/tt&gt;

	Notice how the pad is longer than the message to encrypt.  This means that there is no pattern in the encoding, provided that the key is truly random.  I got this from mashing my keyboard while reading something else, then removing the non-alphabetic characters.

	We'll use a simple method to combined the two lines.  First let's write the alphabet, and assign each letter a number.

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
	   &lt;table border = \"0\" cellpadding = "2"&gt;
	       &lt;tr&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		A 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		B 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		C 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		D 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		E 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		F 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		G 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		H 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		I 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		J 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		K 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		L 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		M 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		N 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		O 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		P 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		Q 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		R 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		S 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		T 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		U 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		V
		 &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		W 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		X 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		Y 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px;"&gt;
		Z 
		  &lt;/td&gt;

        &lt;/tr&gt;
	       &lt;tr&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		1 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		2 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		3 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		4 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		5 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		6 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		7 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		8 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		9 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		10 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		11 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		12 
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		13
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		14
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		15
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		16
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		17
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		18
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		19
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		20
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		21
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		22
		 &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		23
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		24
		  &lt;/td&gt;
	       &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;
		25
		  &lt;/td&gt;
	       &lt;td style = "width: 20px;"&gt;
		26
		  &lt;/td&gt;

        &lt;/tr&gt;
    &lt;/table&gt;
	&lt;/tt&gt;

	Now, we'll translate our plaintext message into numbers.

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
	   &lt;table border = \"0\" cellpadding = "2"&gt;
	       &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;W&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;e&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;c&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;k&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t&lt;/td&gt;   &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;d&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;w&lt;/td&gt;  &lt;td style = "width: 20px;"&gt;n&lt;/td&gt;&lt;/tr&gt;
		&lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;23&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;5&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;3&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;11&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20&lt;/td&gt;  &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;4&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1&lt;/td&gt; &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;23&lt;/td&gt; &lt;td style = "width: 20px;"&gt;14&lt;/td&gt;&lt;/tr&gt;
		&lt;/table&gt;
	&lt;/tt&gt;

	And translate our pad into numbers as well.

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
	   &lt;table border = \"0\" cellpadding = "2"&gt;
	       &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;o&lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;x&lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;j&lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;e&lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;l&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;i&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;j&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;q&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;m&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;f&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;d&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;s&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;o&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;s&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;d&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;h&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;s&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;l&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;q&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;n&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;s&lt;/td&gt;
        &lt;td style = "width: 20px;"&gt;i&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;15&lt;/td&gt; 
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;24 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;10 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;5 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;12 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;9 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;10 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;17 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;13&lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;6 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;4 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;19 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;15 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;19 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;4 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;8 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;19 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;12 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;17 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;14 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;19 &lt;/td&gt;
        &lt;td style = "width: 20px;"&gt;9&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
	&lt;/tt&gt;

	We'll combine the first number (23, standing for the letter "W") with the first number of the pad (15, standing for the letter "o").

	23 + 15 = 38

	Now, 38 doesn't line up to a number on our list, so we'll subtract 26 from it to make it.

	38 - 26 = 12

	12 lines up to the letter L in our numbered alphabet.  So the first character in our encrypted message is "L"

	Going through it like that, we end up with this line:

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
		LD KYFJMB NZ HTLG
	&lt;/tt&gt;

	Notice that because we used a random line to combine with our plaintext line, characters that are the same in the plaintext are not the same in the encoded result.  This means that using a one time pad to encode does not allow statistical analysis of the encoded text to break it.

	Now to decrypt the text we do the opposite process.  Take the encrypted text and translate it to numbers.

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
	   &lt;table border = \"0\" cellpadding = "2"&gt;
        &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;L &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;D  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;K &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;Y  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;F &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;J &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;M  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;B  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;N  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;Z   &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;H &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;T  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;L  &lt;/td&gt;
        &lt;td style = "width: 20px;"&gt;G&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;12 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;4  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;11 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;25 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;6 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;10 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;13 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;2  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;14 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;26  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;8 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;12&lt;/td&gt;
        &lt;td style = "width: 20px;"&gt;7&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
	&lt;/tt&gt;

	We take our key (which we translated to numbers earlier in this article) and this time we subtract the pad values from the encrypted text.

	The first character is "L", which equates to 12.  The first character of the pad is "O" which equates to 15.

	12 - 15 = -3

	If the result is negative, we add 26 to get it within the range of the alphabet.

	-3 + 26 = 23

	Therefore the first character is "W", which equates to "23" on our alphabet numbers list.

	When we proceed with this, we come out with the plaintext again.

	&lt;tt style = "font-size: 12pt; font-family: monospace;"&gt;
	   &lt;table border = \"0\" cellpadding = "2"&gt;
        &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;23 &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;5 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;3 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;11 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;20  &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;4 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;1 &lt;/td&gt;
        &lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;23 &lt;/td&gt;
        &lt;td style = "width: 20px;"&gt;14&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;W  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;e  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;c &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;k  &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;t   &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;d &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;a &lt;/td&gt;
		&lt;td style = "width: 20px; border-right: 1px solid #CCCCCC;"&gt;w  &lt;/td&gt;
		&lt;td style = "width: 20px;"&gt;n&lt;/td&gt;
		&lt;/tr&gt;
    &lt;/table&gt;
	&lt;/tt&gt;

	Since the pad could be any sequence of letters, by using another pad on the encrypted text, we could get any text out.  And because the pad is truly random, there is no way to statistical way to know if the message is "We attack at dawn" or "No chimps in line".

	It should be noted that when a computer generates a random number, it is generally generating a pseudo-random number, which can render a one time pad vulnerable to being broken.  One source of true randomness commonly used is radioactive decay. 

	So why aren't these used more often?  They're unbreakable as long as the pad is truly random and each pad is only used once to prevent analysis.

	For most uses of encryption, we don't require it to be unbreakable.  We only require it to take longer than the lifespan of the information to break.  If it takes a hundred years to get your credit card details then it's secure enough, because the card expires in four years.

&lt;b&gt;The Problem With Shared Keys&lt;/b&gt;

	All of the methods of encryption mentioned above have one huge problem with them.  They require a trusted contact between the two parties at some point.  This decreases the ease of use and increases the cost of use hugely.  This is unsuitable for things like email, chat, and online shopping.  Would you buy that book from Amazon.com if you had to first go to an office of theirs and establish a secret key.

	In our next article, we'll examine the ways that two parties can establish a key for secure encryption without needing a trusted initial connection.</description>
 <pubDate>Thu, 19 Jan 2006 21:17:26 -0800</pubDate>
</item>
<item>
 <title>Data Mining 101: Finding Subversives with Amazon Wishlists</title>
 <link>http://www.applefritter.com/bannedbooks</link>
 <description>		&lt;p&gt;Vast deposits of personal information sit in databases across the internet. Terms used in phone conversations have become the grounds for federal investigation. Reputable organizations like  the &lt;a href="http://www.catholicworker.org/"&gt;Catholic Worker&lt;/a&gt;, &lt;a href="http://www.greenpeace.org/"&gt;Greenpeace&lt;/a&gt;, and the &lt;a href="http://www.indystar.com/apps/pbcs.dll/article?AID=/20051229/COLUMNISTS02/512290454/1006/NEWS01"&gt;Vegan Community Project&lt;/a&gt;, have come under scrutiny by FBI &amp;quot;counterterrorism&amp;quot; agents.&lt;/p&gt;
		&lt;p&gt;&amp;quot;Data mining&amp;quot; of all that information and communication is at the heart of the furor over the recent disclosure of government snooping. &amp;quot;U.S. President George W. Bush and his aides have said his executive order allowing eavesdropping without warrants was limited to monitoring international phone and e-mail communications linked to people with connections to al-Qaeda. What has not been acknowledged, according to the Times, is that NSA technicians combed large amounts of phone and Internet traffic seeking patterns pointing to terrorism suspects.&lt;/p&gt;
		&lt;p&gt;&amp;quot;&lt;i&gt;Some officials described the program as a large data mining operation, the Times said&lt;/i&gt;, and described it as much larger than the White House has acknowledged.&amp;quot; &lt;font size="-2"&gt;(&lt;a href="http://today.reuters.com/news/newsArticleSearch.aspx?storyID=119433+24-Dec-2005+RTRS&amp;srch=nsa"&gt;Reuters&lt;/a&gt;)&lt;/font&gt;&lt;/p&gt;
		&lt;p&gt;Combining a data mining operation with the Patriot Act's power to access information makes it all too easy for  the federal government to violate the Constitution's prohibition against unreasonable search. &lt;i&gt;Ars Technica&lt;/i&gt; has an article, &lt;a href="http://arstechnica.com/news.ars/post/20051220-5808.html"&gt;The new technology at the root of the NSA wiretap scandal&lt;/a&gt;, that describes the ease with which widespread wiretapping can now be implemented.  It quotes &lt;a href="http://www.philzimmermann.com/EN/essays/WhyIWrotePGP.html"&gt;Philip Zimmermann&lt;/a&gt;, the creator of the PGP encryption software:&lt;/p&gt;
		&lt;p&gt;&amp;quot;A year after the CALEA [Communications Assistance for Law Enforcement Act] passed [in 1994], the FBI disclosed plans to require the phone companies to build into their infrastructure the capacity to simultaneously wiretap 1 percent of all phone calls in all major U.S. cities. This would represent more than a thousandfold increase over previous levels in the number of phones that could be wiretapped. In previous years, there were only about a thousand court-ordered wiretaps in the United States per year, at the federal, state, and local levels combined. It's hard to see how the government could even employ enough judges to sign enough wiretap orders to wiretap 1 percent of all our phone calls, much less hire enough federal agents to sit and listen to all that traffic in real time. The only plausible way of processing that amount of traffic is a massive Orwellian application of automated voice recognition technology to sift through it all, searching for interesting keywords or searching for a particular speaker's voice. If the government doesn't find the target in the first 1 percent sample, the wiretaps can be shifted over to a different 1 percent until the target is found, or until everyone's phone line has been checked for subversive traffic. The FBI said they need this capacity to plan for the future. This plan sparked such outrage that it was defeated in Congress. But the mere fact that the FBI even asked for these broad powers is revealing of their agenda.&amp;quot;&lt;/p&gt;
		&lt;p&gt;It used to be you had to get a warrant to monitor a person or a group of people. Today, it is increasingly easy to monitor ideas. And then track them back to people. Most of us don't have access to the databases, software, or computing power of the NSA, FBI, and other government agencies. But an individual with access to the internet can still develop a fairly sophisticated profile of hundreds of thousands of U.S. citizens using free and publicly available resources. Here's an example.&lt;/p&gt;
		&lt;p&gt;There are many websites and databases that could be used for this project, but few things tell you as much about a person as the books he chooses to read. Isn't that why the &lt;a href="http://en.wikipedia.org/wiki/Doublespeak"&gt;Patriot Act&lt;/a&gt; specifically requires libraries to release information on who's reading what? For this reason, I chose to focus on the information contained in the popular Amazon wishlists.&lt;/p&gt;
		&lt;p&gt;Amazon wishlists lets anyone bookmark books for later purchase. By default these lists are public and available to anybody who searches by name. If the wishlist creator specifies a shipping address, someone else can even purchase the book on Amazon and have it shipped directly as a gift. The wishlist creator's city and state are made public on the wishlist, but the street address remains private. Amazon's popularity has created a vast database of wishlists. No index of all wishlists is available, but it remains possible to view all wishlists by people of a particular first name. A recent search for people named Mark returned 124,887 publicly viewable wishlists.&lt;/p&gt;
		&lt;p&gt;For an all inclusive search by name, you could compile a comprehensive list of first names and nicknames from the baby names databases available on the internet. Armed with this list, and by recording the search results for each first name, it is possible for you to retrieve the vast majority of public wishlists on Amazon.&lt;/p&gt;
		&lt;p&gt;For the purposes of this exercise, only a single name was chosen &amp;#150; a common male name that returned over 260,000 wishlists. I'm not going to divulge what name was actually used. Let's pretend it was &amp;quot;Edgar,&amp;quot; in honor of former FBI director &lt;a href="http://en.wikipedia.org/wiki/Edgar_Hoover"&gt;J. Edgar Hoover&lt;/a&gt;.&lt;/p&gt;
		&lt;p&gt;Before writing a script to download all the 260,000 &amp;quot;Edgar&amp;quot; wishlists, I confirmed that my actions would not violate Amazon's &lt;a href="http://www.amazon.com/exec/obidos/tg/browse/-/508088/104-3800471-2027167"&gt;Conditions of Use&lt;/a&gt;.  I also checked the &lt;a href="http://www.amazon.com/robots.txt"&gt;robots.txt&lt;/a&gt; file which contains a list of directories Amazon requests not be traversed by scripts. User wishlists are not in this list, nor did the actions to be taken violate the conditions of use.&lt;/p&gt;
		&lt;p&gt;I started by doing a wishlist search for people named &amp;quot;Edgar&amp;quot; and got back a page linking to the wishlists of the first 25 matches. The url looked something like this:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;http://www.amazon.com/gp/registry/search.html/?encoding=UTF8&amp;amp;type=wishlist&amp;amp;field-name=edgar&amp;amp;page=1&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;Two variables extracted from the above url are of particular note:&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;field-name=edgar
			
			&lt;li&gt;page=1
		
		&lt;/ul&gt;
		&lt;p&gt;Changing &amp;quot;edgar&amp;quot; to &amp;quot;george&amp;quot;, would generate the first page of matches for people named George. Change '1' to '2' and you'd get matches 26 through 50 instead of 1 through 25.&lt;/p&gt;
		&lt;p&gt;Using a simple 6-line &lt;a href="http://en.wikipedia.org/wiki/Bourne_shell"&gt;shell script&lt;/a&gt; and the popular &lt;a href="http://www.gnu.org/software/wget/wget.html"&gt;wget&lt;/a&gt; command line tool, I configured two computers on two different DSL connections to begin downloading all 260,000 wishlists in increments of 25,000. Each group of 25,000 wishlists took about four hours to download, for a total download time of less than one day. Each wishlist is located at an address like this:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt; http://www.amazon.com/gp/registry/registry.html/?encoding=UTF8&amp;amp;type=wishlist&amp;amp;id=1DBHU3OCV72ZW&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;1DBHU3OCV72ZW is the wishlist owner's unique Amazon identification number. I made up the one you see here. By directing wget only to download pages at urls similar to this one, and by incrementing the search page from 1 to 10,400, it is possible to download all 260,000 wishlists without user intervention. Using a pair of 5-year-old computers, two home DSL connections, 42 hours of computer time, and 5 man hours, I now had documents describing the reading preferences of 260,000 U.S. citizens.&lt;/p&gt;
		&lt;p&gt;I downloaded all the files to an external 120 GB Firewire drive in &lt;a href="http://en.wikipedia.org/wiki/Unix_File_System"&gt;UFS&lt;/a&gt; format. The raw data occupied little more than 5 GB. I initially wanted to move all the files into a single directory to facilitate searching, but as the directory contents exceeded 100,000 items, the speed became glacially slow, so I kept the data divided into chunks of 25,000 wishlists.&lt;/p&gt;
		&lt;p&gt;Next comes the fun part &amp;#150; what books are most dangerous? So many to choose from. Here's a sample of the list I made. Feel free to make up your own list if you decide to try some data mining. Send it to the FBI. I'm sure they'll appreciate your help in fighting terrorism.&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0140432078/applefritter-20"&gt;On Liberty&lt;/a&gt; by Stuart Mill. First sentence: &amp;quot;The subject of this essay is not the so-called 'liberty of the will', so unfortunately opposed to the misnamed doctrine of philosophical necessity; but civil, or social liberty: the nature and limits of the power which can be legitimately exercised by society over the individual.&amp;quot; What more do you need?
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0440180295/applefritter-20"&gt;Slaughterhouse-Five&lt;/a&gt; by Kurt Vonnegut. The classic anti-war novel.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0345342968/applefritter-20"&gt;Fahrenheit 451&lt;/a&gt; by Ray Bradbury. Dystopian.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0060929871/applefritter-20"&gt;Brave New World&lt;/a&gt; by Aldous Huxley. More dystopian.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0451524934/applefritter-20"&gt;1984&lt;/a&gt; by George Orwell. Most dystopian.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0521009847/applefritter-20"&gt;Critical Thinking&lt;/a&gt; by Alec Fisher. Can't have any of that.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0830606041/applefritter-20"&gt;Build Your Own Laser, Phaser, Ion Ray Gun and Other Working Space Age Projects&lt;/a&gt; by Robert Iannini. Obviously.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/193183640X/applefritter-20"&gt;Apple I Replica Creation&lt;/a&gt; by Tom Owad. Building your own computer should be illegal. (ok, it's also here because I wrote it.)
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0809143151/applefritter-20"&gt;The Catholic Worker Movement: Intellectual And Spiritual Origins&lt;/a&gt; by Mark &amp;amp; Louise Zwick.
		&lt;/ul&gt;
		&lt;p&gt;Keywords&lt;/p&gt;
		&lt;ul&gt;
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Michael%20Moore%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Michael Moore&lt;/a&gt;. The fringe left.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Rush%20Limbaugh%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Rush Limbaugh&lt;/a&gt;. The fringe right.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Ralph%20Nader%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Ralph Nader&lt;/a&gt;.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/ref=br_ss_hs/?platform=gurupa&amp;url=index%3Dstripbooks%3Arelevance-above%26dispatch%3Dsearch%26results-process%3Dbin&amp;field-keywords=greenpeace&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Greenpeace&lt;/a&gt;. Because frankly, we all know there's only one sort of person who would want a &amp;quot;Greenpeace: Standing Up for the Earth&amp;quot; 2006 Calendar.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/ref=br_ss_hs/?platform=gurupa&amp;url=index%3Dstripbooks%3Arelevance-above%26dispatch%3Dsearch%26results-process%3Dbin&amp;field-keywords=Torah&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Torah&lt;/a&gt;.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=Quran&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Quran&lt;/a&gt; &amp;amp; &lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=Quran&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Koran&lt;/a&gt;. Like the Catholic Worker and Greenpeace, the &lt;a href="http://www.adc.org/"&gt;American-Arab Anti-Discrimination Committee&lt;/a&gt; has also been the subject of FBI investigations.
			&lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=bible&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Bible&lt;/a&gt;. Sure, a lot of books use &amp;quot;Bible&amp;quot; in the title, but I cast a wide net. What harm are a few false positives?
		&lt;/ul&gt;
		&lt;p&gt;My Amazon seller ID is attached to these links. If I get any interesting statistics on how many copies of &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0140432078/applefritter-20"&gt;On Liberty&lt;/a&gt;, etc., are sold as a result of this article, I'll post them in a follow-up. If I get a call from the FBI, I'll let you know that, too.&lt;/p&gt;
		&lt;p&gt;To search for specific books, I used ISBN numbers, for the rest, keywords.  All the search terms were saved to terms.txt, one term per line, for use with &lt;a href="http://en.wikipedia.org/wiki/Grep"&gt;grep&lt;/a&gt;:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;ls -1 | xargs grep -HiFof /Volumes/UFS/terms.txt &amp;gt; /Volumes/UFS/matches.txt&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;This command searches all wishlists in the current directory for the terms in terms.txt, then saves the results to matches.txt.  Results are stored one per line, in the format:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;filename:keyword&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;Now that I have a list of which keywords appear in which wishlists, I can sort them. I created a new folder &amp;quot;results&amp;quot; and within it created subfolders for each search term. The &lt;a href="http://en.wikipedia.org/wiki/Tcl"&gt;TCL&lt;/a&gt; script below creates links (similar to aliases or shortcuts) for each matched file, and stores the links within the new subdirectories:&lt;/p&gt;
		&lt;code&gt;#!/usr/bin/tclsh&lt;br /&gt;
				&lt;br /&gt;
				set fdgrep [open &amp;quot;/Volumes/UFS/matches.txt&amp;quot; &amp;quot;r&amp;quot;]&lt;br /&gt;
				&lt;br /&gt;
					while {![eof $fdgrep]} {&lt;br /&gt;
				 &amp;nbsp;&amp;nbsp;gets $fdgrep line&lt;br /&gt;
				 &amp;nbsp;&amp;nbsp;set mylist [split $line :]&lt;br /&gt;
				&amp;nbsp;&amp;nbsp;if {[llength $mylist] &amp;gt; 1} {&lt;br /&gt;
				 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lappend mylist [string toupper [lindex $mylist 1]]&lt;br /&gt;
				&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if {![file exists &amp;quot;/Volumes/UFS/results/[lindex $mylist 2]/[lindex $mylist 0]&amp;quot;]} {&lt;br /&gt;
				&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exec ln /Volumes/UFS/wishlists/[lindex $mylist 0] &amp;quot;/Volumes/UFS/results/[lindex $mylist 2]/[lindex $mylist 0]&amp;quot;&lt;br /&gt;
				 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
				 &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
					}&lt;/code&gt;
		&lt;p&gt;Now, for example, the folder called &amp;quot;Greenpeace&amp;quot; contains every wishlist with that term. Another folder named &amp;quot;Rush Limbaugh&amp;quot; contains the wishlists of all the those interested in reading Rush.&lt;/p&gt;
		&lt;div align="center"&gt;
			&lt;table border="1" cellspacing="2" cellpadding="2"&gt;
				&lt;tr&gt;
					&lt;td&gt;
						&lt;p&gt;On an aside, if you want to delete all the files beginning with the word &amp;quot;search&amp;quot; in a 25,000-file directory, the correct line is:&lt;/p&gt;
						&lt;p&gt;&lt;code&gt;find . -name 'search*' -print0 | xargs -0 rm&lt;/code&gt;&lt;/p&gt;
						&lt;p&gt;This line deletes &lt;i&gt;all&lt;/i&gt; the files:&lt;/p&gt;
						&lt;p&gt;&lt;code&gt;find . -print0 -name 'search*' | xargs -0 rm&lt;/code&gt;&lt;/p&gt;
						&lt;p&gt;Good thing I had backups.&lt;/p&gt;
						&lt;p&gt;There's also a bug, in grep 2.5.1 that corrupts output when grep is run with both the -i and -o flags. Version 2.5.1-1, available through the &lt;a href="http://fink.sourceforge.net/"&gt;Fink project&lt;/a&gt;, fixes this problem.&lt;/p&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/table&gt;
		&lt;/div&gt;
		&lt;p&gt;&lt;/p&gt;
		&lt;p&gt;One curiousity revealed by this project is that there are quite a few people who show up for multiple books. Reading &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0140432078/applefritter-20"&gt;On Liberty&lt;/a&gt; &lt;i&gt;and&lt;/i&gt; &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0830606041/applefritter-20"&gt;Build Your Own Laser, Phaser, Ion Ray Gun and Other Working Space Age Projects&lt;/a&gt;? We really should have a special list for you. &lt;/p&gt;
		&lt;p&gt;Here are the books, along with the numbers of people interested in reading each:&lt;/p&gt;
		&lt;table border="0" cellspacing="2" cellpadding="0"&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;b&gt;Book&lt;/b&gt;&lt;/td&gt;
				&lt;td&gt;&lt;b&gt;# of people interested&lt;/b&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0140432078/applefritter-20"&gt;On Liberty&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						7&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0440180295/applefritter-20"&gt;Slaughterhouse-Five&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						82&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0345342968/applefritter-20"&gt;Fahrenheit 451&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						63&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0060929871/applefritter-20"&gt;Brave New World&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						1&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0451524934/applefritter-20"&gt;1984&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						76&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0521009847/applefritter-20"&gt;Critical Thinking&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						7&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0830606041/applefritter-20"&gt;Build Your Own Laser&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						2&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/193183640X/applefritter-20"&gt;Apple I Replica Creation&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						4&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0809143151/applefritter-20"&gt;The Catholic Worker Movement&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						1&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0801489024/applefritter-20"&gt;Rebuilding Labor&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						2&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Michael%20Moore%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Michael Moore&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						232&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Rush%20Limbaugh%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Rush Limbaugh&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						42&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/index=books%26field-author-exact=Ralph%20Nader%26rank=-relevance,+availability,-daterank/applefritter-20"&gt;Ralph Nader&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						74&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/ref=br_ss_hs/?platform=gurupa&amp;url=index%3Dstripbooks%3Arelevance-above%26dispatch%3Dsearch%26results-process%3Dbin&amp;field-keywords=greenpeace&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Greenpeace&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						5&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/ref=br_ss_hs/?platform=gurupa&amp;url=index%3Dstripbooks%3Arelevance-above%26dispatch%3Dsearch%26results-process%3Dbin&amp;field-keywords=Torah&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Torah&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						42&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=Quran&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Quran&lt;/a&gt; &amp;amp; &lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=Quran&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Koran&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						74&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td&gt;&lt;a href="http://www.amazon.com/exec/obidos/search-handle-url/?url=index%3Dstripbooks%3Arelevance-above&amp;field-keywords=bible&amp;Go.x=0&amp;Go.y=0&amp;Go=Go/applefritter-20"&gt;Bible&lt;/a&gt;&lt;/td&gt;
				&lt;td&gt;
					&lt;div align="center"&gt;
						3,771&lt;/div&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;
		&lt;p&gt; The first match for &amp;quot;Bible,&amp;quot; ironically, was a wishlist containing &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1931160171/applefritter-20"&gt;The Cannabis Grow Bible: The Definitive Guide to Growing Marijuana for Recreational and Medical Use&lt;/a&gt;. Right person. Wrong list.  Another match was for &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1883601207/applefritter-20"&gt;The Linux Bible: GNU Testament&lt;/a&gt;. With Nader, I foolishly searched for last name alone. Thus, there are quite a few hits for &lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000BJ0JUQ/applefritter-20"&gt;The Lemonader&lt;/a&gt; along with the correct results.&lt;/p&gt;
		&lt;p&gt;If some results look suspiciously low, it's probably because in many cases I searched for a specific ISBN while the book is available in multiple formats. Only the first page of each user's wishlist was downloaded. Books are always added to the front of the wishlist which pushes older titles off the first page, so there is also a slight bias in favor of newer books.&lt;/p&gt;
		&lt;p&gt;It is possible for users to associate a shipping address with their wishlists, so that others can order them gifts. Though the full address is hidden, city and state remain visible. I already have first and last name. With this information, I can do a &lt;a href="http://people.yahoo.com/"&gt;Yahoo People Search&lt;/a&gt; to obtain an exact street address and phone number.  Viewing the wishlists that contained &lt;a href="http://www.amazon.com/exec/obidos/ASIN/193183640X/applefritter-20"&gt;Apple I Replica Creation&lt;/a&gt;, I found that all four provided the user's city and state. Of these four, one was a common name that produced multiple hits in his town, two were unlisted (although one of them was in the &lt;a href="../../Desktop/intelius.com"&gt;Intelius&lt;/a&gt; database which I opted not to pay for), and the final individual was present on Yahoo People. So I sent him a signed copy and thanked him for his interest.&lt;/p&gt;
		&lt;p&gt;Thanks to &lt;a href="http://maps.google.com/"&gt;Google Maps&lt;/a&gt; (and many similar services) a street address is all we need to get a satellite image of a person's home. Tempted as I was to provide satellite images of the homes of the search subjects, it just seemed a bit extreme even for this article. Instead, I opted only to pinpoint the centers of the towns in which they live. So at least you'll know that there's &lt;i&gt;somebody&lt;/i&gt; in your community reading &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0521009847/applefritter-20"&gt;Critical Thinking&lt;/a&gt; or some other dangerous text.&lt;/p&gt;
		&lt;p&gt;City and state were extracted using a &lt;a href="http://en.wikipedia.org/wiki/Regular_expression"&gt;regular expression&lt;/a&gt; to create a file for each book containing the locations of its readers.  Locations were stored one per line, in this format:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;Sunnyvale:CA&lt;br /&gt;
					Salt Lake City:Utah&lt;br /&gt;
					Reston:Virginia&lt;br /&gt;
					South Hadley:MA&lt;br /&gt;
					Nevada City:CA&lt;br /&gt;
					Walnut Creek:CA&lt;br /&gt;
					Eagle Nest:NM&lt;br /&gt;
					Memphis:TN&lt;br /&gt;
					North Hollywood:CA&lt;br /&gt;
					Seattle:WA&lt;br /&gt;
				&amp;#x2026;&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;Using the free &lt;a href="http://www.ontok.com/"&gt;Ontok Geocoder&lt;/a&gt; service, I was able to quickly convert city and state to latitude and longitude coordinates.  Ontok uses the public domain &lt;a href="http://www.census.gov/geo/www/tiger/tiger2004se/tgr2004se.html"&gt;TIGER/Line&lt;/a&gt; data available from the U.S. Census Bureau to perform its conversion. It took less than an hour to convert all locations from city and state to longitude and latitude:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;-122.035011, 37.369011&lt;br /&gt;
					-111.903656, 40.696415&lt;br /&gt;
					-77.341591, 38.968300&lt;br /&gt;
					-72.574860, 42.259102&lt;br /&gt;
					-121.013496, 39.262192&lt;br /&gt;
					-122.063980, 37.906521&lt;br /&gt;
					-105.263031, 36.555302&lt;br /&gt;
					-90.045448, 35.148762&lt;br /&gt;
					-118.377838, 34.173100&lt;br /&gt;
					-122.329430, 47.605701&lt;br /&gt;
				&amp;#x2026;&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;Google has released their &lt;a href="http://www.google.com/apis/maps/"&gt;Maps API&lt;/a&gt;, so a map of these locations can be embedded in this article.  The API is simple.  Plotting each point requires only three lines of code:&lt;/p&gt;
		&lt;p&gt;&lt;code&gt;var point = new GPoint(-122.035011, 37.369011);&lt;br /&gt;
					var marker = new GMarker(point);&lt;br /&gt;
					map.addOverlay(marker);&lt;/code&gt;&lt;/p&gt;
		&lt;p&gt;This plots all of the locations on a satellite image of the United States that can be zoomed in to house level. Here are a few interactive samples:&lt;/p&gt;
		&lt;div align="center"&gt;
            &lt;iframe width=760 height=560 frameborder=no scrolling=no src="http://www.applefritter.com/maps/1984.html"&gt;&lt;/iframe&gt;
            &lt;p&gt;&lt;font size="+1"&gt;Readers of &lt;i&gt;1984&lt;/i&gt;.&lt;/font&gt;&lt;/p&gt;
			&lt;iframe width=760 height=560 frameborder=no scrolling=no src="http://www.applefritter.com/maps/torah.html"&gt;&lt;/iframe&gt;
			&lt;p&gt;&lt;font size="+1"&gt;Readers of the Torah.&lt;/font&gt;&lt;/p&gt;
Temporarily removed due to high volume.
			&lt;p&gt;&lt;font size="+1"&gt;You.&lt;/font&gt;&lt;/p&gt;
		&lt;/div&gt;
		&lt;p&gt;The map pinpointing you (your local ISP, actually) requires a good bit of on-the-fly processing, so if the server is exceptionally busy it may not load correctly.&lt;/p&gt;
		&lt;p&gt;In the future, I may make more sophisticated maps using additional data. Maybe a map that includes all the books in the 260,000 wishlists? Simply searching for any book would present a map of the United States showing the locations of all the people interested in reading it.&lt;/p&gt;
		&lt;p&gt;All the tools used in this project are standard and free. The services, likewise, are all free. The technical skills required to implement this project are well within the abilities of anybody who has done any programming. The network connection used to download these files was a standard home DSL connection. The computer that processed the data was a 1.5 GHz &lt;a href="http://www.apple.com/powerbook/index12.html"&gt;PowerBook G4&lt;/a&gt;.  The operating system is &lt;a href="http://www.apple.com/macosx/"&gt;Mac OS X 10.4&lt;/a&gt;, though everything could have been done just as easily with &lt;a href="http://www.debian.org/"&gt;Linux&lt;/a&gt; (and probably with Windows). Not a penny was spent in the writing of this article, just 30 hours of time.&lt;/p&gt;
		&lt;p&gt;This is what's possible with publicly available information, but imagine if one had access to Amazon's entire database - which still contains every sale dating back to 1999 by the way. Under &lt;a href="http://www.aclu.org/privacy/spying/15423res20021024.html"&gt;Section 251&lt;/a&gt; of the Patriot Act, the FBI can require Amazon to turn over its records, without probable cause, for an &amp;quot;authorized investigation . . . to protect against international terrorism or clandestine intelligence activities.&amp;quot;&amp;nbsp;Amazon is forbidden to disclose that they have turned over any records, so that you would never know that the government is keeping records of your book purchases. And obviously it is quite simple to crossreference this info with data available in other databases.&lt;/p&gt;
		&lt;p&gt;On a final note, the FBI is now hiring computer scientists to implement a project that sounds very similar to what I just did:&lt;/p&gt;
		&lt;p&gt;&amp;quot;Currently, the FBI is strengthening systems engineering in order to tie new systems together architecturally and ensure that standards for custom and packaged applications are enforced, and it needs engineers to accomplish this goal, the agency said.&lt;/p&gt;
		&lt;p&gt;&amp;quot;The FBI is also focusing on data warehousing as well as federated search technology, which allows a single search query to be deployed across a number of databases, regardless of whether those databases belong to the same protocol or platform.&lt;/p&gt;
		&lt;p&gt;&amp;quot;'Warehousing has been very successful, yet enterprise extraction, translation and loading processes must be fine-tuned,&amp;rdquo; the FBI said. &amp;ldquo;Data engineers are needed to model legacy databases for federated search and participate in legacy transition planning.'&amp;quot;&lt;font size="-2"&gt;(&lt;a href="http://computerworld.com/governmenttopics/government/story/0,10801,107390,00.html"&gt;Computerworld&lt;/a&gt;)&lt;/font&gt;&lt;/p&gt;
		&lt;p&gt;&lt;/p&gt;
		&lt;p&gt;&lt;i&gt;This article is the first in a weekly series that will deal with security on the internet and practical steps you can take to protect your privacy. Much thanks goes to Robert Warwick for his help with this project and particularly for writing several of the scripts. Thanks also to Nancy Trump for editing, Michael Fincham for brainstorming, Dr. Bob for bandwidth, and &lt;a href="http://www.forest.net"&gt;digital.forest&lt;/a&gt; for hosting Applefritter. Article submissions are welcome. If you'd like to contact me, please do so via &lt;a href="mailto:owad@applefritter.com"&gt;email&lt;/a&gt;.&lt;/i&gt;&lt;/p&gt;
</description>
 <pubDate>Sat, 07 Jan 2006 18:20:38 -0800</pubDate>
</item>
</channel>
</rss>
