Captchas in Java
CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". A CAPTCHA typically takes the form of an image containing distorted letters and/or numbers and is often used on web sites where it is important to determine whether the user is a real person or a computer program. CAPTCHA's have some drawbacks such as the lack of accessibility for the visually impaired, high CPU usage, and possible circumvention techniques. In many cases, however, CAPTCHA's can help mitigate certain types of attacks launched by malicious individuals using automated tools. At a minimum they can raise the bar enough to deter a casual attacker.
JCaptcha is a Java implementation of captcha technology developed by Marc Antoine Garrigue and released as open source. JCaptcha provides Java programmers with a framework and toolset for deploying CAPTCHA's in their web applications. You can download the full package that includes JARs, API documentation, and source code from SourceForge. The latest release of JCaptcha (1.0) is available under the GNU General Public License, but later releases will be under the LGPL license.
SimpleCaptcha is another framework that provides Java programmers with the ability to easily add a CAPTCHA to their web applications. A number of default CAPTCHA servlets are provided, including a Chinese version. The visual representation of the CAPTCHA text can be altered using a number of filtering methods, but SimpleCaptcha does not provide an audio CAPTCHA, which limits its accessibility for the visually impaired.
- SimpleCaptcha Example: J2EE Sample