'SimpleCaptcha' Echo Component

SimpleCaptcha implements a CAPTCHA implementation in client side JavaScript using a dictionary of of 191 short words. If the browser supports the 'canvas' tag, this tag is used to create a graphic containing the hidden word. Most modern browsers support this tag. However,Windows Internet Explorer does not. In this case, a pre-made image is used but it's reference is exposed in the 'src' attribute of the CATPTCHA 'img' tag.

This Echo component can be used from the server side. In this case, any short word can be sent from the server. Once again, if the browser does not support the 'canvas' tag a word from the built-in dictionary is used along with it's pre-made JPEG CAPTCHA image. The client will update the server as to which word was choosen in this case.

CAPTCHA is considered to be a 'glass shield' type of security. It can be used to impede attacks but can be easily broken manually, programatically, or with image processing software. This implementation is particulary vunerable because all of the source code is exposed on the client side.

Original implementation by Jonathan Feaster, http://www.archreality.com/jcap/

The SimpleCaptcha component is not part of the Informagen Echo Components becuase of it size and is offered separately.

Maven Dependecy

Use a Maven2 dependency; use the 'Informagen' repository.

    <dependency>
      <groupId>informagen.echo</groupId>
      <artifactId>informagen-echo-simplecaptcha</artifactId>
      <version>1.0.0</version>
    </dependency>
        

Or download the Java Archive (JAR)

Source Code Browser

Download, ZIP, 680kb

Demonstration

Enter the string hidden in the image and press return. Reload the page for a new CAPTCHA image or change the state of the 'Use JPEG Images' checkbox.

SimpleCaptcha - Summary API

                   
    package org.informagen.echo.app;

    import nextapp.echo.app.Component;    

    public class SimpleCaptcha extends Component  {

        public SimpleCaptcha()
        public SimpleCaptcha(String initialValue)

        public void setHeight(Extent newValue)
        public Extent getHeight()

        public void setWidth(Extent newValue)
        public Extent getWidth()

        public void setUseImages(boolean useImages)      
        public boolean getUseImages()

        public String getString()
        public void setString(String string)

        public void nextString()