![]() |
|
A captcha is a way to determine human users from computers, and usually involves in image that is hard for computers to decode, but easy for humans to do so. More information on captcha's on captcha.net. I threw together a quick Captcha script in PHP for an upcoming project, and wasn't able to find any that would be sufficiently discouraging for someone to write a script to circumvent. I have a couple more ideas for different approaches, this is the first I came up with and relatively easy to implement. It does on occasion create an image that's too difficult to read and I'm not sure how well it will stand up to an attack, but I believe it will stand up better than many of the ones I've seen. Image recognition programs usually have a lot of problems stitching characters back together. I've thrown in some black noise as well to further complicate the job of finding characters in the image. To verify the user entered the correct input, simply compare what they entered with the session variable "captcha" ($_SESSION["captcha"]). It might also be a good idea to provide them a way to reload the image/page if they happen to get one they can't understand. Other possibly security measures might include limiting the number of failed attempts from a single IP, and limiting the number of reloads while looking for a "cleaner" image.
Static
--Unnamed-- If you are having difficulty making out the images above, click on it to load a new one. Blind or visually impaired users will not be able to use this page until I get audio feedback working, sorry! As with most captchas this will obviously cause problems with blind users. Workarounds include phoning to verify their account, or providing audio of the answer (again, look at the session variable to determine the audio to be generated). The audio should be randomly distorted enough to mess with audio recognition software, but still be understandable by humans. Regardless, you should indicate in the ALT text of your image that this is a set of random characters, so that blind users will at least know what's going on, even if they can't get past it. This script is free for your use, but since it's still being developed I'm not posting a zip here yet. Let me know if you would like to have a copy and I'll email it to you.
|
|||
|
|