Captcha A Study AND Implementation
Captcha A Study AND Implementation
CAPTCHA
A
STUDY
AND
IMPLEMENTATION
GOUTAM M 33
VIJAY MADHANI 34
NISHKAM RAZDAN 46
Introduction
A CAPTCHA or Captcha is a type of challenge-response test used in computing as an
attempt to ensure that the response is not generated by a computer. The process usually
involves one computer (a server) asking a user to complete a simple test which the computer
is able to generate and grade. Because other computers are supposedly unable to solve the
CAPTCHA, any user entering a correct solution is presumed to be human. A common type of
CAPTCHA requires the user to type letters or digits from a distorted image that appears on
the screen.
Standard Interpretation:
Player C an interrogator is tasked with trying to determine who among A and B is a human or
a computer. A captcha is sometimes described as a reverse Turing test, because it is
administered by a machine and targeted to a human, in contrast to the standard Turing test
that is typically administered by a human and targeted to a machine.
Characteristics
This has the benefit of distinguishing humans from computers. It also creates incentive to
further develop artificial intelligence of computers.
Types of CAPTCHAS
Text: By far the most common type of captcha involves the use of letters that are arranged
randomly and are distorted in some way with various background colours or fonts.
Audio: Audio CAPTCHA’s for the visually impaired are probably the second most common
type of CAPTCHA.
Miscellaneous: There are also other CAPTCHA’s that require you to solve a problem that
should be easy for a person but very hard for a computer to solve such as choosing which
item in a list is not a bird for example but the problem with this is that one needs to have a
large number of questions before it really becomes effective.
Applications of CAPTCHAs
CAPTCHAs have several applications for practical security, including (but not limited to):
Preventing Comment Spam in Blogs. Most bloggers are familiar with programs that
submit bogus comments, usually for the purpose of raising search engine ranks of
some website. This is called comment spam. By using a CAPTCHA, only humans can
enter comments on a blog. There is no need to make users sign up before they enter a
comment, and no legitimate comments are ever lost.
Protecting Email Addresses from Scrapers. Spammers crawl on the Web in search
of email addresses posted in clear text. CAPTCHAs provide an effective mechanism
to hide your email address from Web scrapers. The idea is to require users to solve a
CAPTCHA before showing one’s email address.
Online Polls. Can the result of any online poll be trusted? Not unless the poll ensures
that only humans can vote.
Worms and Spam. CAPTCHAs also offer a plausible solution against email worms
and spam: "I will only accept an email if I know there is a human behind the other
computer." A few companies are already marketing this idea.
Guidelines
Accessibility. CAPTCHAs must be accessible. CAPTCHAs based solely on reading
text — or other visual-perception tasks — prevent visually impaired users from
accessing the protected resource. Such CAPTCHAs may make a site incompatible
with Section 508 in the United States. Any implementation of a CAPTCHA should
allow blind users to get around the barrier, for example, by permitting users to opt for
an audio or sound CAPTCHA.
Script Security. Building a secure CAPTCHA code is not easy. In addition to making
the images unreadable by computers, the system should ensure that there are no easy
ways around it at the script level. Common examples of insecurities in this respect
include: (1) Systems that pass the answer to the CAPTCHA in plain text as part of the
web form. (2) Systems where a solution to the same CAPTCHA can be used multiple
times (this makes the CAPTCHA vulnerable to so-called "replay attacks"). Most
CAPTCHA scripts found freely on the Web are vulnerable to these types of attacks.
Security Even After Wide-Spread Adoption. There are various "CAPTCHAs" that
would be insecure if a significant number of sites started using them. An example of
such a puzzle is asking text-based questions, such as a mathematical question ("what
is 1+1"). Since a parser could easily be written that would allow bots to bypass this
test, such "CAPTCHAs" rely on the fact that few sites use them, and thus that a bot
author has no incentive to program their bot to solve that challenge. True CAPTCHAs
should be secure even after a significant number of websites adopt them.
Example
Ways to break CAPTCHAs
Example
This page will give a high level description of these steps, using the image below as an
example.
Candidate Letters
The first step is to hypothesize a set of candidate letters in the image. This is done using
shape matching techniques The method essentially looks at a bunch of points in the image at
random, and compares these points to points on each of the 26 letters. The comparison is
done in a way that is very robust to background clutter and outliers and deformation of the
letters. The process usually results in 3-5 candidate letters per actual letter in the image.
In the example shown here, the "p" of profit matches well to both an "o" or a "p", the border
between the "p" and the "r" look a bit like a "u", and so forth. At this stage we have many
candidates, to be sure we don't miss anything for later steps.
Consistent Letters
Next, pairs of letters are to see whether or not they are "consistent", or can be used
consecutively to form a word. In the example below, green lines are drawn between pairs of
letters that could be chained together to form a complete word.
Plausible Words
There are many possible paths through the graph of letters constructed in the previous step.
However, most of them do not form real words. For example, "pfql" is a path through the
graph, but we don't need to consider it further since it isn't a real word. It turns out that the
vast majority of paths through the graph are meaningless.
We select out the real words in the graph, and assign scores to them based on how well their
individual letters match the image. In this example, 2 complete words are found, "roll" and
"profit". We compute matching scores for each letter or these words, and find that "profit",
with a score of 9.42 (lower is better, it's a distance measure) matches the image better than
"roll", that has a score of 11.94.
IMPLEMENTATION
A javascript CAPTCHA.
<html>
<head>
<title>Captcha</title>
<script type="text/javascript">
</script>
</head>
<body onload="DrawCaptcha();">
<table>
<tr>
<td>
Welcome To Captcha<br />
</td>
</tr>
<tr>
<td>
<input type="text" id="txtCaptcha"
style="background-image:url(1.jpg); text-align:center;
border:none;
font-weight:bold; font-family:Modern" />
<input type="button" id="btnrefresh" value="Refresh"
onclick="DrawCaptcha();" />
</td>
</tr>
<tr>
<td>
<input type="text" id="txtInput"/>
</td>
</tr>
<tr>
<td>
<input id="Button1" type="button" value="Check"
onclick="alert(ValidCaptcha());"/>
</td>
</tr>
</table>
</body>
</html>
SCREENSHOTS