<?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>CaesarCipher.com</title>
	<atom:link href="http://www.caesarcipher.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.caesarcipher.com</link>
	<description>Facts and Stories about Cryptology from Ancient Times to Quantum Computing</description>
	<lastBuildDate>Sat, 13 Sep 2008 22:04:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Playfair cipher in &#8220;National Treasure: Book of Secrets&#8221;</title>
		<link>http://www.caesarcipher.com/2008/09/14/the-playfair-cipher-in-national-treasure-book-of-secrets/</link>
		<comments>http://www.caesarcipher.com/2008/09/14/the-playfair-cipher-in-national-treasure-book-of-secrets/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 22:04:17 +0000</pubDate>
		<dc:creator>Matthias Hamann</dc:creator>
				<category><![CDATA[19th century cryptology]]></category>
		<category><![CDATA[Cryptanalysis]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[Movies and TV]]></category>
		<category><![CDATA[Substitution ciphers]]></category>
		<category><![CDATA[Charles Wheatstone]]></category>
		<category><![CDATA[ciphertext-only attack]]></category>
		<category><![CDATA[CrypTool]]></category>
		<category><![CDATA[frequency analysis]]></category>
		<category><![CDATA[Lyon Playfair]]></category>
		<category><![CDATA[National Treasure]]></category>
		<category><![CDATA[Playfair cipher]]></category>
		<category><![CDATA[shotgun hill climbing]]></category>
		<category><![CDATA[Vigenère cipher]]></category>

		<guid isPermaLink="false">http://www.caesarcipher.com/?p=245</guid>
		<description><![CDATA[Some weeks ago, I rented the 2007 adventure film National Treasure: Book of Secrets on DVD, in which treasure hunter Benjamin Franklin Gates (played by Nicholas Cage) looks to discover the truth behind the assassination of Abraham Lincoln. In the movie&#8217;s first scene, which takes place in a tavern in Washington, D.C. five days after [...]]]></description>
			<content:encoded><![CDATA[<p>Some weeks ago, I rented the 2007 adventure film <em>National Treasure: Book of Secrets</em> on DVD, in which treasure hunter Benjamin Franklin Gates (played by Nicholas Cage) looks to discover the truth behind the assassination of Abraham Lincoln. In the movie&#8217;s first scene, which takes place in a tavern in Washington, D.C. five days after the end of the Civil War, Ben Gates&#8217; great-great-grandfather Thomas Gates is approached by John Wilkes Booth and another member of the <em>Knights of the Golden Circle</em>, who ask him to decipher a secret message, which has obviously been encrypted using the Playfair cipher and might lead them to a mythological city of gold called Cíbola.</p>
<p>As the Playfair cipher was state-of-the-art at the end of the Civil War in 1865, I wondered how someone (even if portrayed as a well-known puzzle solver) would be able to perform a successful ciphertext-only attack within just one or two hours, not having any frequency tables at hand and given a ciphertext consisting of only 22 digraphs (= pairs of letters). The following article will explain the basic concepts (encryption, decryption and cryptanalysis) of the Playfair cipher using the example from <em>National Treasure: Book of Secrets</em>.</p>
<p><span id="more-245"></span></p>
<p>The Playfair cipher<sup>1</sup> was the first digraph substitution cipher in history, that is, letters are sequentially encrypted and decrypted in pairs. This scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair<sup>2</sup>, who promoted the use of the cipher. The digraph substitution makes frequency-based cryptanalysis significantly harder as one has to deal with 600 possible digraphs<sup>3</sup> rather than the 26 possible monographs. In effect, larger ciphertexts are necessary to perform a successful cryptanalysis compared to conventional monograph substitution ciphers. Due to this characteristic, the Playfair cipher was superior to many contemporary ciphers and as it was also relatively easy to use, the British forces even employed it as a field cipher during World War I, about 50 years after the American Civil War.</p>
<p>So how did the fictional character Thomas Gates manage to decrypt the following (rather short) ciphertext?</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">ME IK QO TX CQ
TE ZX CO MW QC
TE HN FB IK ME HA
KR QC UN GI KM AV</pre></td></tr></table></div>

<p>Most likely, he simply guessed the correct keyword &#8220;DEATH&#8221; by using the given hint &#8220;The debt that all men pay.&#8221; In that case, he would have constructed the corresponding 5&#215;5 Playfair square by entering &#8220;DEATH&#8221;<sup>4</sup> in the first row<sup>5</sup> and filling the square up with the remaining letters of the alphabet<sup>6</sup>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">D E A T H
B C F G I
K L M N O
P Q R S U
V W X Y Z</pre></td></tr></table></div>

<p>The ciphertext can now be easily decrypted using the above Playfair square by applying the following four rules<sup>7</sup> to all ciphertext digraphs:</p>
<ol>
<li>If the two letters appear on the same row of the Playfair square, replace them with the letters to their immediate left respectively (wrapping around to the right side of the row if a letter in the original pair was on the left side of the row).</li>
<li>If the two letters appear on the same column of the Playfair square, replace them with the letters immediately above respectively (wrapping around to the bottom side of the column if a letter in the original pair was on the top side of the column).</li>
<li>If the letters are not on the same row or column of the Playfair square, replace them with the letters on the same row respectively but at the other pair of corners of the rectangle defined by the original pair. (The first encrypted letter of the pair is the one that lies on the same row as the first plaintext letter.)</li>
<li>Drop any extra &#8220;X&#8221; characters which don&#8217;t make sense in the final message.</li>
</ol>
<p>Hence, the plaintext of the message which Thomas Gates successfully decrypted reads as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">LA BO UL AY EL
AD YW IL LX LE
AD TO CI BO LA TE
MP LE SO FG OL DX</pre></td></tr></table></div>

<p>If the superfluous &#8220;X&#8221; characters are dropped and the whitespaces are modified correctly, the resulting message is &#8220;Laboulaye lady will lead to Cibola temples of gold&#8221;. In the movie, this hint refers to the French Statue of Liberty, which is actually the sister statue of the American Statue of Liberty, whose intellectual creator was the French politican Édouard René de Laboulaye. Cíbola is one of the fantastic <em>Seven Cities of Gold</em> existing only in a myth that originated around the year 1150 when the Moors conquered Mérida, Spain. The legend of the seven cities of gold survived for many centuries and even drew the Conquistadors northward until they encountered the French colonists, who successfully resisted their further advance. In the movie <em>National Treasure: Book of Secrets</em> Thomas Gates&#8217; descendant Ben Gates finally manages to rediscover the mythological temples of gold in a huge cave under Mount Rushmore.</p>
<p>However, the final question remains whether a ciphertext-only attack on the short ciphertext given in the movie would be feasible. The usual entry point for cryptanalysis relating the Playfair system is a frequency analysis of the ciphertext&#8217;s digraphs. Unluckily, the above plaintext doesn&#8217;t contain even one of the ten most frequent English digraphs: th, he, in, er, an, re, nd, at, on, nt. Another way of attacking the Playfair cipher is the fact that if a letter pair AB is encrypted to CD then the pair BA is always encrypted to DC. Thus finding such pairs in the ciphertext (e.g., &#8220;CQ … QC … QC&#8221;) may prove highly fruitful. But again, the corresponding plaintext digraphs &#8220;EL&#8221; and &#8220;LE&#8221; have relatively low frequencies in ordinary English texts, whereas the digraphs &#8220;TH&#8221; and &#8220;HT&#8221; are the most frequent English digraphs but don&#8217;t appear in the plaintext at all. An obvious weakness of the Playfair cipher (especially if the password is relatively short) is the fact that in many cases the Playfair square ends with &#8220;XYZ&#8221;. In the given example, the situation is even worse as the last line equals to the end of the alphabet &#8220;VWXYZ&#8221;. Another way of breaking the above ciphertext might be the so called shotgun hill climbing method in combination with the massive computation power of modern computers. This method takes an <em>educated guess</em> as the basis for the initial square (e.g., &#8220;VWXYZ&#8221; as the last line) and employs suitable metrics (e.g., frequency count) to find promising mutations of the Playfair square, which ultimately leads to an approximate solution. However, the unusual nature of the given plaintext &#8220;Laboulaye lady will lead to Cibola temples of gold&#8221; makes it very hard to choose <em>good</em> metrics and even promising ciphertext fragments like &#8220;ME IK … IK ME …&#8221; probably won&#8217;t lead anywhere if the cryptanalyst doesn&#8217;t have any initial idea about the cleartext&#8217;s content (e.g., &#8220;LA BO ul ay [e]&#8221; and &#8220;ci BO LA&#8221;).</p>
<p>In conclusion, the short length of the given ciphertext would have made it virtually impossible for the fictional character Thomas Gates to <em>break</em> the encryption by classical means in 1865. Nowadays, the possibility to perform attacks like the shotgun hill climbing method on powerful computers allow for feasible attacks even in case of short and unusual plaintexts. If you want to give it a try yourself, I recommend using the free software <a title="CrypTool" href="http://www.cryptool.org/" target="_blank">CrypTool</a>, which is not only a great learning environment for cryptographic concepts but also provides many useful tools to attack classical ciphers.</p>
<p>Finally, it might be interesting to know that officials found a Vigenère tableau<sup>8</sup> in the room of the historical John Wilkes Booth after he had shot Abraham Lincoln. As the Confederacy used the Vigenère cipher in conjunction with cipher disks during the Civil War<sup>9</sup>, the prosecution in the trial against eight Southern sympathizers sought to show that Booth&#8217;s Viginère tableau proved the Confederacy government&#8217;s involvement in Lincoln&#8217;s assassination.</p>
<div class="footnotes_box"><b>Footnotes:</b><ol class="footnotes"><li id="footnote_0_245" class="footnote">The Playfair cipher is sometimes referred to as the <em>Playfair code</em>, which is factually wrong because codes operate on the level of linguistic entities, whereas ciphers do not.</li><li id="footnote_1_245" class="footnote">Lyon Playfair, 1st Baron Playfair; 1818-1898.</li><li id="footnote_2_245" class="footnote">I and J are treated as one letter and no duplicate letters are allowed within the same digraph, so 25*24=600.</li><li id="footnote_3_245" class="footnote">No character of the alphabet is entered more than once.</li><li id="footnote_4_245" class="footnote">The movie incorrectly states that a Playfair keyword must have exactly five letters, but actually any length works.</li><li id="footnote_5_245" class="footnote">I and J are treated as one letter.</li><li id="footnote_6_245" class="footnote">The inverse of these four rules was used to encrypt the message in the first place.</li><li id="footnote_7_245" class="footnote">The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.</li><li id="footnote_8_245" class="footnote">The Confederacy&#8217;s primary keywords were &#8220;Manchester Bluff&#8221;, &#8220;Complete Victory&#8221; and, as the war came to a close, &#8220;Come Retribution&#8221;.</li></ol></div>
	<strong>Tags: </strong><a href="http://www.caesarcipher.com/tag/charles-wheatstone/" title="Charles Wheatstone" rel="tag">Charles Wheatstone</a>, <a href="http://www.caesarcipher.com/tag/ciphertext-only-attack/" title="ciphertext-only attack" rel="tag">ciphertext-only attack</a>, <a href="http://www.caesarcipher.com/tag/cryptool/" title="CrypTool" rel="tag">CrypTool</a>, <a href="http://www.caesarcipher.com/tag/frequency-analysis/" title="frequency analysis" rel="tag">frequency analysis</a>, <a href="http://www.caesarcipher.com/tag/lyon-playfair/" title="Lyon Playfair" rel="tag">Lyon Playfair</a>, <a href="http://www.caesarcipher.com/tag/national-treasure/" title="National Treasure" rel="tag">National Treasure</a>, <a href="http://www.caesarcipher.com/tag/playfair-cipher/" title="Playfair cipher" rel="tag">Playfair cipher</a>, <a href="http://www.caesarcipher.com/tag/shotgun-hill-climbing/" title="shotgun hill climbing" rel="tag">shotgun hill climbing</a>, <a href="http://www.caesarcipher.com/tag/vigenere-cipher/" title="Vigenère cipher" rel="tag">Vigenère cipher</a>
]]></content:encoded>
			<wfw:commentRss>http://www.caesarcipher.com/2008/09/14/the-playfair-cipher-in-national-treasure-book-of-secrets/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>BitLocker Drive Encryption: TPM + PIN + USB Key (Vista SP1)</title>
		<link>http://www.caesarcipher.com/2008/08/30/bitlocker-drive-encryption-tpm-pin-usb-key-vista-sp1/</link>
		<comments>http://www.caesarcipher.com/2008/08/30/bitlocker-drive-encryption-tpm-pin-usb-key-vista-sp1/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 14:49:19 +0000</pubDate>
		<dc:creator>Matthias Hamann</dc:creator>
				<category><![CDATA[Computer tips]]></category>
		<category><![CDATA[Disk encryption]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[BitLocker]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PIN]]></category>
		<category><![CDATA[TPM]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.caesarcipher.com/?p=231</guid>
		<description><![CDATA[BitLocker Drive Encryption is a feature of Windows Vista Ultimate and Windows Server 2008, which offers full disk encryption on the level of logical volumes (e.g., C:). As it uses AES 128 by default and the only publicly known way to defeat programs like BitLocker or TrueCrypt (if properly configured) is the famous (but easily [...]]]></description>
			<content:encoded><![CDATA[<p>BitLocker Drive Encryption is a feature of Windows Vista Ultimate and Windows Server 2008, which offers full disk encryption on the level of logical volumes (e.g., C:). As it uses AES 128 by default and the only publicly known way to defeat programs like BitLocker or TrueCrypt (if properly configured) is the famous (but easily preventable) <a title="Wikipedia: Cold boot attack" href="http://en.wikipedia.org/wiki/Cold_boot_attack" target="_blank">cold boot attack</a>, I’d really recommend using it if you are not a follower of the “Microsoft is pure evil” cult. Needless to say, even the strongest disk encryption is only as good as the password or key mechanism you use. In the following, I will describe a little-known option which was introduced with Service Pack 1 for Vista and massively aggravates attacks based on keyloggers <strong>or</strong> stolen USB sticks.</p>
<p><span id="more-231"></span></p>
<p>Most likely, someone who wants to get hold of your encrypted data will neither try to break the encryption algorithm nor its implementation. Instead, he will try to defeat the authentication mechanism by eavesdropping your password (“what you know”) or stealing your physical key (“what you have”). In its initial version, BitLocker forced you to choose between TPM<sup>1</sup> only, TPM + PIN, TPM + USB Key or USB Key only. So it was either something you knew (your PIN) or something you had (your USB key) which protected your data and made BitLocker decrypt your volumes on the fly as you booted your computer.</p>
<p>To the great relief of any paranoid encryption junkie, Microsoft decided to add another mode, which requires TPM + PIN + USB Key to start up your computer. This feature was introduced with Service Pack 1 for Vista and makes it really hard for an attacker to get hold of your authentication details if you don’t write your PIN on your USB stick or get “questioned” by someone with a blow torch and a pair of pliers.</p>
<p>So how does it work? Well, although there is no GUI option for this new mode, it’s surprisingly simple to activate:</p>
<ol>
<li><span style="font-family: courier new,courier;">Click on the Vista logo / start button.</span></li>
<li><span style="font-family: courier new,courier;">Type <em>cmd</em> in the search box and <strong>do NOT hit enter</strong>.</span></li>
<li><span style="font-family: courier new,courier;">Right-click on the command prompt item (cmd.exe) and select &#8220;Run as administrator&#8221; from the context menu.</span></li>
<li><span style="font-family: courier new,courier;">Enter <em>cscript manage-bde.wsf -on c: -rp -rk d: -tpsk -tp 1234567 -tsk e:</em> and hit enter.<br />
(“c:” is the drive which you want to encrypt / your OS volume; “d:” is the drive where the recovery key will be stored at; “1234567” is your secret PIN, which can consist of up to 20 digits; “e:” is your USB key.)</span></li>
<li><span style="font-family: courier new,courier;">Write down the recovery password and hide it at a <strong>SAFE</strong> location (e.g., under your keyboard <img src='http://www.caesarcipher.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</span></li>
<li><span style="font-family: courier new,courier;">Type <em>exit</em> and hit enter.</span></li>
<li><span style="font-family: courier new,courier;">DONE!</span></li>
</ol>
<p>That’s it! I’d strongly recommend leaving your computer in peace until BitLocker has finished encrypting your drive, although the manual states that you can even reboot without causing any trouble. Well, I’m not exactly sure that an accidental BSOD (Blue Screen of Death) caused by your favorite first-person shooter won’t interfere with the encryption process…</p>
<p>Upon the next reboot, you will be asked for your secret PIN <strong>and</strong> the USB key, providing you with the maximum level of authentication-based security which BitLocker has to offer at the moment.</p>
<div class="footnotes_box"><b>Footnotes:</b><ol class="footnotes"><li id="footnote_0_231" class="footnote">The Trusted Platform Module’s job is to detect if there are unauthorized changes to the pre-boot environment.</li></ol></div>
	<strong>Tags: </strong><a href="http://www.caesarcipher.com/tag/authentication/" title="authentication" rel="tag">authentication</a>, <a href="http://www.caesarcipher.com/tag/bitlocker/" title="BitLocker" rel="tag">BitLocker</a>, <a href="http://www.caesarcipher.com/tag/encryption/" title="encryption" rel="tag">encryption</a>, <a href="http://www.caesarcipher.com/tag/microsoft/" title="Microsoft" rel="tag">Microsoft</a>, <a href="http://www.caesarcipher.com/tag/pin/" title="PIN" rel="tag">PIN</a>, <a href="http://www.caesarcipher.com/tag/tpm/" title="TPM" rel="tag">TPM</a>, <a href="http://www.caesarcipher.com/tag/usb/" title="USB" rel="tag">USB</a>, <a href="http://www.caesarcipher.com/tag/vista/" title="Vista" rel="tag">Vista</a>, <a href="http://www.caesarcipher.com/tag/windows/" title="Windows" rel="tag">Windows</a>
]]></content:encoded>
			<wfw:commentRss>http://www.caesarcipher.com/2008/08/30/bitlocker-drive-encryption-tpm-pin-usb-key-vista-sp1/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>CaesarCipher.com got a FAQ!</title>
		<link>http://www.caesarcipher.com/2008/08/29/caesarciphercom-got-a-faq/</link>
		<comments>http://www.caesarcipher.com/2008/08/29/caesarciphercom-got-a-faq/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 19:46:14 +0000</pubDate>
		<dc:creator>Matthias Hamann</dc:creator>
				<category><![CDATA[Blog news]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[JN-25]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[National Treasure]]></category>
		<category><![CDATA[WWII]]></category>

		<guid isPermaLink="false">http://www.caesarcipher.com/?p=226</guid>
		<description><![CDATA[Sorry that there have been only two posts since the start of this blog on 8th August. I have neither lost interest only days after kickoff nor have I been kidnapped by some dark intelligence agency. On the contrary, I have been spending a lot of time on fixing numerous visible and invisible bugs, especially [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry that there have been only two posts since the start of this blog on 8th August. I have neither lost interest only days after kickoff nor have I been kidnapped by some dark intelligence agency. On the contrary, I have been spending a lot of time on fixing numerous visible and invisible bugs, especially in the translated versions of this blog. Moreover, there is a whole bunch of new features available like a highly scalable <a title="CaesarCipher.com FAQ" href="http://www.caesarcipher.com/faq/">FAQ</a> and LaTeX support for posts and comments!</p>
<p>I am optimistic that the stage of initial installations and bug fixes has come to an end now, so that from this point on, I can exclusively focus on what this blog is really about: cryptology! On my desk, there are already some drafts about the Playfair cipher, which was extensively referred to in the blockbuster “National Treasure: Book of Secrets” (2007), and the Japanese code JN-25, which played a decisive role in WWII’s Battle for the Pacific. So please stay tuned for what’s to come in the near future!</p>

	<strong>Tags: </strong><a href="http://www.caesarcipher.com/tag/faq/" title="FAQ" rel="tag">FAQ</a>, <a href="http://www.caesarcipher.com/tag/jn-25/" title="JN-25" rel="tag">JN-25</a>, <a href="http://www.caesarcipher.com/tag/latex/" title="LaTeX" rel="tag">LaTeX</a>, <a href="http://www.caesarcipher.com/tag/national-treasure/" title="National Treasure" rel="tag">National Treasure</a>, <a href="http://www.caesarcipher.com/tag/wwii/" title="WWII" rel="tag">WWII</a>
]]></content:encoded>
			<wfw:commentRss>http://www.caesarcipher.com/2008/08/29/caesarciphercom-got-a-faq/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>.htaccess: Exclude subdirectory from authentication</title>
		<link>http://www.caesarcipher.com/2008/08/16/htaccess-exclude-subdirectory-from-authentication/</link>
		<comments>http://www.caesarcipher.com/2008/08/16/htaccess-exclude-subdirectory-from-authentication/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 23:15:39 +0000</pubDate>
		<dc:creator>Matthias Hamann</dc:creator>
				<category><![CDATA[Computer tips]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[htpasswd]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.caesarcipher.com/?p=142</guid>
		<description><![CDATA[Some days ago I decided to improve the security of my new Wordpress blog by using .htaccess and Basic Authentication to protect the wp-admin folder. This task was rather trivial as the whole procedure is well documented in the Apache manual and there are convenient online tools to create the necessary .htaccess and .htpasswd files (.htaccess generator &#38; .htpasswd generator) for those [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I decided to improve the security of my new Wordpress blog by using .htaccess and Basic Authentication to protect the wp-admin folder. This task was rather trivial as the whole procedure is well documented in the <a href="http://httpd.apache.org/docs/1.3/howto/auth.html#basic" target="_blank">Apache manual</a> and there are convenient online tools to create the necessary .htaccess and .htpasswd files (<a href="http://www.htaccesstools.com/htaccess-authentication/" target="_blank">.htaccess generator</a> &amp; <a href="http://www.htaccesstools.com/htpasswd-generator/" target="_blank">.htpasswd generator</a>) for those who don&#8217;t have their own server and use shared hosting instead.</p>
<p>So far, so good. But when I tried to access wp-login.php, which is located in Wordpress&#8217; base folder, I had to realize that it uses two CSS files from the folder wp-admin/css. As wp-login.php and the two CSS files should be accessible to any visitor of my blog, I needed to find a way to exclude the subfolder wp-admin/css from the Basic Authentication protecting wp-admin. Unluckily, it seems that there is no specific command for that purpose.</p>
<p>After crawling Google for approximately two hours I finally managed to find a solution, which needs only three lines of code to <em>bypass</em> the Basic Authentication of the parent directory. Simply create a new .htaccess file in the subfolder you want to exclude from the authentication and add the following lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">Order Deny,Allow
Allow from all
Satisfy any</pre></td></tr></table></div>

<p>&#8220;Allow from all&#8221; will grant any IP address access to this folder. But the decisive line is &#8221;Satisfy any&#8221;, which tells the server to require <strong>either</strong> a correct Basic Authentication or the satisfaction of the &#8220;Deny/Allow&#8221; properties (the standard is &#8220;Satisfy all&#8221;, which requires both). As &#8220;Allow from all&#8221; gives access to anyone, this effectively neutralizes the Basic Authentication inherited from the parent folder.</p>

	<strong>Tags: </strong><a href="http://www.caesarcipher.com/tag/apache/" title="Apache" rel="tag">Apache</a>, <a href="http://www.caesarcipher.com/tag/authentication/" title="authentication" rel="tag">authentication</a>, <a href="http://www.caesarcipher.com/tag/blog/" title="blog" rel="tag">blog</a>, <a href="http://www.caesarcipher.com/tag/htaccess/" title="htaccess" rel="tag">htaccess</a>, <a href="http://www.caesarcipher.com/tag/htpasswd/" title="htpasswd" rel="tag">htpasswd</a>, <a href="http://www.caesarcipher.com/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>
]]></content:encoded>
			<wfw:commentRss>http://www.caesarcipher.com/2008/08/16/htaccess-exclude-subdirectory-from-authentication/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Welcome to CaesarCipher.com!</title>
		<link>http://www.caesarcipher.com/2008/08/08/welcome-to-caesarciphercom/</link>
		<comments>http://www.caesarcipher.com/2008/08/08/welcome-to-caesarciphercom/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 19:54:36 +0000</pubDate>
		<dc:creator>Matthias Hamann</dc:creator>
				<category><![CDATA[Blog news]]></category>
		<category><![CDATA[Easy]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[cryptography]]></category>

		<guid isPermaLink="false">http://www.caesarcipher.com/?p=113</guid>
		<description><![CDATA[&#8220;Hello World!&#8221;
That&#8217;s how almost any beginner&#8217;s guide to programming starts, so it&#8217;s probably a good line to begin my first public blog with. Hopefully, you&#8217;ll find many useful facts and intersting stories about cryptography and relating topics at this place very soon. Please grant me some time to develop my personal &#8220;blogging style&#8221; and support me [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Hello World!&#8221;</p>
<p>That&#8217;s how almost any beginner&#8217;s guide to programming starts, so it&#8217;s probably a good line to begin my first public blog with. Hopefully, you&#8217;ll find many useful facts and intersting stories about cryptography and relating topics at this place very soon. Please grant me some time to develop my personal &#8220;blogging style&#8221; and support me by making extensive use of the available rating and comment possibilities!</p>
<p>Have fun,<br />
Matt</p>

	<strong>Tags: </strong><a href="http://www.caesarcipher.com/tag/blog/" title="blog" rel="tag">blog</a>, <a href="http://www.caesarcipher.com/tag/cryptography/" title="cryptography" rel="tag">cryptography</a>
]]></content:encoded>
			<wfw:commentRss>http://www.caesarcipher.com/2008/08/08/welcome-to-caesarciphercom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
