Giter VIP home page Giter VIP logo

purecaptcha's Introduction

PureCaptcha

OWASP PureCaptcha project aims to help developers use easy-to-user independent CAPTCHAs in their project with zero hassle. Traditionally, using CAPTCHAs required making accounts in a third party provider and using rigorous APIs, or installing many libraries and then using text rendering and image modification libraries to render a CAPTCHA image.

PureCaptcha on the other hand, aims to do all of the above in one step. It includes very simple code to render a few ASCII characters into bitmap images, and code to modify, scale, rotate and distort simple bitmap images. It then outputs the CAPTCHA as a simple monochrome BMP image (which has a very small size).

It also provides example usages for CAPTCHAs. It is of utmost importance to properly use CAPTCHAs, otherwise side-channel and logical attacks would be viable on the system.

Read more about OWASP PureCaptcha at https://www.owasp.org/index.php/OWASP_PureCaptcha

##Usage##

Basic usage

Use the following script as the source of the captcha image.

require_once "purecaptcha.php";

$pureCaptcha = new PureCaptcha();

$captcha = $pureCaptcha->show();

Store $captcha in the session and compare it user input later.

Complete API

captcha : The text to be displayed in captcha length : The length of the captcha text

spacing : The spacing between two characters in the captcha

degree : The degree of rotation of captcha text in clockwise direcion

scaleX : Amount to be scaled in x direction

scaleY : Amount to be scaled in y direction

noisePercent : The noise percentage

// Getters and setters are provided for each
$pureCaptcha->setCaptcha("M2H7");
$captha = $pureCaptcha->getCaptcha();

purecaptcha's People

Contributors

abiusx avatar dhavalkapil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.