P is for Practical | |
PerlMonks |
Re: howto: Perl CGI, image with random scewed text for account creationsby jettero (Monsignor) |
on Mar 12, 2007 at 00:53 UTC ( [id://604267]=note: print w/replies, xml ) | Need Help?? |
I have no idea how to do the audio except via festival or something like that. I have in the past used a machine for generating random weak captchas that make my sites too much effort to bother with — since there's never actually anything of value for the bot to do, banning URLs and things as necessary.
In general the captchas are all something the jerks can get past if they try hard, so it's best to plan on being in an arms race. First of all, I don't want to store anything, so I make the thing parse the CGI args into a hash, which includes some secret part — that I'm sure they could figure out if they spent the effort, but I could always change it.
I use GD and GD::Text::Align to draw things, and I use Math::Trig for various angle calculations. The code is all a bit sloppy, as it grew rather organically, but it technically functions. This captcha, where I rotate, resize and translate one font is considered very weak. The random circles sometimes make it impossible for humans to read as well, so I also have a js onClick event to reload the image (thus re-randomizing its rendering).
Of course, I left out many of the functions, but I suspect their names are clear enough to indicate their purpose. -Paul
In Section
Seekers of Perl Wisdom
|
|