Captchas in Rails

Hello Everyone,

I was wondering what people on this list were using to generate captchas
within forms on sites they are developing? I know there is a ruby gem
named
captcha, but I have seen some others floating around as well.

Thanks,
Andrew

On Sat Jul 01, 2006 at 01:58:16PM -0500, Andrew . wrote:

Hello Everyone,

I was wondering what people on this list were using to generate captchas
within forms on sites they are developing? I know there is a ruby gem named
captcha, but I have seen some others floating around as well.

it should be easy to integrate one of the existing things. but i’ll drop
in my $0.02 and say that captchas (those squiggly image things that you
have to type when submitting forms anonymously) are annoying and
unnecessary.

captcha-free and spam-free:
create an ‘approved’ field on the data model.
set approved = 1 if the user is registered
set approved = 1 if the user is anonymous and the text fields do not
.match(/(href|http|on(click|mouseover))/) (spammers dont bother if they
can’t leave a link)

in the rare event that an anonymous user wants to leave a web link, and
you dont want to sift thru the unapproved pile of poker and cialis ads,
you could create a random hidden element in the page, and have a trivial
javascript send back some data from it as a key, eg the name and an
attribute concatenated together and rot13’d or whatever. this way if
they have javascript enabled (most likely) their comment will get
through, where as a spammer is not going to take the time to reverse
engineer your javascript…

Andrew . wrote:

Hello Everyone,

I was wondering what people on this list were using to generate captchas
within forms on sites they are developing? I know there is a ruby gem
named
captcha, but I have seen some others floating around as well.

Thanks,
Andrew

Capthcha’s are not difficult, I have PHP background and had built a
system for one of our clients, using GD.

when I required on my site i just looked around, as my hosting company
was offering imagemagick, i went in for rmagick.

you need to build your logic using, sessions or hidden form element and
captcha validated against some db.

generating image is fun, put in your captcha text, you can use math
functions like ellipse circles, rectangles etc with different colours
and maybe some imageprocessing filter. google and some other sites are
obsessed with rotating and distorting, if you plan to generate
dynamically, those can take more processing and can be slow.

suggestions

  1. make sure your captchas remain readable to humans,
  2. avoid similar looking text entries 1 ,l, 0,O, 5, S
  3. you can try different font schemes,
  4. also remember some people are color blind and
  5. some colours look different on CRT monitors and LCD screens, so good
    contrasting colors are good

for larger sites you can pre-generate and store the id, text in a db and
use it.
this way you can use it on sites which dont have requisite libraries and
easier to port to other projects, languages

regards
A.Senthil N.
http://senthilnayagam.com