Giter VIP home page Giter VIP logo

hcaptcha's Introduction

What is Captcha

CAPTCHA is an acronym for "Completely Automatic Public Turing Test to Tell Computers and Humans Apart". It is a task, that human can easily solve, but computer not.

It is used as a challenge-response to ensure that the individual submitting information is a human and not an automated process. Typically, a captcha is used with form submissions where authenticated users are not necessary, but you want to prevent spam submissions.

What is Hooto Captcha

hcaptcha is a free, easy-to-use WebService helps enterprises to integrate Captcha into their own business systems. Similar to Google reCaptcha but can be customized and deployment to your private network.

Features

  • High Security: using the distorted, bonding, dislocation and random word length, making it difficult to be dismantled, recognition by machine
  • High Performance: Based on C/libevent/libgd/memcached, all levels of optimization, upto 500 Requests pre second in single-threaded (120x60 pixels)
  • Local Deployment: Similar to Google reCaptcha but can deployment to private network
  • Cluster Deployment: Support for large-scale network deployment LVS -> Hooto Captcha Cluster -> Memcached Cluster

Example

s4

Architecture Design

LVS -> Hooto Captcha Cluster -> Memcached Cluster

Install

Debian 6.x

apt-get install gcc g++ libgd2-xpm-dev libevent-dev libmemcached-dev memcached git

CentOS 5.x/6.x

yum install gcc gcc-c++ gd-devel libevent-devel libmemcached-devel memcached git

Download/Make

git clone git://github.com/eryx/hcaptcha.git
cd hcaptcha
make
make insall

Start Server

/opt/hcaptcha/bin/hcaptchad -c /opt/hcaptcha/etc/hcaptchad.conf
Start hcaptcha/1.0.4 [OK]

Stop Server

killall hcaptchad
Signal(15) Stop hcaptcha/1.0.4 [OK]

Confirm the successful installation

http://127.0.0.1:9527/hcaptcha/api/image?hcaptcha_token=123&hcaptcha_opt=refresh

WebService API

Display a CAPTCHA image

hcaptcha_token (required) The random token created by client,
Example: hcaptcha_token=abc123
hcaptcha_opt (optional) Reload a new CAPTCHA image,
Example: hcaptcha_opt=refresh
  • API Response

    Content-Type:image/png binary data...

Verifying the User's Answer

After your page is successfully displaying CAPTCHA image, you need to configure your form to check whether the answers entered by the users are correct.

hcaptcha_token (required) required. The random token created by client
hcaptcha_word (required) The User's Answer
  • API Response
    The response from verify is a series of strings separated by "\n".
    To read the string, split the line and read each field.
Line 1 "true" or "false".
True if the CAPTCHA was successful
Line 2 if Line 1 is false,
then this string will be an error code. CAPTCHA can display the error to the user/client

Error Code Reference

hcaptcha currently returns the following error codes:

incorrect-hcaptcha-word the user's answer was incorrect
invalid-request the parameters of the verify was incorrect
hcaptcha-not-reachable the hcaptcha service unavailable
Example
false
incorrect-captcha-word

Demo

http://ws.hooto.com/hcaptcha/api/image?hcaptcha_token=123&hcaptcha_opt=refresh

Reference

hcaptcha's People

Contributors

eryx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.