How to create anti spam Image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mukeshrasm
    Contributor
    • Nov 2007
    • 254

    How to create anti spam Image

    Hello I want to create Antispam Image using PHP and GD Library how can I do it.
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    #2
    Well, you probably have about a million ways to do it. I would probably generate a random string (mixed with chars and ints) and draw some random lines to make it harder to read. What you also can do is rotate or combine different colours.

    Hope this helps.

    Comment

    • nathj
      Recognized Expert Contributor
      • May 2007
      • 937

      #3
      Hi,

      Take a look at this offering

      I've used this myself a number of times and it's pretty good.

      nathj

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by MarkoKlacar
        Well, you probably have about a million ways to do it. I would probably generate a random string (mixed with chars and ints) and draw some random lines to make it harder to read. What you also can do is rotate or combine different colours.

        Hope this helps.
        Personally i hate it when people put lines through it.. absolutely hate it.

        I mean, if only a person is going to be able to read it, what good does a disfiguring line do? ABSOLUTELY NOTHING. Except anger me

        >=[

        [/RANT]

        :)

        Comment

        • nathj
          Recognized Expert Contributor
          • May 2007
          • 937

          #5
          Originally posted by markusn00b
          Personally i hate it when people put lines through it.. absolutely hate it.

          I mean, if only a person is going to be able to read it, what good does a disfiguring line do? ABSOLUTELY NOTHING. Except anger me

          >=[

          [/RANT]

          :)
          Hey there,

          I agree to be hoset and I avoid using captchas except when my boss insist on them - so far only once.

          There are better ways to handle form abuse than forcing the user to squint.

          nathj

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by nathj
            Hey there,

            I agree to be hoset and I avoid using captchas except when my boss insist on them - so far only once.

            There are better ways to handle form abuse than forcing the user to squint.

            nathj
            Yeh, exactly.
            I like MySpace's use of them (don't ever quote me as saying i like myspace) - they use them very rarely but often enough to prevent spam; but then again, they do it in some stupid font and a stupid amount of chars, which makes no sense to me - If a computer can't read it, why should it be made difficult for a human to read?

            Gah!

            Hate captchas, me do.

            Comment

            • helraizer1
              New Member
              • Mar 2007
              • 118

              #7
              The over all best way is to make a bigger image, with bigger letters (easy to see for a human), have two codes (the human can see which one if you ask, the bot will have to guess).

              Make the text stand out (again easy to see), but break down the string with str_split, then make the code with a random number generator, depending on a number, ask the user to input those characters, on the different image. If you have every combination of 5 digit codes between 00000 and 99999 the human can easily recognise it and enter the code but a bot will have a 1 in around 3'075 chance of getting it each time. =P that's only using numbers, if you use letters too that figure will easily be in five figures. Thus not much chance.

              Finally, since the characters of the code are individual in array (thanks to string split) but then on the image, place them easy to see but have some at different angles thus the lines of the characters touch and overlap. This ought to confuse OCR programs, since they map out the characters by the lines, if the lines overlap, it'll be harder to do, for it to recognise them but easy for a human to see.

              An example of the two codes on one image

              there is distortion in the background but the characters stand out. and the user is asked for 5 of the six characters, from either code seen.

              An example of standing out text with overlapping (to an extent).


              Sam

              Comment

              • amanjsingh
                New Member
                • Mar 2007
                • 48

                #8
                I do not like captchas anyways but there can be a good way to have a dynamically moving (animated) background generated on the fly with some random text in front.

                But as Gurus here already said (and I agree) there are better ways other than captchas. Captchas just irritate people.

                Comment

                • Markus
                  Recognized Expert Expert
                  • Jun 2007
                  • 6092

                  #9
                  Originally posted by helraizer1
                  The over all best way is to make a bigger image, with bigger letters (easy to see for a human), have two codes (the human can see which one if you ask, the bot will have to guess).

                  Make the text stand out (again easy to see), but break down the string with str_split, then make the code with a random number generator, depending on a number, ask the user to input those characters, on the different image. If you have every combination of 5 digit codes between 00000 and 99999 the human can easily recognise it and enter the code but a bot will have a 1 in around 3'075 chance of getting it each time. =P that's only using numbers, if you use letters too that figure will easily be in five figures. Thus not much chance.

                  Finally, since the characters of the code are individual in array (thanks to string split) but then on the image, place them easy to see but have some at different angles thus the lines of the characters touch and overlap. This ought to confuse OCR programs, since they map out the characters by the lines, if the lines overlap, it'll be harder to do, for it to recognise them but easy for a human to see.

                  An example of the two codes on one image

                  there is distortion in the background but the characters stand out. and the user is asked for 5 of the six characters, from either code seen.

                  An example of standing out text with overlapping (to an extent).


                  Sam
                  Why would anyone want to do that? I mean, sure it looks 'professional' n all.. but it's just annoying and unnecessary.

                  A simple image of 4 clear letters and you're done. Hay-presto.

                  Comment

                  • helraizer1
                    New Member
                    • Mar 2007
                    • 118

                    #10
                    Originally posted by markusn00b
                    Why would anyone want to do that? I mean, sure it looks 'professional' n all.. but it's just annoying and unnecessary.

                    A simple image of 4 clear letters and you're done. Hay-presto.
                    Well no, if you need a captcha for registration, to stop spam users, and use a plain background with just for monospaced, regular characters; if they want in they will use a simple OCR (Optical Character Recognition) program and will get it. That's why the more obscure ones that mask the characters slightly that a human can easily read can make it harder for the bot, therefore you won't get any spam users.

                    Again, if you ask for all 4 characters each time, if the attacker works out how your codes work and their program can read it each time. It'll never stop them. However if you ask for 5characters in any order or even 6 characters from 2 codes a-z 0-9. The bot may be able to read the characters but it then has a 1 in over 10,000 chance of getting it.

                    Sam

                    Comment

                    • helraizer1
                      New Member
                      • Mar 2007
                      • 118

                      #11
                      Originally posted by helraizer1
                      Well no, if you need a captcha for registration, to stop spam users, and use a plain background with just for monospaced, regular characters; if they want in they will use a simple OCR (Optical Character Recognition) program and will get it. That's why the more obscure ones that mask the characters slightly that a human can easily read can make it harder for the bot, therefore you won't get any spam users.

                      Again, if you ask for all 4 characters each time, if the attacker works out how your codes work and their program can read it each time. It'll never stop them. However if you ask for 5characters in any order or even 6 characters from 2 codes a-z 0-9. The bot may be able to read the characters but it then has a 1 in over 10,000 chance of getting it.

                      Sam
                      Just realised I wasn't quite right with the a-z 1-9 thing but there is a 1 in 3'075 chance for the bot to guess the code.

                      Comment

                      Working...