Results 1 to 5 of 5

Thread: [RESOLVED] Random IMG/Code generator

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [RESOLVED] Random IMG/Code generator

    Hi,
    I was wondering how this is done, you know sites that require you to login and next to the login requires you to copy some security code from an image that the site generated in order to stop spiders/auto password crackers busting your site.?
    i.e
    https://secure.overture.com/s/dtc/center/?mkt=us

    if you refresh the page a different image is generated.

    Is this done serverside and how?

    I think something along the lines of generate a random string - stire in a variable - somehow generate image containing string - then on submit compare entered value to variable.

    It is known as CAPTCHA.

    I am looking at ASP>Net implementation now.

    Good article found
    http://www.15seconds.com/issue/040203.htm

    Any other tutorials feel free to post.
    Last edited by FishGuy; Mar 1st, 2006 at 10:35 AM.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Random IMG/Code generator

    We used PHP (yes, server side always) to generate a random string, written on to a new image using the GD image library functions. A few overlayed translucent circles in the background to fool OCR scanners. there are a couple of ways to store the string to validate against, we used a session variable but I was also considering storing an MD5 hash of the string as a hidden form element and then MD5'ing the user's input and comparing.

    Can't help you with ASP but if you are considering PHP I can give you the class we used.

  3. #3
    New Member
    Join Date
    Nov 2006
    Posts
    1

    Re: [RESOLVED] Random IMG/Code generator

    I was wondering how this is done, you know sites that require you to login and next to the login requires you to copy some security code from an image that the site generated in order to stop spiders/auto password crackers busting your site.?
    You might check out HTMLCaptcha, a .NET assembly I am preparing to release. HTMLCaptcha outputs a small icon-sized image -- a real picture, not skewed text -- created entirely in HTML/CSS, and then offers a random selection of choices that best describe the image. The user must select the correct descriptor in order to validate.

    It's currently in Beta, but the demo version can be downloaded from

    http://www.htmlcaptcha.com

    The help documentation is included with the demo, along with samples in C#/VB.NET, and should help in understanding, in general, the way CAPTCHA is generated.

    One of the unique things about HTMLCaptcha is that no images have to be created and saved. The output is pure HTML/CSS, so can be inserted directly into the web page.

    JA

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [RESOLVED] Random IMG/Code generator

    Quote Originally Posted by penagate
    but I was also considering storing an MD5 hash of the string as a hidden form element and then MD5'ing the user's input and comparing.
    Well, good thing you didn't. Breaking that is as simple as replacing the MD5 you put in the hidden with the one of whatever was entered.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Random IMG/Code generator

    What a stupid idea. I must have been drunk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width