<?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>FILI&#039;S TECH THOUGHTS &#187; demo</title>
	<atom:link href="http://blog.fili.nl/tag/demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fili.nl</link>
	<description>-- All wiyht.  Rho sritched mg kegtops awound?</description>
	<lastBuildDate>Thu, 08 Jul 2010 15:45:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The Anti-Captcha Challenge</title>
		<link>http://blog.fili.nl/articles/the-anti-captcha-challenge/</link>
		<comments>http://blog.fili.nl/articles/the-anti-captcha-challenge/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:50:40 +0000</pubDate>
		<dc:creator>fili</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[anti-captcha]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.fili.nl/?p=1</guid>
		<description><![CDATA[Recap: the problem with current Captcha solutions The general purpose of Captcha's are to prevent the automation of form submission. For example, to protect a guestbook from filling up with spam-entries or to prevent hundreds of bogus users registering to a forum. Until recently, image-based Captcha's have been a reasonable solution to combat this problem. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><strong>Recap: the problem with current Captcha solutions</strong><br />
The general purpose of Captcha's are to prevent the automation of form submission. For example, to protect a guestbook from filling up with spam-entries or to prevent hundreds of bogus users registering to a forum.</p>
<p style="text-align: left;">Until recently, image-based Captcha's have been a reasonable solution to combat this problem. However, with Object Character Recognition techniques getting better and better, Captcha's too have to continuously increase in complexity.</p>
<p>Just look at these gems and imagine yourself being color blind:</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-14" title="some-unreadable-captchas" src="http://blog.fili.nl/wp-content/uploads/2009/08/some-unreadable-captchas.png" alt="some-unreadable-captchas" width="392" height="213" /></p>
<p style="text-align: left;">Ironically, it's come to the point that computers are better at deciphering Captcha's than humans are, simply because computers have infinite patience.</p>
<p style="text-align: left;">To illustrate: evildoers trying to beat your Captcha are probably satisfied with a success ratio of 1/100 – because in just a few hours of repetition this can add up to hundreds of successful passes. A typical human user on the other hand probably throws in the towel after three consecutive failed attempts – at which point they'll most likely leave your website altogether.</p>
<p style="text-align: left;">Who can blame them? The average user doesn't understand <em>why </em>they should enter a random string of letters in the first place. It's not their problem and they do not care what it is for. For them it's some sort of annoying puzzle that stands in the way of doing what they want to do. Not being able to pass it, makes them feel inadequate and frustrated.</p>
<p style="text-align: left;">I argue, let's keep the end-user entirely out of it,<br />
I propose we  rid ourselves of Captcha's as we know it,<br />
I proclaim this the era of Anti-Captcha's... <em>Hallelujah!</em></p>
<p style="text-align: left;"><strong>The Anti-Captcha challenge</strong><br />
The basic idea behind it is simple;</p>
<p style="text-align: left;"><em><span style="color: #000000;">"Create a captcha solution which does not require any end-user interaction"</span></em></p>
<p style="text-align: left;">As a first attempt, I concocted a working Anti-Captcha based on the reasoning that only browsers can interpret javascript well. Making it a question of "Has a browser been involved at form submission?" instead of "Has a human been involved". In general the answer ends up to be equal (see "Caveats" section below).</p>
<p style="text-align: left;"><strong>How it works<br />
</strong>Check out the <a href="http://www.fili.nl/anti-captcha/" target="_blank">online demo here</a></p>
<p>In the head of the html document an external javascript-file is called, this file is in fact a php file which is designed to:</p>
<ol style="text-align: left;">
<li>Generate a random token</li>
<li>Store a checksum of this token in a cookie</li>
<li>Generate some obfuscated javascript code which (when interpreted) adds a hidden input-field to every form element on the webpage using the token as a value</li>
</ol>
<p style="text-align: left;">After form-submission, the checksum of the post value should equal the checksum stored in the cookie. As a bonus, this technique should also provide adequate protection against <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery" target="_blank">XSRF</a>.</p>
<p style="text-align: left;"><strong>Installation</strong><em><br />
</em></p>
<ol style="text-align: left;">
<li>Download <a href="http://www.fili.nl/anti-captcha/anti-captcha-0.2.zip" target="_blank">Anti-Captcha</a></li>
<li>Put both scripts in the head of your html document (in the proper order):
<pre class="brush: xml;">
&lt;head&gt;
&lt;script src=&quot;anti-captcha-0.2.js.php&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
</li>
<li>After form-submission match the input value with the sha1 checksum stored as a cookie:
<pre class="brush: php;">
&lt;?php
// Verify the token using the checksum stored in cookie
if (sha1($_POST['anti-captcha-token']) == $_COOKIE['anti-captcha-crc']) {

// Reset token (preventing form resubmission)
setcookie ('anti-captcha-crc', sha1(rand()), time() + 3600, '/');

// Continue form validation
die('Captcha accepted');

} else {

// No Anti-Captcha checksum received
die('Error, please enable javascript and/or cookies');

}
</pre>
</li>
</ol>
<p><em>Looking for the WordPress plugin? <a href="http://blog.fili.nl/articles/wordpress-plugin-anti-captcha/" target="_self">Click here</a></em><strong><br />
</strong></p>
<p style="text-align: left;"><strong>Requirements<br />
</strong>The Anti-Captcha script is written to be PHP4 compatible and should run on most hosting platforms. It has been tested and verified to work on most browsers, including the dreaded IE6. Note: the user does need to have javascript and cookies enabled for form submission to succeed.</p>
<p style="text-align: left;"><strong>Caveats</strong><br />
Obviously this technique isn't perfect, at some point bots might gain the ability to interpret javascript or simply read-out the obfuscated code instead. At that time a different approach, with a similar concept, would be needed.</p>
<p style="text-align: left;">It should also be possible to fool the Anti-Captcha with the use of “automated mouse-clicking software”. However this should be very hard to combine with botnets - thus making additional security layers (for example: maximizing form-submission on a per-ip basis) more feasible.</p>
<p style="text-align: left;">Another major drawback is the need for javascript to allow form-submissions, which is something you should ponder over yourself. Personally I feel it outweighs the disadvantages image-based Captcha's bring in, but this probably depends on the project at hand.</p>
<p style="text-align: left;"><strong>Credits</strong><br />
Part of the obfuscation technique used is based upon <a href="http://dean.edwards.name/packer/" target="_blank">Dean Edwards JavaScript's Packer</a> which is ported to PHP by Nicolas Martin, and made compatible with PHP4 by Mark Fabrizio Jr.</p>
<p style="text-align: left;"><strong>License</strong><br />
The Anti-Captcha is licensed under <a href="http://creativecommons.org/licenses/LGPL/2.1/" target="_blank">LGPL 2.1</a></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; text-align: left;">
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p style="margin-bottom: 0cm;"><span style="font-size: x-large;"><strong>The problem with current Captcha solutions</strong></span></p>
<p style="margin-bottom: 0cm;">The general purpose of a Captcha is to prevent the automation of form submission. For example, to protect a guestbook from filling up with spam-entries or to prevent hundreds of bogus users registering to a forum.</p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">Image based captcha's have been a reasonable solution to combat this problem. However, with Object Character Recognition techniques getting better and better, captcha's too have to continuously increase in complexity. Just look at these fine examples:</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.fili.nl/articles/the-anti-captcha-challenge/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
	</channel>
</rss>
