Re: Going from simple to super CAPTCHA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2007-06-10 at 12:27 +0900, Dave M G wrote: 
> PHP General List,
> 
> With a little help from the web, and help from this list, I have a 
> simple CAPTCHA image that works within the content system I'm building.
> 
> But it's *really* simple. Basically white text on a black background, 
> with a couple of white lines to obscure the text a little.
> 
> I'm pretty sure that in its current state, my CAPTCHA image could be 
> cracked by OCR software from the 1950s.

You're probably right :)

> So I'm hoping to take it up to the next level.
> 
> I might be able to figure out how to add more lines, more colours, and 
> those kind of basic changes.
> 
> But what I definitely can't comprehend is how some CAPTCHAs have that 
> really warped and distorted text.

They do x,y shifting, blurring, and various other techniques.

> Is that possible with PHP? Do I have to make a library of pre-warped 
> text images or something?

No, PHP can do it. If you can work with pixels (and you can) then you
can do any advanced mutation of an image... the only issue is how long
it takes to perform the mutations.

> Is it possible to make backgrounds that are really crazy with textures 
> and gradients. Would that also rely on a pre-built library of images?

It can rely on a pre-built library of images (I recently integrated
freecap into a website that uses this technique (amongst others) for
generating the background). It can also be done programmatically
(fractals would be a good example).

> Can someone maybe point me to an online instructional on how to get a 
> CAPTCHA image that really works?

Check out the freecap code perhaps (my eyes, my eyes, the code is
hideous). Check out other CAPTCHA scripts also. Learn from the
techniques they've employed, then roll your own if you still want to
create your own master CAPTCHA system :)

> Tips on what differentiates a good CAPTCHA from a bad one would also be 
> really sweet.

Good CAPTCHA - bots can't figure it out
Bad CAPCTHA  - bots can figure it out

;)

For what it's worth, and my experience with OCR is limited, the main
idea is to make it difficult to determine the characters by thwarting
edge detection and statistical models of pattern colour distribution.
Also keep in mind that you want people to be able to understand it. The
freecap system made some really unintelligible CAPTCHAS until I tweaked
the settings. Additionally many characters looked like many others when
morphed so I pared down the possible characters to less ambiguous
possibilities.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux