473,503 Members | 4,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Random image text generation?


Is there a module out there that will generate an image with a random text
string such as the confirmation images you see on various websites? I'm
thinking I'm going to have to add that to the forms on the Mojam websites.
Over the past couple weeks we've begun to get lots of spam submission crap.

Thx,

Skip

Nov 12 '06 #1
12 2776
sk**@pobox.com wrote:
Is there a module out there that will generate an image with a random text
string such as the confirmation images you see on various websites?
They're called captcha images or captchas for short.
Googling for "python captcha" returns several hits; see what you like...
Nov 12 '06 #2
sk**@pobox.com writes:
Is there a module out there that will generate an image with a random text
string such as the confirmation images you see on various websites? I'm
thinking I'm going to have to add that to the forms on the Mojam websites.
Over the past couple weeks we've begun to get lots of spam submission crap.
http://captchas.net/sample/python/
http://aspn.activestate.com/ASPN/Coo.../Recipe/440588

There are specific implementations for Zope, TurboGears and other frameworks.

--
Jorge Godoy <jg****@gmail.com>
Nov 12 '06 #3
>Is there a module out there that will generate an image with a random
text string such as the confirmation images you see on various
websites?
MitjaThey're called captcha images or captchas for short. Googling
Mitjafor "python captcha" returns several hits; see what you like...

Thanks. I'd never heard that term before. Assuming I can get PIL installed
with freetype support on my Mac the ASPN recipe looks like it will do the
trick.

Skip

Nov 12 '06 #4
On Sun, 12 Nov 2006 14:56:49 -0600, skip wrote:
>
>Is there a module out there that will generate an image with a random
>text string such as the confirmation images you see on various
>websites?

MitjaThey're called captcha images or captchas for short. Googling
Mitjafor "python captcha" returns several hits; see what you like...

Thanks. I'd never heard that term before. Assuming I can get PIL installed
with freetype support on my Mac the ASPN recipe looks like it will do the
trick.
Keep in mind two serious problems with captchas:

- they're impossible for the blind or people using text-only browsers to
see -- even mere colour blindness can make some captchas impossible to
solve;

- sometimes they're too difficult for even those with perfect vision to
decipher.
Two alternatives:

Instead of displaying an obfuscated image of a nonsense word, display six
randomly chosen photos, where five are of the same thing but not the same
image. E.g. you might show five different kittens and a horse. The user
has to click on the image that is not the same as the others.
State-of-the-art horse-recognition software is not yet in widespread use
by spammers *wink*

For a text only solution, consider putting up a natural language question
such as:

What is the third letter of 'national'?
What is four plus two?
How many eggs in a dozen?
Fill in the blank: Mary had a little ____ its fleece was white as snow.
Cat, Dog, Apple, Bird. One of those words is a fruit. Which one?

Beware of making the questions too difficult or too specific:

In the third season of Babylon Five, what did Mr Morden ask Lando?

Also, keep in mind that all captchas are vulnerable to the old
distributed hybrid human-machine network trick: "We'll give you a free
account on our porn site if you spend fifteen minutes a day solving
captchas for our bot network." The only solution to that, I fear, is open
season on spammers and anyone who buys from a spammer.

--
Steven.

Nov 12 '06 #5
Steven D'Aprano wrote:
For a text only solution, consider putting up a natural language question
such as:

What is the third letter of 'national'?
What is four plus two?
How many eggs in a dozen?
Fill in the blank: Mary had a little ____ its fleece was white as snow.
Cat, Dog, Apple, Bird. One of those words is a fruit. Which one?
That wouldn't work as a true CAPTCHA (Completely Automated *Public*
Turing test to tell Computers and Humans Apart), since making the list
of questions and answers public would defeat its purpose.
Nov 12 '06 #6

StevenKeep in mind two serious problems with captchas:

Steven- they're impossible for the blind or people using text-only
Steven browsers to see -- even mere colour blindness can make some
Steven captchas impossible to solve;

Steven- sometimes they're too difficult for even those with perfect
Steven vision to decipher.

Sure, but I'm more concerned in the immediate term with people not
submitting random crap advertising cheap drugs into my concert database.
(I've been running the Musi-Cal concert database for nearly 12 years. This
is the first time I've ever had to consider resorting to something like
this, and it really pisses me off that I have to.) I can deal with visual
impairment in other ways (like asking users who can't respond to the captcha
by simply emailing their concert data directly to me).

StevenInstead of displaying an obfuscated image of a nonsense word,
...

Thanks for the suggestions. I'll keep them in mind.

Another possibility is to run the submissions through SpamBayes and silently
direct any which score as "unsure" or "spam" to me for review. Users
wouldn't even need to know their submissions were being scrutinized.

Skip
Nov 12 '06 #7
sk**@pobox.com wrote:
Another possibility is to run the submissions through SpamBayes and silently
direct any which score as "unsure" or "spam" to me for review. Users
wouldn't even need to know their submissions were being scrutinized.
there's also:

http://akismet.com/

python interface here:

http://kemayo.wordpress.com/2005/12/02/akismet-py/

</F>

Nov 12 '06 #8
Leif K-Brooks <eu*****@ecritters.bizwrites:
Steven D'Aprano wrote:
For a text only solution, consider putting up a natural language
question such as:

What is the third letter of 'national'?
What is four plus two?
How many eggs in a dozen?
Fill in the blank: Mary had a little ____ its fleece was white as snow.
Cat, Dog, Apple, Bird. One of those words is a fruit. Which one?

That wouldn't work as a true CAPTCHA (Completely Automated *Public*
Turing test to tell Computers and Humans Apart), since making the
list of questions and answers public would defeat its purpose.
The "Public" part of a CAPTCHA is the algorithm. The data consumed and
produced by the algorithm don't need to be publicly correlated -- and
indeed shouldn't be, for exactly the reason you state.

--
\ "To me, boxing is like a ballet, except there's no music, no |
`\ choreography, and the dancers hit each other." -- Jack Handey |
_o__) |
Ben Finney

Nov 12 '06 #9
Ben Finney wrote:
Leif K-Brooks <eu*****@ecritters.bizwrites:
>Steven D'Aprano wrote:
>>For a text only solution, consider putting up a natural language
question
That wouldn't work as a true CAPTCHA (Completely Automated *Public*
Turing test to tell Computers and Humans Apart), since making the
list of questions and answers public would defeat its purpose.

The "Public" part of a CAPTCHA is the algorithm. The data consumed and
produced by the algorithm don't need to be publicly correlated -- and
indeed shouldn't be, for exactly the reason you state.
When the CAPTCHA is based entirely on a fixed list of questions and
answers, I think it's reasonable to treat that list as part of the
algorithm, since the CAPTCHA couldn't function without it. Similarly, I
think most people would consider an image-based CAPTCHA for which the
algorithm but not the fonts were available to be non-public
Nov 12 '06 #10
From: "Leif K-Brooks" <eu*****@ecritters.bizwrote:
Steven D'Aprano wrote:
For a text only solution, consider putting up a natural language question
such as:

What is the third letter of 'national'?
What is four plus two?
How many eggs in a dozen?
Fill in the blank: Mary had a little ____ its fleece was white as snow.
Cat, Dog, Apple, Bird. One of those words is a fruit. Which one?

That wouldn't work as a true CAPTCHA (Completely Automated *Public*
Turing test to tell Computers and Humans Apart), since making the list
of questions and answers public would defeat its purpose.
you could consider keeping these answers secret - the spammers would then be
stymied...

Nov 14 '06 #11
Steven D'Aprano <st***@REMOVE.THIS.cybersource.com.auwrites:
Instead of displaying an obfuscated image of a nonsense word, display six
randomly chosen photos, where five are of the same thing but not the same
image. E.g. you might show five different kittens and a horse. The user
has to click on the image that is not the same as the others.
State-of-the-art horse-recognition software is not yet in widespread use
by spammers *wink*
No need to recognize the horse. Just pick one of the pictures at
random and you'll get the right one 1/6th of the time. Repeat ad
infinitum--they're spammers and like to repeat stuff after all.
That's why those conventional captcha images make you recognize a
multi-character string: so the guessing chance is low.
Nov 14 '06 #12
>>>>"Paul" == Paul Rubin <"http://phr.cx"@NOSPAM.invalidwrites:

PaulSteven D'Aprano <st***@REMOVE.THIS.cybersource.com.auwrites:
>Instead of displaying an obfuscated image of a nonsense word, display
six randomly chosen photos, where five are of the same thing but not
the same image. E.g. you might show five different kittens and a
horse. The user has to click on the image that is not the same as the
others. State-of-the-art horse-recognition software is not yet in
widespread use by spammers *wink*
PaulNo need to recognize the horse. Just pick one of the pictures at
Paulrandom and you'll get the right one 1/6th of the time. Repeat ad
Paulinfinitum--they're spammers and like to repeat stuff after all.
PaulThat's why those conventional captcha images make you recognize a
Paulmulti-character string: so the guessing chance is low.

Actually, the ones I saw that used a set of "one of these things is not like
the other" images gave you a pop-up menu of maybe 100-200 words. The user
needed to choose the name of the different object from that list. That
makes it a bit harded to guess. Of course, these sorts of tests suffer from
the same shortcoming as the randomly generated string. Visually impaired
people have trouble with it.

I finally settled on just reusing the SpamBayes engine to detect/reject spam
submissions.

Skip
Nov 14 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3505
by: Olly | last post by:
I've found a basic script, however I also need to add alt and title attributes as well, how would I go about doing this? Here's the script I found: Thanks <script language="JavaScript"> <!--...
5
2561
by: Linda | last post by:
Greetings: I have found a random image script that I like. It is located here: http://www.javascriptcity.com/scripts/local/simage3.htm I'd like to edit this to have 4 different slots for...
5
2176
by: Haydnw | last post by:
Hi, I have the code below as code-behind for a page which displays two images. My problem is with the second bit of code, commented as " 'Portfolio image section". Basically, the SQL query gets...
2
2875
by: Jim in Arizona | last post by:
I was trying to create a random image generator. I'm using visual web dev express with 2.0 framework. On the web form page (mypage.aspx), I have an image control: <asp:Image ID="Image1"...
6
3062
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
4
2736
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
4
3060
by: Kim | last post by:
Random image downloader for specified newsgroup. Hi I'm writing a small script that will download random images from a specified newsgroup. I've imported yenc into the script but I can't open the...
3
3574
by: fran7 | last post by:
Hi, I have this nice code that returns a random image database record. It works great. What I am trying to do now is to be able to get the "alt" description for the image from another field. If I...
2
17576
by: Ron Poulton | last post by:
A recent project involved me obtaining a random image from the Web and using it in some specific fashion. I chose to use PHP to access Google Images for a random image URL. The image could be generic...
0
7193
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.