<?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"
	>

<channel>
	<title>Apathy Sketchpad &#187; Downloads</title>
	<atom:link href="http://www.apathysketchpad.com/blog/category/computers/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.apathysketchpad.com/blog</link>
	<description>Floccinaucinihilipilificating antidisestablishmentarianism since 2001.</description>
	<pubDate>Wed, 20 Aug 2008 20:18:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Zooming Mandelbrot Set Screen Saver</title>
		<link>http://www.apathysketchpad.com/blog/2008/03/29/mandelbrot-screensaver/</link>
		<comments>http://www.apathysketchpad.com/blog/2008/03/29/mandelbrot-screensaver/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 17:34:59 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2008/03/29/mandelbrot-screensaver/</guid>
		<description><![CDATA[I&#8217;ve just added a new download. It&#8217;s a screensaver, which displays an image of the Mandelbrot Set, before slowly zooming in on whatever part of the fractal it thinks is probably interesting.

Code Factory Entry Here
Direct Download Link Here (7.1kB, requires .NET Framework, which you may already have)

Technical notes:

The settings screen assumes you understand what the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just added a new download. It&#8217;s a screensaver, which displays an image of the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set" target="_blank">Mandelbrot Set</a>, before slowly zooming in on whatever part of the fractal it thinks is probably interesting.</p>
<ul>
<li><a href="http://apathysketchpad.com/codefactory/code.php?id=mandelbrot">Code Factory Entry Here</a></li>
<li><a href="http://apathysketchpad.com/codefactory/file.php?id=mandelbrot.zip">Direct Download Link Here</a> (7.1kB, requires <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;displaylang=en" target="_blank">.NET Framework</a>, which you may already have)</li>
</ul>
<p>Technical notes:</p>
<ul>
<li>The settings screen assumes you understand what the Mandelbrot Set is. If you don&#8217;t, the point is that for each point on the screen, the colour represents the number of iterations required before the value exceeds a certain cutoff. You don&#8217;t need to know what that means, but the cutoff is one of the options. Since some points (those <em>within</em> the Mandelbrot Set) will never get there, so the maximum number of iterations option lets you choose when it should give up. A higher cutoff will produce smoother colours but take longer to process. A higher number of iterations will produce more detail but again take longer to process.</li>
<li>The colour step controls how fast the colour changes. A low number will give less contrast but a less psychedelic image.</li>
<li>The minimum spread to zoom, which must be between 0 and 1, controls how interesting something has to be before it will be zoomed in on. Some parts of the image take longer to process than others, so the maximum difficulty to zoom, which again must be between 0 and 1, controls how long a part of the image could take before it will be ignored. If no area of the screen matching these rules can be found, then it will revert to the entire Mandelbrot Set image and start zooming again.</li>
<li>After a great many zooms, you start to hit the limits of double-precision floating point numbers, so changing the maximum zooms option puts a hard limit on how many times it zooms before going back to the start. I find the 40th zoom is where it starts going wrong, though to be fair by that point you&#8217;re looking at an area that would have been 1% the size of a hydrogen atom at the original zoom level.</li>
<li>There&#8217;s no frame rate limiter in this. If you have a ludicrously fast PC at low resolution, it may run too fast. You could try increasing the first two numbers to silly levels. That ought to slow it right down.</li>
<li>I have no idea what happens to this screensaver on multiple monitors.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2008/03/29/mandelbrot-screensaver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My AutoHotKey Script.</title>
		<link>http://www.apathysketchpad.com/blog/2008/03/02/my-autohotkey-script/</link>
		<comments>http://www.apathysketchpad.com/blog/2008/03/02/my-autohotkey-script/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 21:22:58 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2008/03/02/my-autohotkey-script/</guid>
		<description><![CDATA[I just uploaded my script for AutoHotKey. It has a clipboard saver, paste-as-plain-text button, Firefox [b] and [i] support (and the same for LaTeX) &#8212; you can edit this to whatever browser/TeX editor you prefer), generic support for advanced tabbing which I mostly added for Matlab, launch the highlighted URL (because Opera does it and [...]]]></description>
			<content:encoded><![CDATA[<p>I just uploaded my script for <a href="http://www.autohotkey.com" target="_blank">AutoHotKey</a>. It has a clipboard saver, paste-as-plain-text button, Firefox [b] and [i] support (and the same for LaTeX) &#8212; you can edit this to whatever browser/TeX editor you prefer), generic support for advanced tabbing which I mostly added for Matlab, launch the highlighted URL (because Opera does it and it annoys me that Firefox doesn&#8217;t), and a couple of other things. You&#8217;d be better off editing it to suit your needs than using it as-is, but I find it very useful and thought you might too. Everyone should have AutoHotKey, anyway.</p>
<p>Code Factory page: <a href="http://www.apathysketchpad.com/codefactory/code.php?id=autohotkey" target="_blank">http://www.apathysketchpad.com/codefactory/code.php?id=autohotkey</a></p>
<p>Direct download link: <a href="http://www.apathysketchpad.com/codefactory/file.php?id=autohotkey.ahk" target="_blank">http://www.apathysketchpad.com/codefactory/file.php?id=autohotkey.ahk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2008/03/02/my-autohotkey-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I Understand This To Be Obligatory Now</title>
		<link>http://www.apathysketchpad.com/blog/2008/02/29/i-understand-this-to-be-obligatory-now/</link>
		<comments>http://www.apathysketchpad.com/blog/2008/02/29/i-understand-this-to-be-obligatory-now/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 21:42:38 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[One-offs]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2008/02/29/i-understand-this-to-be-obligatory-now/</guid>
		<description><![CDATA[&#160;
&#160;

&#160;
&#160;
]]></description>
			<content:encoded><![CDATA[<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="center"><center><a href="http://www.apathysketchpad.com/blog/wp-content/the-lie-is-a-cake.png" title="Look at me still blogging when there’s Science to do"><img src="http://www.apathysketchpad.com/blog/wp-content/the-lie-is-a-cake.png" alt="Look at me still blogging when there’s Science to do" /></a></center></p>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2008/02/29/i-understand-this-to-be-obligatory-now/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Five Applications You Can&#8217;t Live Without</title>
		<link>http://www.apathysketchpad.com/blog/2007/10/13/five-applications-you-cant-live-without/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/10/13/five-applications-you-cant-live-without/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 11:56:39 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/10/13/five-applications-you-cant-live-without/</guid>
		<description><![CDATA[I&#8217;ve just uploaded a zip file containing five applications I&#8217;ve written which you cannot live without. I say this confidently because there are 18 applications in there and I use at least two of them most days at work. Here they are, divided into broad categories. The first category is probably the most useful for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just uploaded a zip file containing five applications I&#8217;ve written which you cannot live without. I say this confidently because there are 18 applications in there and I use at least two of them most days at work. Here they are, divided into broad categories. The first category is probably the most useful for non-geeks, the second is indispensable for geeks, and the third is mostly no good to anyone.</p>
<p><strong>The &#8220;The Screen Is An Art Package&#8221; Applications<br />
</strong></p>
<p>These are designed to go in a quicklaunch bar, or in an <a href="http://www.majorgeeks.com/download4176.html" target="_blank">Aquadock</a>, or something. They all allow you to run simple image manipulation on the entire screen. Some are useful only for people who do a lot of work with images (and don&#8217;t want to fire up The GIMP every time they get an email), others are just really, really useful. They are:</p>
<ul>
<li>Brightness And Contrast* &#8212; make faint images visible without having to copy-paste into an art package.</li>
<li>Channel Splitter* &#8212; toggle display of red, green, blue, hue, saturation, and value of the screen.</li>
<li>Colour Picker* &#8212; find out the RGB code of any pixel. Also shows HTML colour codes which you can copy to the clipboard.</li>
<li>Copy* &#8212; drag a box on the screen and it will copy that area to the clipboard.</li>
<li>Filters* &#8212; apply blur, sharpen, edge detection or any custom filter to the entire screen</li>
<li>Freeze &#8212; prevent an area of screen from updating. You can also use the programme to quickly grab an area of screen, and move it around. It is very useful for comparing graphs, keeping headers in scrolling tables, and making quick notes from a document you&#8217;re reading.</li>
<li>Histogram* &#8212; see a histogram of the area of screen you select.</li>
<li>Morphology* &#8212; erode and dilate the screen. Useful really only for imaging types.</li>
<li>Paintbrush &#8212; this allows you to draw on the screen, and then continue to work with the painted lines still visible. This is useful for all kinds of different things, as well as being basically awesome.</li>
<li>Save* &#8212; drag an area of screen, and save it to a file. Nothing you can&#8217;t ordinarily do, but it&#8217;s so much faster&#8230;</li>
<li>Thresholder** &#8212; threshold the screen image.</li>
</ul>
<p><strong>Regular Expressions Applications</strong></p>
<p><a href="http://www.regular-expressions.info/" target="_blank">Regular Expressions</a> is a massively useful standard for doing very advanced find-and-replace operations. I&#8217;ve built two little programmes around it:</p>
<ul>
<li>RegExp &#8212; a command line utility that takes standard inputs, applies a regular expressions search to them, then gives the results as  standard outputs. It can be used by anyone who understands the Windows console properly to run regexp find-and-replace on any text file or to create a batch file based on a directory structure. To be honest it should have been built into Windows to begin with. Put it in a folder on your PATH environment variable, or else add its folder to PATH (using contol panel &gt; system &gt; advanced &gt; environment variables).</li>
<li>RegExp File Renamer* &#8212; takes a regular expression pattern and a folder of files, and applies the find-and-replace rule to all filenames therein. It&#8217;s <em>ridiculously</em> useful. It has a preview feature so you can test the expression before applying it to your precious data, and it can copy, delete, move and rename on demand.</li>
</ul>
<p><strong>Everything Else</strong></p>
<ul>
<li>AnyOverlay &#8212; drag a picture onto this window (or load one with the right-click menu) and you can keep it always-on-top, resized, semitransparent, and/or masked to a colour. Useful for aligning things and comparing images. Also pretty handy just for previewing images.</li>
<li>Coverer And Measurer &#8212; tiny application which can be always-on-top (to hide things from people) and displays its dimensions, so you can use it to measure screen distances.</li>
<li>Folder Viewer* &#8211;not the easiest to use application, but it&#8217;s designed to help you flick through a lot of folders each with the same images in. I can&#8217;t imagine this will be as useful to you as it is to me.</li>
<li>Text File Combiner &#8212; it allows you to combine text files in unusual ways, sticking the new file to the top, bottom, left or right of the old. It&#8217;s not great but I&#8217;ve used it before and it helped.</li>
<li>Video Calibration Tool* &#8212; calibrate webcams, USB cameras, TV cards, and the like. It shows you the live feed and the histogram, so you can make sure you&#8217;re getting the most from it. Probably only of interest to people who need such cameras for something more important than Skype.</li>
</ul>
<p>You can <a href="http://www.apathysketchpad.com/codefactory/file.php?id=utilities.zip" target="_blank">download it here</a>. All the applications in it require .NET, because they wouldn&#8217;t exist otherwise.</p>
<hr />*This was already available from this website but I put it in here anyway because I just don&#8217;t care &#8212; these mostly belong together, and storing extra data on this server is dirt cheap anyway, and I honestly can&#8217;t recall if these programmes have been updated since I last uploaded them. If your RegExp File Renamer is case sensitive then they have; the new one isn&#8217;t.**These are available as one combined app, before I split them because it wasn&#8217;t practical to add everything else to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/10/13/five-applications-you-cant-live-without/feed/</wfw:commentRss>
		</item>
		<item>
		<title>xkcd Wallpaper Randomiser Patch</title>
		<link>http://www.apathysketchpad.com/blog/2007/08/29/xkcd-wallpaper-randomiser-patch/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/08/29/xkcd-wallpaper-randomiser-patch/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 20:02:33 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Doodles And Cartoons]]></category>

		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/08/29/xkcd-wallpaper-randomiser-patch/</guid>
		<description><![CDATA[A bit ago, Randall changed the design of xkcd.com and in doing so very inconsiderately broke my xkcd Wallpaper Randomiser. Well, now I&#8217;ve updated it, so if you used to use it then you can download the new version and use it once more.
As before, the source code is available, so you can see just [...]]]></description>
			<content:encoded><![CDATA[<p>A bit ago, Randall changed the design of <a href="http://xkcd.com" target="_blank">xkcd.com</a> and in doing so very inconsiderately broke my xkcd Wallpaper Randomiser. Well, now I&#8217;ve updated it, so if you used to use it then you can download <a href="http://www.apathysketchpad.com/codefactory/code.php?id=xkcd" target="_blank">the new version</a> and use it once more.</p>
<p>As before, <a href="http://www.apathysketchpad.com/codefactory/code.php?id=xkcd-source" target="_blank">the source code</a> is available, so you can see just how little has changed and just how easily you could have done this yourselves, you lazy bottoms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/08/29/xkcd-wallpaper-randomiser-patch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Site Redesign</title>
		<link>http://www.apathysketchpad.com/blog/2007/06/14/site-redesign/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/06/14/site-redesign/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 22:57:19 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/06/14/site-redesign/</guid>
		<description><![CDATA[I&#8217;ve heard there&#8217;s a thing called &#8220;Web 2.0&#8243; and apparently it involves a lot of clever design work. I don&#8217;t know or care what exactly it is about &#8220;Web 2.0&#8243; that makes it better than, or even different to, the old thing (which presumably was &#8220;Web 1.x&#8221;), but either way it&#8217;s time I made my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard there&#8217;s a thing called &#8220;Web 2.0&#8243; and apparently it involves a lot of clever design work. I don&#8217;t know or care what exactly it is about &#8220;Web 2.0&#8243; that makes it better than, or even different to, the old thing (which presumably was &#8220;Web 1.x&#8221;), but either way it&#8217;s time I made my own WordPress skin for this site. So here is my design, which I&#8217;m rather pleased with:<span id="more-631"></span></p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/site-redesign.png" title="Site Redesign Plan"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/site-redesign.png" title="Site Redesign Plan"><img src="http://www.apathysketchpad.com/blog/wp-content/site-redesign.png" alt="Site Redesign Plan" /></a></p>
<p>As you can hopefully see, the categories list has been knocked on its side and the archives list has been collapsed into a little menu, accessed by either a category tab or a little tab on the right above the &#8220;recent posts&#8221; list. (I haven&#8217;t decided which yet.) This has rendered the left sidebar totally useless and so that has been removed, the search box having moved to the corner, where the site&#8217;s content meets itself, which is all in all I think the best possible spot for it. Also, I&#8217;ve lost the Facebook badge and replaced it with a Facebook link in More Of Me. Similarly, the &#8220;Meta&#8221; column (which has a stupid name, but that&#8217;s what WordPress calls it) has been put horizontally under the logo.</p>
<p>I was thinking a lightish grey for the background (where the &#8220;links&#8221; header is), and white for the main page background. The line down the left hand side that comments and titles go over would either be a narrow line, probably in blue, or the edge of a margin, which also may end up being blue but probably not as Manchester University like a blue bar there and I&#8217;m not branding my blog to resemble my employers. I thought the Google Reader and Other Pages &#8216;tabs&#8217; would be darker than the white Recent Posts tab.</p>
<p>I&#8217;ve done no coding at all on this, so I can&#8217;t tell you if or when it will go live, and it may have to change depending on what is actually possible, but for the time being, discussion is welcome in <a href="http://forum.apathysketchpad.com/display.php?type=thread&amp;id=25" target="_blank">the forum thread I made for the purpose</a>. (You won&#8217;t need a forum account to post there, but you can&#8217;t identify yourself without one, other than by writing your name somewhere within the post.) I&#8217;ve disabled comments to keep all the discussion in one place &#8212; I&#8217;d like to keep the blog comments for comments about the things in the blog and the blog itself rather than code and site design. If you have any comments, please let&#8217;s hear them. If anyone voices distaste after I do a redesign and they&#8217;ve not mentioned their concerns now then I shall be most annoyed.</p>
<p>Colours would be a good thing to suggest, because if I do them they&#8217;ll just end up all being blue again, as that&#8217;s all I can do. I&#8217;d like to get some pale yellows, and some earthy colours in, because I like the modern look they can give a website. I&#8217;d consider some dashed lines, too, as they seem to be popular these days, but other than the margin line on the left, I can&#8217;t think where they&#8217;d fit in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/06/14/site-redesign/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To Crack Captchas</title>
		<link>http://www.apathysketchpad.com/blog/2007/06/05/how-to-crack-captchas/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/06/05/how-to-crack-captchas/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 22:17:49 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/06/05/how-to-crack-captchas/</guid>
		<description><![CDATA[This page will teach you how to write a not-necessarily-very-good programme to beat some common captchas, but it will not provide any useful code to do so for you. It should give you an idea how to go about defeating captchas not listed here. But mostly, I hope it will be instructive for anyone who [...]]]></description>
			<content:encoded><![CDATA[<p><em>This page will teach you how to write a not-necessarily-very-good programme to beat some common captchas, but it will not provide any </em>useful<em> code to do so for you. It should give you an idea how to go about defeating captchas not listed here. But mostly, I hope it will be instructive for anyone who wants to write a less easily defeated captcha in the future, since apparently you&#8217;re all hopeless at it at the moment.</em></p>
<p>As everyone in the world knows by now, most websites and forums use &#8220;captchas&#8221; to try and stop computer programmes from posting fake comments containing adverts. &#8220;Captcha&#8221; stands for &#8220;Completely Automated Public Turing test to tell Computers and Humans Apart&#8221;. And as everyone in the world ought to have realised by now, they don&#8217;t work.</p>
<p>There exist a number of ways around them, the most cunning and most effective, although the most difficult to set up, is to build a pornographic website and get real humans to solve the captchas for you in exchange for naked pictures.</p>
<p>But mostly, they&#8217;re easy to get around because they&#8217;re shit. This, for example, is the default captcha that comes with the now obsolete phpbb2:</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/1.png" title="phpbb2 Captcha"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/1.png" title="phpbb2 Captcha"><img src="http://www.apathysketchpad.com/blog/wp-content/1.png" alt="phpbb2 Captcha" /></a></p>
<p>That is very easy to solve. (It should perhaps be pointed out at this stage that my job is in large part to extract shy information from images.) As with all the algorithms I&#8217;ll show you, this is the first and simplest one I could come up with, and it&#8217;s only the start. In all cases I will extract a binary mask of the letters for transferal to a more general OCR system. Also in all cases, I will use Matlab 6 to perform the analysis.<span id="more-618"></span></p>
<p>Here is the code required to make this captcha machine readable:</p>
<blockquote><p>function bank=solvefuzzy(bank)</p>
<p>[x y c n]=size(bank);</p>
<p><em>%First, greyscale the lot by taking the red channel</em><br />
bank=bank(:,:,1,:);</p>
<p><em>%Now blur it slightly.</em><br />
for (i=1:n)<br />
bank(:,:,1,i)=filter2(ones([3 3])/9, bank(:,:,1,i));<br />
end</p>
<p><em>%Now threshold it.</em><br />
bank=(bank&lt;0.63);</p>
<p><em>%Now trim the borders.</em><br />
bank(1:x,[1 y],:,:)=0;<br />
bank([1 x],1:y,:,:)=0;</p></blockquote>
<p>Here is the result of this algorithm on four example captchas:</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/fuzzy.png" title="phpbb2 cracked"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/fuzzy.png" title="phpbb2 cracked"><img src="http://www.apathysketchpad.com/blog/wp-content/fuzzy.png" alt="phpbb2 cracked" /></a></p>
<p>Now that wasn&#8217;t hard. And I know that the letter shapes aren&#8217;t ideal, but it&#8217;s a very uniform font they use, and the letters aren&#8217;t rotated, so it&#8217;s as easy as pie to extract the characters from this mask.</p>
<p>Of course, cracking obsolete captchas isn&#8217;t terribly useful, or wouldn&#8217;t be if anyone bothered to update their forums, so here&#8217;s a captcha from phpbb3:</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/11.png" title="phpbb3 classy"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/11.png" title="phpbb3 classy"><img src="http://www.apathysketchpad.com/blog/wp-content/11.png" alt="phpbb3 classy" /></a></p>
<p>The first thing you should notice about this is that it&#8217;s gorgeous. But let&#8217;s have a look at the code required to break it:</p>
<blockquote><p>function bank=solveclassy(bank)</p>
<p><em>%First, greyscale the whole thing</em><br />
bank=mean(bank,3);</p>
<p><em>%Now threshold it.</em><br />
bank=(bank&lt;0.55);</p></blockquote>
<p>That&#8217;s two commands. Now, let&#8217;s check the results.</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/classy.png" title="phpbb3 classy cracked"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/classy.png" title="phpbb3 classy cracked"><img src="http://www.apathysketchpad.com/blog/wp-content/classy.png" alt="phpbb3 classy cracked" /></a></p>
<p>So that&#8217;s done it perfectly, with no real image processing at all. Of course, this is a little unfair to the new captcha &#8212; it is in reality much tougher than phpbb2&#8217;s, because it uses many fonts and angles and sizes. So some kind of cunning would be required to turn these shapes back into characters, but that&#8217;s really nothing OCR software doesn&#8217;t do as a matter of course. And if you were to take each character individually (even if they overlap, the colours in the original image would distinguish them) and perform, say, a Radon transform on them about their centroids, this would give you a distinctive pattern for each letter and number in each font. The point is that from here it is entirely possibly to crack this captcha. Besides which, phpbb is open source, so training the process by Radon transforming all possible characters would be fairly simple.</p>
<p>But phpbb3 has another trick up its sleeve: a second type of captcha. This is the one used on <a href="http://www.phpbb3.com" target="_blank">www.phpbb3.com</a>&#8217;s forum, so presumably they trust it:</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/13.png" title="phpbb3 funky"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/13.png" title="phpbb3 funky"><img src="http://www.apathysketchpad.com/blog/wp-content/13.png" alt="phpbb3 funky" /></a></p>
<p>Aside from the fact that it looks like something from a bad Spectrum game, the first thing you should notice about this is that it has clearly been designed to be almost impossible to crack, by someone who knows nothing about cracking captchas. For example, the uniform background colour. Well over 90% of the image is a single colour and every pixel of every letter is that colour. Then, the individual letters are outlined in distinct and uniform colours, and then, as if that wasn&#8217;t helpful enough for crackers, the characters are made up of little square elements (which I will call &#8216;charels&#8217;), so we can reconstruct the characters down to the pixel, generally the right way up. It really couldn&#8217;t be more helpful if it tried.</p>
<p>So let&#8217;s see some code.</p>
<blockquote><p>function result=solvefunky(bank);</p>
<p>[x y c n]=size(bank);<br />
result=zeros([x,y,1,n]);</p>
<p><em>%First, determine that background colours.<br />
%We assume the first colour with five continuous pixels of itself<br />
%along the first row is background.</em><br />
background=zeros(3,n);<br />
for (i=1:n)<br />
colour=[0 0 0];<br />
j=1;<br />
count=0;<br />
while (count&lt;5)<br />
if ((bank(1, j, 1, i)==colour(1)) &amp;&amp; &#8230;<br />
(bank(1, j, 2, i)==colour(2)) &amp;&amp; &#8230;<br />
(bank(1, j, 3, i)==colour(3)))<br />
count=count+1;<br />
else<br />
colour(:)=bank(1,y,:,i);<br />
end<br />
end<br />
background(:,i)=colour(:);</p>
<p><em>%Next, find areas that are that colour</em><br />
backgroundareas(:,:,i)=((bank(:,:,1,i)==background(1,i)) &amp; &#8230;<br />
(bank(:,:,2,i)==background(2,i)) &amp; &#8230;<br />
(bank(:,:,3,i)==background(3,i)));</p>
<p><em>%Now, find areas of that colour smaller than 15 pixels</em><br />
temp=bwlabel(backgroundareas(:,:,i), 4);<br />
small=zeros([x,y]);<br />
numberofregions=max(temp(:));<br />
for (region=1:numberofregions)<br />
pixels=sum(temp(:)==region);<br />
if (pixels&lt;15)<br />
thisarea=temp==region;<br />
<em>%This leaves a lot of bits which aren&#8217;treal, but we know from<br />
%looking at the captcha that the letters are outlined in just<br />
%one colour, so lets eliminate anything that&#8217;s got more than<br />
%one colour adjacent to it. (In fact, we allow one pixel of a<br />
%different colour as this works better.)</em><br />
adjacentpixels=(imdilate(thisarea, [0 1 0;1 1 1;0 1 0])&amp;~thisarea);<br />
red=bank(:,:,1,i); green=bank(:,:,2,i); blue=bank(:,:,3,i);<br />
ar=red(adjacentpixels); ag=green(adjacentpixels); ab=blue(adjacentpixels);<br />
if ((sum((ar~=ar(1)))&lt;2) &amp;&amp; &#8230;<br />
(sum((ag~=ag(1)))&lt;2) &amp;&amp; &#8230;<br />
(sum((ab~=ab(1)))&lt;2))<br />
small=small|thisarea;<br />
end<br />
end<br />
end<br />
result(:,:,1,i)=small(:,:);</p>
<p>end</p></blockquote>
<p>That results in this rather pleasing image:</p>
<p><a href="http://www.apathysketchpad.com/blog/wp-content/funky.png" title="phpbb3 funky crached"></a></p>
<p style="text-align: center"><a href="http://www.apathysketchpad.com/blog/wp-content/funky.png" title="phpbb3 funky crached"><img src="http://www.apathysketchpad.com/blog/wp-content/funky.png" alt="phpbb3 funky crached" /></a></p>
<p>Now all I&#8217;ve done here is to find the pixels that are part of the larger &#8220;charels&#8221; which comprise the message. There&#8217;s still a lot of work to be done to find the message in ASCII format, but it can be done: you can separate the individual characters by recourse to the original image &#8212; each one is outlined in a distinctive colour, and if a colour is reused then it probably isn&#8217;t reused in adjacent characters, so a simple contiguity test will catch it; you can reorient and rescale each character by picking a charel arbitrarily and seeing where its neighbours lie relative to it, using the provided coloured outline as a guide  and the &#8217;shadow&#8217; colour to define the vertical and/or horizontal axes &#8212; this will allow you to build up a reoriented image of each letter, which can be easily checked against the known font to see which it most closely matches.</p>
<p>Those of you who know me should already have worked out that <em>this</em> took me less than one evening, including grabbing all the pictures and writing this entry. I wouldn&#8217;t bother if it was going to take longer. You know that. So if you employed a good programmer for a week to crack such a captcha you ought to be able to finish the job off. Then you&#8217;d have access to every phpbb3 forum out there.</p>
<p>Clearly there are false positives and things in these processed images: the bottom one in particular has a large false positive in the Z, and the last H has a bit missing where the L overlapped it. I don&#8217;t think either of these would actually affect a good OCR algorithm (given that said algorithm would have the font used built into it and have an ideally oriented and scaled image of the letters, albeit with the odd mistake), and even if it did, well, we cracked the other three. If we assume we can crack 75% of these captchas, then we can break into a forum which allows us 5 attempts (which is pretty standard) 99.9% of the time.</p>
<p>phpbb3 <a href="http://belloman.rctgo.com/2006/06/28/phpbb3-admin-control-panel/" target="_blank">also allows the user an almost ludicrous amount of options for their captcha</a>. This is good, as it means that a cracker will have a harder time beating the captcha <em>in the general case</em>. But in the specific case of the default settings, which almost everyone will use, this won&#8217;t help at all.</p>
<p>So what&#8217;s the solution? Personally, I use a bespoke text-based captcha. Image based ones are hard to programme, which isn&#8217;t a problem if you&#8217;re doing something like phpbb, because it has to be hard to crack (oh dear) and text based ones really aren&#8217;t. Another problem with image-based solutions is that some devices or people can&#8217;t read them, so there usually has to be a fallback, and then you have two links, of which a cracker need only outsmart the weakest. (Sorry for the mixed metaphor there.) I think bespoke text-based is good because there&#8217;s no really motivation for a cracker to devote any time to cracking it, as they&#8217;ll only get access to my websites, and if they do I can very easily change it the following evening.  But it couldn&#8217;t work for phpbb as you can&#8217;t make a bespoke captcha for every user.</p>
<p>Some captchas are obfuscated further than these. Sometimes this is a simple case of drawing lines over and through the text. This is pretty easy to beat &#8212; any good photo touching-up software has had this feature since the week after flatbed scanners were invented, and replicating it is not hard, even when the lines must be found automatically. A better solution is to deform the letters themselves, though this involves a very direct tradeoff: anything you do that makes letter shapes harder for a computer to identify will have the same effect for your legitimate users. Again, I would attack such a captcha by not attempting to restore the original image, but by developing an algorithm to characterise each&#8230; well, <em>character</em> based on its Euler number, the number of sharp corners in its outline and their relative locations, and maybe the Euler number of the shape you get if you dilate it a bit. I believe this could crack such a captcha with minimal training.</p>
<p>Theoretically, human authentication is the best way, but humans aren&#8217;t apparently very good at that. It&#8217;s not always apparent from a name and an email address if a user is a human or a spambot. My proposed solution is a deliberately impossible captcha: you find or create an image, possible of random abstract &#8216;art&#8217;, or a landscape, or a sort of randomly generated Rorschach ink-blot test, and ask the user for a vague, one sentence description. Then a human would authenticate the user&#8217;s account by seeing if the user&#8217;s description of the image relates to that image in any way. It&#8217;d be a little subjective, but I really can&#8217;t see it being cracked, except perhaps be Derren Brown concocting a sentence that would appear to describe any image. And people would learn to spot that sentence. It would still be susceptible to the porn crack, but then everything is, and honestly I think it&#8217;d be fairly easy to tell which descriptions of Rorschach ink-blots had come from the minds of teenage boys looking for naked pictures with a pretty high degree of certainty.</p>
<p>Plus, I think it&#8217;d offer a fascinating glimpse into the psyche of all prospective users of your forum.</p>
<p><em>You can download all the above code, and some general making-it-work gubbins <a href="http://www.apathysketchpad.com/codefactory/code.php?id=captchas" target="_blank">in the Code Factory</a>, but you&#8217;ll need Matlab to make it work, and you&#8217;ll need the Image Processing Studio, to make it run. If anyone wants to extend the code, do feel free. Complete code is available if you want it, though &#8212; people sell it to prospective spammers. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/06/05/how-to-crack-captchas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fullscreen Colour Tools</title>
		<link>http://www.apathysketchpad.com/blog/2007/04/15/fullscreen-colour-tools/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/04/15/fullscreen-colour-tools/#comments</comments>
		<pubDate>Sun, 15 Apr 2007 14:59:27 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/04/15/fullscreen-colour-tools/</guid>
		<description><![CDATA[Today I uploaded some little gadgets I did a bit ago. They&#8217;re handy for some people, not so much for others. If you use a lot of images, they&#8217;ll probably be useful to you. They need .NET, mind.
]]></description>
			<content:encoded><![CDATA[<p>Today I uploaded <a href="http://www.apathysketchpad.com/codefactory/code.php?id=fullscreen" target="_blank">some little gadgets I did a bit ago</a>. They&#8217;re handy for some people, not so much for others. If you use a lot of images, they&#8217;ll probably be useful to you. They need .NET, mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/04/15/fullscreen-colour-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Forum in Beta Test</title>
		<link>http://www.apathysketchpad.com/blog/2007/03/29/new-forum-in-beta-test/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/03/29/new-forum-in-beta-test/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 10:55:27 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/03/29/new-forum-in-beta-test/</guid>
		<description><![CDATA[I have, of late, been writing my own forum script, which I intend to use on this site and am considering releasing as open-source because I&#8217;m not selfish. So as such, the new forum is now officially open at http://forum.apathysketchpad.com.
It features no admin panel, because they&#8217;re too easily hacked and in any case I prefer [...]]]></description>
			<content:encoded><![CDATA[<p>I have, of late, been writing my own forum script, which I intend to use on this site and am considering releasing as open-source because I&#8217;m not selfish. So as such, the new forum is now officially open at <a href="http://forum.apathysketchpad.com/">http://forum.apathysketchpad.com</a>.</p>
<p>It features no admin panel, because they&#8217;re too easily hacked and in any case I prefer to hack the database in PHPMyAdmin and hack the behaviour in the PHP files, so I&#8217;ve made all the code as readable and abstracted as I could to make this easier. It also features fully native support for all kinds of cunning levels of sticky threads, closed threads and Anarchy Boards that just aren&#8217;t possible in most forum scripts. It&#8217;s based heavily on the CMS I made for <a href="http://www.realvg.org" target="_blank">RealVG</a>, and it takes a very different approach to most forum scripts, not least because I don&#8217;t see the point in spending a lot of time producing something that already exists. It&#8217;s very well suited to small site run by people who know their way around PHP (such as this one), but less well suited to large sites with many staff members (as they&#8217;d all need FTP and PHPMyAdmin access to administer it) or sites run by people who don&#8217;t know their way around a web server (because they&#8217;ll not be able to set it up, not least because there&#8217;s no installer at the moment). Since it has no admin panel, no session IDs (cookies are required), and checks your password on every page, it is, as far as I know, totally secure. I&#8217;ve little doubt there&#8217;ll be a hole in there somewhere, but keeping things simple and well abstracted is always the best way to keep them secure, and I think I&#8217;ve done that fairly well.</p>
<p>Other features I intend to add are email thread subscriptions, <a href="http://www.facebook.com" target="_blank">Facebook</a> style user &#8220;walls&#8221; and the ability to email users who say they don&#8217;t mind (but not private messages because I don&#8217;t see the point), and some kind of file attachment system. And a &#8220;forgot my password&#8221; link, because they&#8217;re always useful. Also there are a lot of extra fields like &#8220;edited by&#8221; links that will need adding to the skin.</p>
<p>So feel free to register and post there, but do bear in mind that me and Testing Jeff will just spam mercilessly until the beta is over. And feel free also to request features and report bugs &#8212; that&#8217;s what beta is for. Such reports should be in my email inbox, comments on this post, or in <a href="http://forum.apathysketchpad.com/display.php?type=forum&amp;id=5">the special beta test subforum</a>.</p>
<p>The old forum will stay where it is indefinitely, though it won&#8217;t be reopened (for the forseeable future). I&#8217;ll update the various links later, and possibly put a notice on the old forum explaining where the new one is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/03/29/new-forum-in-beta-test/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PhpBB Is A Piece Of Shit</title>
		<link>http://www.apathysketchpad.com/blog/2007/03/23/phpbb-is-a-piece-of-shit/</link>
		<comments>http://www.apathysketchpad.com/blog/2007/03/23/phpbb-is-a-piece-of-shit/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 23:31:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[Internet]]></category>

		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://www.apathysketchpad.com/blog/2007/03/23/phpbb-is-a-piece-of-shit/</guid>
		<description><![CDATA[There. I&#8217;ve said it.
Reason being, my phpBB forum keeps getting hacked, by morons no less, because it features the world most insecure admin panel. I don&#8217;t know if you&#8217;ve ever clicked the &#8220;administration panel&#8221; link at the bottom of a phpBB forum. It&#8217;s a tiny link at the bottom of pages which is only displayed [...]]]></description>
			<content:encoded><![CDATA[<p>There. I&#8217;ve said it.</p>
<p>Reason being, my <a href="http://www.phpbb.com" target="_blank">phpBB</a> forum keeps getting hacked, by morons no less, because it features the world most insecure admin panel. I don&#8217;t know if you&#8217;ve ever clicked the &#8220;administration panel&#8221; link at the bottom of a phpBB forum. It&#8217;s a tiny link at the bottom of pages which is only displayed to administrators and anyone else who wants to see it badly enough. When you click it, a large button appears saying &#8220;please don&#8217;t click here if you are a hacker&#8221;, and clicking it automatically takes you to the admin page. The admin page has three options: ban users, change the kind of captcha you use, and change the index page to say &#8220;Joo hav been hacked by Captain Awesome&#8217;s CyberDweeb Klan&#8221; and play shitty music. I understand phpBB employ people specially to compose this music.</p>
<p>Whatever the reasons behind this insane design philosophy, the result is that phpBB is a total chunk of crap. So what I&#8217;m doing is writing my own forum script. My forum script is better than phpBB. Sure, I&#8217;ve not added any way for users to register, so I&#8217;m the only person who can post, but that&#8217;s one better than phpBB, since I&#8217;ve had to take away phpBB&#8217;s access to my database, so even I can&#8217;t post there without doing it via PhpMyAdmin. Secondly, it is impossible to hack the admin panel on my forum script, because <em>it hasn&#8217;t got one</em>. Nor does it have a moderator&#8217;s panel that can delete all the threads at once. That&#8217;s just asking for trouble in my opinion. And you don&#8217;t need these things. At least, I don&#8217;t.</p>
<p>phpBB is, I think aimed at people who want a cheap forum for their website and want to have a team of moderators and admins watching over it and doing handy things. Mine isn&#8217;t. Mine is aimed squarely at me. It does things my way. If you want to change the look, you change the PHP files. If you want to edit the forum list, you use PhpMyAdmin. If you want to ban a user, PhpMyAdmin. If you want to delete a load of threads at once, PhpMyAdmin.</p>
<p>It&#8217;s a much better system. It&#8217;s more flexible than phpBB&#8217;s mod controls (which are useless at best) and it&#8217;s infinitely more secure. Once it&#8217;s up and running, my new forum will be at forum.apathysketchpad.com. Well, it&#8217;s up there now but it&#8217;s nothing but meaningless testing banter at the moment, so there&#8217;s little point in looking at it (though I&#8217;ve no doubt someone will).</p>
<p>I don&#8217;t really understand phpBB. I&#8217;ve looked at the source and it&#8217;s crazy. The database is split across a hundred things; they take away your RegExp and give you a rubbish asterisk system, which the code then turns back into RegExp. The posts are stored across two tables. The whole thing is just madness in a jar.</p>
<p>So I&#8217;m doing it myself. Honestly, it seems like the only way sometimes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apathysketchpad.com/blog/2007/03/23/phpbb-is-a-piece-of-shit/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
