Wednesday, March 20, 2013

CAPTCHA.js, a javascript client-side CAPTCHA implementation using HTML5 Canvas

Example CAPTCHAHere is a simple Javascript library that implements a CAPTCHA using purely client-side code. It is meant as a demonstration of using a canvas element to perform text and spline based rendering, and is not meant as a secure CAPTCHA solution.
Using this library, when you create a CAPTCHA instance you can specify a function to call when the CAPTCHA is solved correctly, which could perform whatever action you required - post back to the server, redirect to another page, enable processing of further requests, etc.
Tested OK in Firefox 18 and Chrome 25.
I shall add some more detail to this blog post when I can, but for now here are the goodies…
Here is a demo of this library, click on “Result” below or click here: http://jsfiddle.net/mErjT/2/embedded/result/

Here is the code: https://gist.github.com/SneakyBrian/5209271