Jump to content

Captcha Secure?


unidox

Recommended Posts

Just wondering if this is to simple? Can this easily be bypassed? How can I improve it? Thanks

 

function captcha() {
$rand = rand(1,15);
$rand2 = rand(1,15);
$math = array("+", "-");
if ($rand < $rand2) {
	$math = "+";
} else {
	$math = array_rand($math);
}

if ($math == "+") {
	$_SESSION['captcha'] = $rand + $rand2;
	return $rand . " " . $math . " " . $rand2;
} else {
	$_SESSION['captcha'] = $rand - $rand2;
	return $rand . " " . $math . " " . $rand2;
}
}

Link to comment
Share on other sites

The point behind CAPTCHA is that is asks something that a bot would not understand.  It a simple state, it asks numbers/letters on an image and tells you to enter them.  What you're doing is displaying numbers it seems.  Those can be captured and read easily by an OCR, or any script that can read a string at a certain location.  That is why they put the letters/numbers into images, so they can't be read as easily.

 

So, technically, no.  Ask yourself if your site is popular enough to get many bots.  And possibly do something that says "Check the third box in order to continue"  and have 3 check boxes, and make the "third" random.  That would be harder for a bot to manipulate.  and you could also make "third" change text to "box number 3" etc so they couldn't guess what you would ask as easily.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.