Math CAPTCHAs

Blog

A few years ago, when I was sitting at my moving sale, I came up with some crazy variations on the basic word/letter based CAPTCHA for my senior project, SHUGamer.com.  Most of the ideas I had were either impossible to implement or difficult to answer.  I eventually decided to implement a system based on a simple mathematical problem converted into a word problem:

If you have two apples in one hand and three oranges in the other, how many fruit do you have total? 

This way, the number of variations would be very difficult (never impossible) for a bot to automate.  Because of the difficulty in translation (natural language processing), there wouldn’t be a heavy need for warping (annoying to a user).  The chances of guessing a correct answer are ~1/100 (not terrible odds, but decently bad for a bot).  Finally, the problem would have a clear answer (not trying to guess if it’s a 0 or a O) leaving less room for human error.  The resulting image looks like this:

CAPTCHA Example

This implementation isn’t perfect (nothing ever is), but it was a fun experience to build and can be easily added to any PHP based website.

PHP Mathematical CAPTCHA Class

Just so you know, SHUGamer.com and the later AreYouAG33k.com heavily relied on Adobe Flash, so visually disabled users wouldn’t be able to fully experience the site (sorry).  This meant I didn’t need to implement an audible option for the CAPTCHA.

No Comments

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



  • Donate

    If my work has helped you and you want to return the favor, you could purchase something for me from my Amazon Wish List or send me a donation via PayPal.

  • License

    Unless otherwise noted, all source code and compiled files published on this website are released under the terms of the GNU Lesser General Public License.