I wrote a php verification code resolution Applet.-You are welcome to arrange it.

Source: Internet
Author: User
I wrote a php verification code application. You are welcome to make a selection. I recently studied some knowledge about breaking through verification codes and recorded them. On the one hand, it is a summary of the learning knowledge over the past few days to help you understand, on the other hand, we hope to help technical students in this area, and also hope to attract the attention of website managers, take the verification code into consideration. Since I have just been familiar with this knowledge, I have better understanding than I have written a small php verification code program-welcome to arrange it.
I recently studied some knowledge about breaking through verification codes and recorded them. On the one hand, it is a summary of the learning knowledge over the past few days to help you understand, on the other hand, we hope to help technical students in this area, and also hope to attract the attention of website managers, take the verification code into consideration. As I have just been familiar with this knowledge, it is easy to understand and make mistakes. You are welcome to make a brick.
Verification code: effectively prevents a hacker from continuously trying to log on to a specific registered user using brute-force cracking of a specific program. In fact, the modern verification code generally prevents the machine from batch registration, and prevents the machine from batch posting and reply. Currently, many websites use verification codes to prevent users from automatically registering, logging on, and bumping through robots.
The so-called verification code is to generate an image with a string of randomly generated numbers or symbols, and add some interference pixels to the image (preventing OCR). The user can identify the verification code information with the naked eye, enter a form to submit the website for verification. a function can be used only after the verification is successful.
Our most common verification code
One or four digits, a random string of one digit, and the original verification code. the verification function is almost zero.
2. random image verification code. The characters in the image are relatively regular, some may be added with some random interferon, and some may be random character colors. the verification effect is better than the previous one. People who do not have the knowledge of basic graphics and images cannot break through!
3. random numbers in various image formats + random uppercase English letters + random interference pixels + random positions.
4. Chinese characters are currently the latest verification codes registered. they are randomly generated, making them more difficult to create and affecting user experience. Therefore, there are usually few applications.
For the sake of simplicity, the main object we described here is 2nd types. let's take a look at several images of such verification codes that are common on the Internet.
These three types can basically represent the verification code type mentioned in 2. initially, it seems that the first image is the easiest to crack, the second, the third, and the fourth are the most difficult.
What is the actual situation? In fact, these three types of images are equally difficult to crack.
The first image is the easiest. The image background and numbers are in the same color, regular characters, and uniform character positions.
The second picture seems not easy. In fact, we will carefully study the rules, the background color and the interferon, no matter how they change, verify that the characters are regular and the colors are the same, so it is very easy to exclude interferon, exclude all non-character pigments.
The third image looks more complex. the color of the verification character is also changing, and the color of each character is also different, except that the background color and interferon are constantly changing. It seems that this verification code cannot be broken through. in this article, we will take this type of verification code as an example to describe the fourth picture.
In addition to the features mentioned in the third image, the fourth image also adds two linear interference rates to the text. In fact, it seems difficult and easy to remove.
Verification code recognition is generally divided into the following steps:
1. extract the model
2. binarization
3. computing features
4. Comparison Sample
1: extract the model
After all, the verification code is not a professional OCR recognition. because the verification codes of different websites are different, the most common method is to create a signature library for this verification code. When downloading the dashboard, we need to download several more images to make these images contain all the characters. The letters here are only images. Therefore, we only need to collect images including 0-9.
2: binarization
Binarization means that each pixel in the verification number on the image is represented by 1 in a number, and the other part is represented by 0. In this way, you can calculate each digital model, record these fonts, and use them as keys.
3: computing features
Binarization the image to be recognized to obtain the image features.
4: control sample
Compare the image signature and verification code pattern in step 3 to obtain the number on the verification image.
Currently, the verification code can be identified as 100%.
After completing the above steps, you may have said that you have not discovered how to retrieve interferon! In fact, the method to retrieve interferon is very simple. an important feature of interferon is that it does not affect the display effect of the verification code. Therefore, the RGB value of interferon may be lower than or higher than a specific value, for example, in the image I gave, the RGB values of interferon will not exceed 125, so we can easily remove interferon.
------ Solution --------------------
I conceived a verification code.
Into a string... add a change...

Then, make some special operations on interference.
Bitmap using random numbers... all colors are random.
Mix two images

Produce an image similar to embossed or engraved
Its color is relatively chaotic ~ There are only some vague boundary orientations
So it cannot be binarization.
Only the human brain can be used for fuzzy completion ~

But it is not available ~ Low efficiency

------ Solution --------------------
The verification code displays uppercase Chinese characters and Arabic numerals for verification.
------ Solution --------------------
Yes!
Good
------ Solution --------------------
From the perspective of the artist, it should not be too complicated, otherwise it will be ugly. A beautiful background with a few beautiful numbers can be numbers of several colors. At the same time, the amount occupied is small, and the height is exactly 11 to 15 pixels, which makes it ugly.

You have to give me more, but now the poor have too few scores. They don't have to wait.
------ Solution --------------------
Is this the answer?
------ Solution --------------------
Reached
------ Solution --------------------
!
------ Solution --------------------
Study ..
------ Solution --------------------
Learned
------ Solution --------------------
Http://blog.csdn.net/luojxun/archive/2008/09/27/2979694.aspx
The method of generating the random code cannot be identified. Haha
------ Solution --------------------
Haha, take a look at the stuff of the recaptcha foreigner.
------ Solution --------------------
It does not do much. if it is an onclick-triggered layer rewriting, you will not be able to use this recognition. If the verification code of the serial cipher card type is written, there is no picture at all, just fill in the two-dimensional array. It cannot be identified.
------ Solution --------------------
I don't know what the landlord wrote? If it's me, it's better to sleep...
------ Solution --------------------
Follow up
------ Solution --------------------
Learned
------ Solution --------------------
Reference:
It will increase the difficulty of binarization, but theoretically, the human brain can complete fuzzy completion,
The machine can also be completed, which may be ineffective.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.