Visual captcha: Fighting blog spam

In the recent times my blog has been attacked by spammers and it's really annoying to delete 20-50 comments each day. I internally used Aksimet and some JavaScript tricks in hope that this would fight more spammers, but it didn't.

To solve this problem I wanted to use a captcha, but to make it more fun I wanted the captcha to be visual. After some looking around, I could not find this, so I implemented it myself.

The idea and implementation is:

  • The user is presented with 6 pictures, 5 bird pictures and 1 cat picture
  • The user has to pick the cat picture
  • Flickr is used for finding random pictures
  • The general idea isn't mine, but from Microsoft research's Asirra project

The new captcha system is live on the blog, try to post a comment to see it in action.

Screenshot

Visual Capatcha

Source code

Here is the code:

Feel free to port this code to other frameworks and other languages. The code is a bit unclean as I have copy-pasted it directly from Skeletonz.

Todo:

  • Add more picture randomness, it would be easy to crack this captcha if one knew which Flickr pages it fetched
  • Implement this as a library that can be used
25. Aug 2008 Announcements · Code · Interesting · Skeletonz · Tips
© Amir Salihefendic