Movatterモバイル変換


[0]ホーム

URL:


CN103902875A - Verification code image generating method and device and verification method and device - Google Patents

Verification code image generating method and device and verification method and device
Download PDF

Info

Publication number
CN103902875A
CN103902875ACN201410077527.4ACN201410077527ACN103902875ACN 103902875 ACN103902875 ACN 103902875ACN 201410077527 ACN201410077527 ACN 201410077527ACN 103902875 ACN103902875 ACN 103902875A
Authority
CN
China
Prior art keywords
picture
verification code
pixel value
texture
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410077527.4A
Other languages
Chinese (zh)
Other versions
CN103902875B (en
Inventor
丁二锐
王云吉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co LtdfiledCriticalBeijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201410077527.4ApriorityCriticalpatent/CN103902875B/en
Publication of CN103902875ApublicationCriticalpatent/CN103902875A/en
Application grantedgrantedCritical
Publication of CN103902875BpublicationCriticalpatent/CN103902875B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention provides a verification code image generating method and device and a verification method and device. The verification code image generating method and device and the verification method and device aim to lower the success rate of automatic identification of a machine. The verification code image generating method comprises the steps of generating a texture image, determining the position of a verification code, and modifying the pixel value of the texture image at the position of the verification code to obtain a verification code image. The verification code image generating method has the advantages that the success rate of automatic identification of a machine can be lowered, the risk that the verification code is cracked is lowered, and the network security is improved.

Description

Generation method and device of verification code picture and verification method and device
Technical Field
The invention relates to the technical field of network security, in particular to a method and a device for generating a verification code picture and a method and a device for verifying the verification code picture.
Background
In order to prevent some users from using a machine to automatically perform computer operations such as login, information distribution, downloading and the like, many websites require the user to input an authentication code when the user performs the relevant computer operation. The verification code is usually displayed in the form of a picture, and the user inputs the verification code according to characters displayed in the picture.
With the development of the technology, the machine can automatically complete the identification of the verification code through software, and the automatic identification of the machine mainly depends on the continuous verification code on the image, and meanwhile, the verification code per se needs to have larger contrast with the background. In order to reduce the success rate of machine identification, the verification code can be subjected to blurring and twisting, and noise and other processing are added into the background, but the machine automatic identification capability is stronger and stronger, so that the higher identification rate still exists.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, one objective of the present invention is to provide a method for generating a verification code picture, which can reduce the success rate of machine to automatically identify the verification code, reduce the risk of the verification code being cracked, and further improve the network security.
The invention also aims to provide a device for generating the verification code picture.
Another object of the invention is to propose a verification method.
Another object of the invention is to propose an authentication device.
In order to achieve the above object, a method for generating a verification code picture according to an embodiment of the first aspect of the present invention includes: generating a texture picture; determining the position of the verification code; and modifying the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
According to the generation method of the verification code picture provided by the embodiment of the first aspect of the invention, the pixel values at the positions corresponding to the verification codes in the texture picture are modified, so that the pixel value change can occur at the positions of the verification codes in the texture picture, and human eyes can capture the change, so that the verification codes are recognized.
In order to achieve the above object, an apparatus for generating a verification code according to an embodiment of the second aspect of the present invention includes: the generating module is used for generating a texture picture; the determining module is used for determining the position of the verification code; and the processing module is used for modifying the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
The verification code generation device provided by the embodiment of the second aspect of the invention can change the pixel value at the position of the verification code in the texture picture by modifying the pixel value at the position corresponding to the verification code in the texture picture, and human eyes can capture the change, so as to identify the verification code.
In order to achieve the above object, an authentication method according to an embodiment of the third aspect of the present invention includes: displaying a verification code picture, wherein the verification code picture is obtained by modifying the pixel value of the texture picture at the position of a verification code; receiving a user input; and verifying the user input according to the verification code picture.
According to the verification method provided by the embodiment of the third aspect of the invention, the verification code picture is adopted during verification, the pixel value of the position of the verification code in the texture picture is modified, the discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
In order to achieve the above object, an authentication apparatus according to a fourth aspect of the present invention includes: the display module is used for displaying a verification code picture, wherein the verification code picture is obtained by modifying the pixel value of the texture picture at the position of the verification code; a receiving module for receiving user input; and the verification module is used for verifying the user input according to the verification code picture.
According to the verification device provided by the embodiment of the fourth aspect of the invention, the verification code picture is adopted during verification, the pixel value of the position of the verification code in the texture picture is modified, the discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
In order to achieve the above object, an embodiment of a fifth aspect of the present invention provides a client device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power circuit for supplying power to each circuit or device of the client device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of: generating a texture picture; determining the position of the verification code; and modifying the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
The client device provided by the embodiment of the fifth aspect of the present invention modifies the pixel values at the positions corresponding to the verification codes in the texture picture, so that the pixel values at the positions of the verification codes in the texture picture can change, and human eyes can capture the changes, thereby recognizing the verification codes.
In order to achieve the above object, a sixth aspect of the present invention provides a client device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power circuit for supplying power to each circuit or device of the client device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of: displaying a verification code picture, wherein the verification code picture is obtained by modifying the pixel value of the texture picture at the position of a verification code; receiving a user input; and verifying the user input according to the verification code picture.
According to the client device provided by the embodiment of the sixth aspect of the invention, the verification code picture is adopted during verification, the pixel value of the verification code in the texture picture is modified, discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart illustrating a method for generating a verification code picture according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a texture picture according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another texture picture according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an initial verification code picture according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a verification code picture generated in an embodiment of the present invention;
FIG. 6 is a diagram illustrating another verification code picture generated in an embodiment of the present invention;
fig. 7 is a flowchart illustrating a method for generating a verification code picture according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus for generating a verification code according to another embodiment of the present invention;
FIG. 9 is a flowchart illustrating a verification method according to another embodiment of the present invention;
fig. 10 is a schematic structural diagram of an authentication apparatus according to another embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flow chart of a method for generating a verification code picture according to an embodiment of the present invention, where the method includes:
s11: and generating a texture picture.
The texture picture may be a color picture or a gray picture. In the embodiment of the present invention, the texture picture is a grayscale picture.
In order to better obtain the non-continuous verification code, the texture picture may be composed of pixels with non-continuous variation of pixel values. That is, the difference between the color value (RGB value) and the gray value of each pixel point of the texture image is large.
Further, the histogram of the texture picture may be a bimodal distribution. Taking a gray-scale picture as an example, a histogram of the gray-scale picture is used to count the frequency of occurrence of gray-scale, and generally, the horizontal axis is gray-scale and the vertical axis is normalized frequency. When the histogram of the gray-scale picture is a bimodal distribution, it can be ensured that the pixel values of the gray-scale picture are discontinuously distributed, for example, when the gray-scale picture is composed of black and white pixels, in the histogram, the black pixels are concentrated at a position where the horizontal axis is 0, the white pixels are concentrated at a position where the horizontal axis is 255, and no pixel distribution exists in an interval where the horizontal axis is (0, 255). When the histogram of the texture picture is bimodal, it can be ensured that the pixel values of the texture picture are discontinuous.
In another aspect, the texture picture includes one texture or at least two textures. In the embodiment of the present invention, a texture picture is composed of black pixels and white pixels, and referring to fig. 2 and fig. 3, schematic diagrams of a texture picture composed of one texture and schematic diagrams of a texture picture composed of two textures are respectively given.
S12: determining the position of the verification code;
the position of the verification code can be determined according to a preset initial verification code picture.
The initial authentication code picture includes an authentication code and a background. In the related art, the verification code may also be displayed on the background, and therefore, the specific process of generating the initial verification code picture may refer to the related art, which is not described herein again.
Referring to fig. 4, a schematic diagram of an initial verification code picture is shown, in which 10 digits of 0-9 are used as the verification code, and the background is a white pattern.
The size of the initial captcha picture may be the same as the size of the texture picture, e.g., both the initial captcha picture and the texture picture contain the same number of pixels in the horizontal and vertical directions.
S13: and modifying the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
Taking the initial verification code picture as the picture shown in fig. 4 as an example, the color of the verification code is black, the color of the background is white, the gray-level value of the black pixel is 0, and the gray-level value of the white pixel is 255.
In the texture picture, corresponding to each pixel, searching whether the position in the initial verification code picture is the position of the verification code, and if so, modifying the pixel value of the pixel in the texture picture. For example, for a certain pixel a in the texture picture, assuming that the position coordinate of a is (x0, y0), looking at the pixel value of the pixel at the (x0, y0) position in the initial verification code picture, if the pixel value is 0, it indicates that the position is the verification code position, i.e. the position of the pixel a in the texture picture is the verification code position, and the pixel value of the pixel a needs to be modified. Conversely, if the pixel value of the pixel at the (x0, y0) location in the initial captcha picture is 255, indicating that the location is not the captcha's location, the pixel value of the pixel at that location in the texture picture is not modified.
In the modification, if the pixel value is large, a set value is decreased, and if the pixel value is small, a set value is increased. For example, the texture picture is composed of black and white patterns, the pixel value of the pixel a in the texture picture needs to be modified, and then a set value is increased when the pixel value of the pixel a is 0, and then decreased when the pixel value of the pixel a is 255.
Further, the setting values for increasing or decreasing at different positions may be the same or different, and the setting value for increasing and the setting value for decreasing may be the same or different. For example, when the pixel values of the pixel a and the pixel B need to be modified, assuming that the pixel values of the pixel a and the pixel B are both 0, the pixel value of the pixel a may be increased by a first value, and the pixel value of the pixel B may be increased by a second value; alternatively, assuming that the pixel values of both pixel a and pixel B are 255, the pixel value of pixel a may be decreased by a first value and the pixel value of pixel B may be decreased by a second value; alternatively, assuming that the pixel value of pixel a is 0 and the pixel value of pixel B is 255, the pixel value of pixel a may be increased by a first value and the pixel value of pixel B may be decreased by a second value.
Since the pixel values of the pixels in the texture picture are modified at the positions of the verification codes, the positions can be relatively significant (significant) relative to the positions of the unmodified pixel values, and the verification codes can be recognized after human eyes see the significant positions.
Fig. 5 and fig. 6 respectively show schematic diagrams of two verification code pictures, where the two verification code pictures are obtained by modifying the pixel values of the texture picture at the verification code position by using the above-described process, and the difference is that fig. 5 illustrates that the texture picture includes one texture, and fig. 6 illustrates that the texture picture includes two textures.
Referring to fig. 5 or fig. 6, the human eye can see the verification code in the verification code picture, and it should be noted that the human eye can see the verification code more clearly on the side due to the display, light refraction and the like. However, since the verification code picture is obtained by modifying the pixel values of the texture picture, the gray value or RGB value of the verification code is no longer continuous, and the machine is difficult to recognize, and the difference between the verification code and the texture as the background is small, which increases the difficulty of machine recognition.
According to the embodiment, the pixel values at the positions corresponding to the verification codes in the texture picture are modified, the pixel value change can occur at the positions of the verification codes in the texture picture, and human eyes can capture the change, so that the verification codes are recognized.
Fig. 7 is a flowchart illustrating a method for generating a verification code picture according to another embodiment of the present invention, where this embodiment provides a specific implementation flow in combination with a specific example, and the method includes:
s71: generating a texture picture and an initial verification code picture;
in this embodiment, it is assumed that the texture picture is a black and white gray-scale picture, the verification code in the initial verification code picture is black, and the background is white.
For specific steps of generating the texture picture and the initial verification code picture, reference may be made to the embodiment shown in fig. 1, which is not described herein again.
S72: selecting a pixel in the texture picture, obtaining the position coordinate of the pixel, and determining whether the gray value of the pixel at the position in the initial verification code picture is 0, if so, executing S73, otherwise, executing S76.
Assuming that the pixel selected in the texture picture is pixel a and the position coordinate of the pixel is (x0, y0), the step is to determine whether the gray-level value of the pixel at the position (x0, y0) in the initial verification code picture is 0, wherein when the gray-level value is 0, the position is the position where the verification code is located, and otherwise, when the gray-level value is 255, the position is the position where the background is located.
S73: and judging whether the gray value of the pixel at the position in the texture picture is 0, if so, executing S74, otherwise, executing S75.
For example, it is determined whether the gradation value of the pixel a is 0.
S74: and increasing the gray value of the pixel at the position by a first set value in the texture picture. After that, S77 is executed.
For example, the gradation value of the pixel a is increased by a first setting value.
S75: and reducing the gray value of the pixel at the position by a second set value in the texture picture. After that, S77 is executed.
For example, the gradation value of the pixel a is decreased by the second setting value.
The first and second set points may be the same or different. The first setting value and the second setting value may be preset values smaller than a setting threshold.
S76: the gray value of the position pixel is kept unchanged in the texture picture.
For example, the gradation value of the pixel a is kept unchanged.
S77: and judging whether the unselected pixels exist in the texture picture, if so, repeatedly executing S72 and the subsequent steps, and otherwise, executing S78.
S78: the flow ends.
In the embodiment, the positions of the verification codes in the texture picture are modified, so that the pixels at the positions are more obvious, and the verification codes are identified by human eyes; in addition, by modifying the pixel value, the discontinuous change of the pixel value can be realized, and the machine identification difficulty is increased; moreover, by adopting texture pictures with black and white gray scales, the discontinuous change of pixel values can be further ensured, and the machine identification difficulty is further increased; moreover, the value that is increased or decreased when the pixel value is modified is a smaller value, so that the difference between the verification code and the texture can be reduced, and the machine recognition difficulty can be increased from the other aspect. Therefore, the embodiment can increase the difficulty of identifying the verification code by the machine, reduce the success rate of machine identification, reduce the risk of the verification code being broken by the machine, and ensure the network security.
Fig. 8 is a schematic structural diagram of an apparatus for generating an authentication code according to another embodiment of the present invention, where theapparatus 80 includes a generatingmodule 81, a determiningmodule 82, and aprocessing module 83.
The generatingmodule 81 is used for generating a texture picture; thedetermination module 82 is used for determining the position of the verification code; theprocessing module 83 is configured to modify the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
In one embodiment, the texture picture generated by the generation module is composed of pixels with non-continuously changing pixel values.
In another embodiment, the histogram of the texture picture generated by the generation module is a bimodal distribution.
In another embodiment, the processing module is specifically configured to:
when the pixel value before modification is larger than a set value, reducing the pixel value; or,
and when the pixel value before modification is smaller than a set value, increasing the pixel value.
In another embodiment, the processing module is specifically configured to:
when the pixel value is decreased, the pixel value decreased at different positions is different; or,
when the pixel value is increased, the increased pixel values at different positions are different; or,
when the pixel value is decreased, the decreased pixel value at different positions is the same, when the pixel value is increased, the increased pixel value at different positions is the same, and the decreased pixel value is different from or the same as the increased pixel value.
In another embodiment, the texture picture generated by the generation module includes one texture or at least two textures.
In another embodiment, the texture picture generated by the generating module is a gray scale picture or a color picture.
In another embodiment, the determining module is specifically configured to:
generating an initial verification code picture according to the presetting, wherein the initial verification code picture comprises a verification code and a background;
and determining the position of the verification code according to the initial verification code picture.
In another embodiment, the determining module is specifically configured to:
generating an initial verification code picture according to the presetting, wherein the initial verification code picture comprises a verification code and a background;
and determining the position of the verification code according to the initial verification code picture.
For a specific processing flow of the apparatus of this embodiment, reference may be made to the above-mentioned embodiment of the method for generating an authentication code picture, which is not described herein again.
According to the embodiment, the pixel values at the positions corresponding to the verification codes in the texture picture are modified, the pixel value change can occur at the positions of the verification codes in the texture picture, and human eyes can capture the change, so that the verification codes are recognized.
Fig. 9 is a schematic flowchart of a verification method according to another embodiment of the present invention, where the method includes:
s91: displaying a verification code picture, wherein the verification code picture is obtained by modifying the pixel value of the texture picture at the position of a verification code;
s92: receiving a user input;
s93: and verifying the user input according to the verification code picture.
In one embodiment, the texture picture is composed of pixels whose pixel values vary non-continuously.
In another embodiment, the histogram of the texture picture is a bimodal distribution.
In another embodiment, the modifying the pixel values of the texture picture includes:
when the pixel value before modification is larger than a set value, reducing the pixel value; or,
and when the pixel value before modification is smaller than a set value, increasing the pixel value.
In another embodiment, when decreasing the pixel value, the pixel value decreases differently at different locations; or,
when the pixel value is increased, the increased pixel values at different positions are different; or,
when the pixel value is decreased, the decreased pixel value at different positions is the same, when the pixel value is increased, the increased pixel value at different positions is the same, and the decreased pixel value is different from or the same as the increased pixel value.
In another embodiment, the texture picture comprises one texture or at least two textures.
In another embodiment, the texture picture is a gray scale picture or a color picture.
In another embodiment, the location of the verification code is determined as follows:
generating an initial verification code picture according to the presetting, wherein the initial verification code picture comprises a verification code and a background;
and determining the position of the verification code according to the initial verification code picture.
In another embodiment, the size of the initial captcha picture is the same as the size of the texture picture.
The verification code picture used in this embodiment may specifically refer to the verification code picture obtained by using the generation method of the verification code picture, and details are not described here.
In the embodiment, the verification code picture is adopted during verification, the pixel value of the texture picture at the position of the verification code is modified to obtain the verification code picture, discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
Fig. 10 is a schematic structural diagram of an authentication apparatus according to another embodiment of the present invention, where theapparatus 100 includes adisplay module 101, a receivingmodule 102, and anauthentication module 103.
Thedisplay module 101 is configured to display a verification code picture, where the verification code picture is obtained by modifying a pixel value of a texture picture at a position of a verification code; the receivingmodule 102 is used for receiving user input; theverification module 103 is configured to verify the user input according to the verification code picture.
In one embodiment, the texture picture is composed of pixels whose pixel values vary non-continuously.
In another embodiment, the histogram of the texture picture is a bimodal distribution.
In another embodiment, the pixel values of the texture picture are modified as follows:
when the pixel value before modification is larger than a set value, reducing the pixel value; or,
and when the pixel value before modification is smaller than a set value, increasing the pixel value.
In another embodiment, when decreasing the pixel value, the pixel value decreases differently at different locations; or,
when the pixel value is increased, the increased pixel values at different positions are different; or,
when the pixel value is decreased, the decreased pixel value at different positions is the same, when the pixel value is increased, the increased pixel value at different positions is the same, and the decreased pixel value is different from or the same as the increased pixel value.
In another embodiment, the texture picture comprises one texture or at least two textures.
In another embodiment, the texture picture is a gray scale picture or a color picture.
In another embodiment, the location of the verification code is determined as follows:
generating an initial verification code picture according to the presetting, wherein the initial verification code picture comprises a verification code and a background;
and determining the position of the verification code according to the initial verification code picture.
In another embodiment, the size of the initial captcha picture is the same as the size of the texture picture.
The verification code picture used in this embodiment may specifically refer to the verification code picture obtained by using the generation method of the verification code picture, and details are not described here.
In the embodiment, the verification code picture is adopted during verification, the pixel value of the texture picture at the position of the verification code is modified to obtain the verification code picture, discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
The embodiment of the invention also provides client equipment which comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power circuit for powering various circuits or devices of the client device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
s11': and generating a texture picture.
The texture picture may be a color picture or a gray picture. In the embodiment of the present invention, the texture picture is a grayscale picture.
In order to better obtain the non-continuous verification code, the texture picture may be composed of pixels with non-continuous variation of pixel values. That is, the difference between the color value (RGB value) and the gray value of each pixel point of the texture image is large.
Further, the histogram of the texture picture may be a bimodal distribution. Taking a gray-scale picture as an example, a histogram of the gray-scale picture is used to count the frequency of occurrence of gray-scale, and generally, the horizontal axis is gray-scale and the vertical axis is normalized frequency. When the histogram of the gray-scale picture is a bimodal distribution, it can be ensured that the pixel values of the gray-scale picture are discontinuously distributed, for example, when the gray-scale picture is composed of black and white pixels, in the histogram, the black pixels are concentrated at a position where the horizontal axis is 0, the white pixels are concentrated at a position where the horizontal axis is 255, and no pixel distribution exists in an interval where the horizontal axis is (0, 255). When the histogram of the texture picture is bimodal, it can be ensured that the pixel values of the texture picture are discontinuous.
In another aspect, the texture picture includes one texture or at least two textures. In the embodiment of the present invention, a texture picture is composed of black pixels and white pixels, and referring to fig. 2 and fig. 3, schematic diagrams of a texture picture composed of one texture and schematic diagrams of a texture picture composed of two textures are respectively given.
S12': determining the position of the verification code;
the position of the verification code can be determined according to a preset initial verification code picture.
The initial authentication code picture includes an authentication code and a background. In the related art, the verification code may also be displayed on the background, and therefore, the specific process of generating the initial verification code picture may refer to the related art, which is not described herein again.
Referring to fig. 4, a schematic diagram of an initial verification code picture is shown, in which 10 digits of 0-9 are used as the verification code, and the background is a white pattern.
The size of the initial captcha picture may be the same as the size of the texture picture, e.g., both the initial captcha picture and the texture picture contain the same number of pixels in the horizontal and vertical directions.
S13': and modifying the pixel value of the texture picture at the position of the verification code to obtain a verification code picture.
Taking the initial verification code picture as the picture shown in fig. 4 as an example, the color of the verification code is black, the color of the background is white, the gray-level value of the black pixel is 0, and the gray-level value of the white pixel is 255.
In the texture picture, corresponding to each pixel, searching whether the position in the initial verification code picture is the position of the verification code, and if so, modifying the pixel value of the pixel in the texture picture. For example, for a certain pixel a in the texture picture, assuming that the position coordinate of a is (x0, y0), looking at the pixel value of the pixel at the (x0, y0) position in the initial verification code picture, if the pixel value is 0, it indicates that the position is the verification code position, i.e. the position of the pixel a in the texture picture is the verification code position, and the pixel value of the pixel a needs to be modified. Conversely, if the pixel value of the pixel at the (x0, y0) location in the initial captcha picture is 255, indicating that the location is not the captcha's location, the pixel value of the pixel at that location in the texture picture is not modified.
In the modification, if the pixel value is large, a set value is decreased, and if the pixel value is small, a set value is increased. For example, the texture picture is composed of black and white patterns, the pixel value of the pixel a in the texture picture needs to be modified, and then a set value is increased when the pixel value of the pixel a is 0, and then decreased when the pixel value of the pixel a is 255.
Further, the setting values for increasing or decreasing at different positions may be the same or different, and the setting value for increasing and the setting value for decreasing may be the same or different. For example, when the pixel values of the pixel a and the pixel B need to be modified, assuming that the pixel values of the pixel a and the pixel B are both 0, the pixel value of the pixel a may be increased by a first value, and the pixel value of the pixel B may be increased by a second value; alternatively, assuming that the pixel values of both pixel a and pixel B are 255, the pixel value of pixel a may be decreased by a first value and the pixel value of pixel B may be decreased by a second value; alternatively, assuming that the pixel value of pixel a is 0 and the pixel value of pixel B is 255, the pixel value of pixel a may be increased by a first value and the pixel value of pixel B may be decreased by a second value.
Since the pixel values of the pixels in the texture picture are modified at the positions of the verification codes, the positions can be relatively significant (significant) relative to the positions of the unmodified pixel values, and the verification codes can be recognized after human eyes see the significant positions.
Fig. 5 and fig. 6 respectively show schematic diagrams of two verification code pictures, where the two verification code pictures are obtained by modifying the pixel values of the texture picture at the verification code position by using the above-described process, and the difference is that fig. 5 illustrates that the texture picture includes one texture, and fig. 6 illustrates that the texture picture includes two textures.
Referring to fig. 5 or fig. 6, the human eye can see the verification code in the verification code picture, and it should be noted that the human eye can see the verification code more clearly on the side due to the display, light refraction and the like. However, since the verification code picture is obtained by modifying the pixel values of the texture picture, the gray value or RGB value of the verification code is no longer continuous, and the machine is difficult to recognize, and the difference between the verification code and the texture as the background is small, which increases the difficulty of machine recognition.
According to the embodiment, the pixel values at the positions corresponding to the verification codes in the texture picture are modified, the pixel value change can occur at the positions of the verification codes in the texture picture, and human eyes can capture the change, so that the verification codes are recognized.
In another embodiment, the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
s71': generating a texture picture and an initial verification code picture;
in this embodiment, it is assumed that the texture picture is a black and white gray-scale picture, the verification code in the initial verification code picture is black, and the background is white.
For specific steps of generating the texture picture and the initial verification code picture, reference may be made to the embodiment shown in fig. 1, which is not described herein again.
S72': selecting a pixel in the texture picture, obtaining the position coordinate of the pixel, and determining whether the gray-level value of the pixel at the position in the initial verification code picture is 0, if so, executing S73 ', otherwise executing S76'.
Assuming that the pixel selected in the texture picture is pixel a and the position coordinate of the pixel is (x0, y0), the step is to determine whether the gray-level value of the pixel at the position (x0, y0) in the initial verification code picture is 0, wherein when the gray-level value is 0, the position is the position where the verification code is located, and otherwise, when the gray-level value is 255, the position is the position where the background is located.
S73': judging whether the gray value of the pixel at the position in the texture picture is 0, if so, executing S74 ', otherwise, executing S75'.
For example, it is determined whether the gradation value of the pixel a is 0.
S74': and increasing the gray value of the pixel at the position by a first set value in the texture picture. After that, S77' is executed.
For example, the gradation value of the pixel a is increased by a first setting value.
S75': and reducing the gray value of the pixel at the position by a second set value in the texture picture. After that, S77' is executed.
For example, the gradation value of the pixel a is decreased by the second setting value.
The first and second set points may be the same or different. The first setting value and the second setting value may be preset values smaller than a setting threshold.
S76': the gray value of the position pixel is kept unchanged in the texture picture.
For example, the gradation value of the pixel a is kept unchanged.
S77': and judging whether the unselected pixels exist in the texture picture, if so, repeatedly executing S72 'and the subsequent steps, and otherwise, executing S78'.
S78': the flow ends.
In the embodiment, the positions of the verification codes in the texture picture are modified, so that the pixels at the positions are more obvious, and the verification codes are identified by human eyes; in addition, by modifying the pixel value, the discontinuous change of the pixel value can be realized, and the machine identification difficulty is increased; moreover, by adopting texture pictures with black and white gray scales, the discontinuous change of pixel values can be further ensured, and the machine identification difficulty is further increased; moreover, the value that is increased or decreased when the pixel value is modified is a smaller value, so that the difference between the verification code and the texture can be reduced, and the machine recognition difficulty can be increased from the other aspect. Therefore, the embodiment can increase the difficulty of identifying the verification code by the machine, reduce the success rate of machine identification, reduce the risk of the verification code being broken by the machine, and ensure the network security.
The embodiment of the invention also provides client equipment which comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power circuit for powering various circuits or devices of the client device; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
s91': displaying a verification code picture, wherein the verification code picture is obtained by modifying the pixel value of the texture picture at the position of a verification code;
s92': receiving a user input;
s93': and verifying the user input according to the verification code picture.
In one embodiment, the texture picture is composed of pixels whose pixel values vary non-continuously.
In another embodiment, the histogram of the texture picture is a bimodal distribution.
In another embodiment, the modifying the pixel values of the texture picture includes:
when the pixel value before modification is larger than a set value, reducing the pixel value; or,
and when the pixel value before modification is smaller than a set value, increasing the pixel value.
In another embodiment, when decreasing the pixel value, the pixel value decreases differently at different locations; or,
when the pixel value is increased, the increased pixel values at different positions are different; or,
when the pixel value is decreased, the decreased pixel value at different positions is the same, when the pixel value is increased, the increased pixel value at different positions is the same, and the decreased pixel value is different from or the same as the increased pixel value.
In another embodiment, the texture picture comprises one texture or at least two textures.
In another embodiment, the texture picture is a gray scale picture or a color picture.
In another embodiment, the location of the verification code is determined as follows:
generating an initial verification code picture according to the presetting, wherein the initial verification code picture comprises a verification code and a background;
and determining the position of the verification code according to the initial verification code picture.
In another embodiment, the size of the initial captcha picture is the same as the size of the texture picture.
The verification code picture used in this embodiment may specifically refer to the verification code picture obtained by using the generation method of the verification code picture, and details are not described here.
In the embodiment, the verification code picture is adopted during verification, the pixel value of the texture picture at the position of the verification code is modified to obtain the verification code picture, discontinuity of the verification code in the adopted verification code picture can be realized, and the difference between the background and the verification code is small, so that the machine identification success rate can be reduced, the risk of cracking the verification code is reduced, and the network security is improved.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (36)

CN201410077527.4A2014-03-042014-03-04The generation method and device and verification method and device of identifying code pictureActiveCN103902875B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201410077527.4ACN103902875B (en)2014-03-042014-03-04The generation method and device and verification method and device of identifying code picture

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201410077527.4ACN103902875B (en)2014-03-042014-03-04The generation method and device and verification method and device of identifying code picture

Publications (2)

Publication NumberPublication Date
CN103902875Atrue CN103902875A (en)2014-07-02
CN103902875B CN103902875B (en)2017-06-20

Family

ID=50994189

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201410077527.4AActiveCN103902875B (en)2014-03-042014-03-04The generation method and device and verification method and device of identifying code picture

Country Status (1)

CountryLink
CN (1)CN103902875B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104158658A (en)*2014-07-182014-11-19上海华泉信息科技有限公司Generation method for dynamic video verification codes
CN106295306A (en)*2016-08-152017-01-04长春工程学院A kind of generation method of picture validation code
CN106326778A (en)*2016-08-102017-01-11广东欧珀移动通信有限公司Picture checking method, server and terminal equipment
CN106920266A (en)*2015-12-282017-07-04腾讯科技(深圳)有限公司The Background Generation Method and device of identifying code
CN108595933A (en)*2018-04-252018-09-28维沃移动通信有限公司A kind of verification information reminding method and mobile terminal
CN109033792A (en)*2018-02-142018-12-18北京梆梆安全科技有限公司A kind of method, terminal and server for verifying user
WO2020134113A1 (en)*2018-12-282020-07-02武汉极意网络科技有限公司Memory, reasoning-based verification code implementation method and apparatus, and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101183458A (en)*2007-12-202008-05-21腾讯科技(深圳)有限公司Picture validation code generating method and device
CN101923702A (en)*2010-08-252010-12-22郝红卫Image valid code generating method
CN102761611A (en)*2012-06-292012-10-31宋超Method for verifying verification code of Cloud platform graph
CN103226810A (en)*2012-01-262013-07-31索尼公司Image processing apparatus and image processing method
JP2013254394A (en)*2012-06-072013-12-19Ntt Data CorpImage verification method, image verification device, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101183458A (en)*2007-12-202008-05-21腾讯科技(深圳)有限公司Picture validation code generating method and device
CN101923702A (en)*2010-08-252010-12-22郝红卫Image valid code generating method
CN103226810A (en)*2012-01-262013-07-31索尼公司Image processing apparatus and image processing method
JP2013254394A (en)*2012-06-072013-12-19Ntt Data CorpImage verification method, image verification device, and program
CN102761611A (en)*2012-06-292012-10-31宋超Method for verifying verification code of Cloud platform graph

Cited By (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104158658A (en)*2014-07-182014-11-19上海华泉信息科技有限公司Generation method for dynamic video verification codes
CN104158658B (en)*2014-07-182018-11-16上海华泉信息科技有限公司A kind of video dynamic authentication code generating method
CN106920266A (en)*2015-12-282017-07-04腾讯科技(深圳)有限公司The Background Generation Method and device of identifying code
CN106920266B (en)*2015-12-282019-11-05腾讯科技(深圳)有限公司The Background Generation Method and device of identifying code
CN106326778A (en)*2016-08-102017-01-11广东欧珀移动通信有限公司Picture checking method, server and terminal equipment
CN106295306A (en)*2016-08-152017-01-04长春工程学院A kind of generation method of picture validation code
CN106295306B (en)*2016-08-152019-02-01长春工程学院A kind of generation method of picture validation code
CN109033792A (en)*2018-02-142018-12-18北京梆梆安全科技有限公司A kind of method, terminal and server for verifying user
CN108595933A (en)*2018-04-252018-09-28维沃移动通信有限公司A kind of verification information reminding method and mobile terminal
CN108595933B (en)*2018-04-252019-12-17维沃移动通信有限公司 A verification information prompt method and mobile terminal
WO2020134113A1 (en)*2018-12-282020-07-02武汉极意网络科技有限公司Memory, reasoning-based verification code implementation method and apparatus, and device

Also Published As

Publication numberPublication date
CN103902875B (en)2017-06-20

Similar Documents

PublicationPublication DateTitle
CN103902875B (en)The generation method and device and verification method and device of identifying code picture
JP6397977B2 (en) Dot pattern, dot pattern forming medium, dot pattern image data generating program, dot pattern forming device, optical device, optical reader, information input / output device, dot pattern reader
US8805077B2 (en)Subject region detecting apparatus
CN104700062B (en) A method and device for identifying two-dimensional codes
CN105046254A (en)Character recognition method and apparatus
CN112396050B (en)Image processing method, device and storage medium
US8923610B2 (en)Image processing apparatus, image processing method, and computer readable medium
JP5756322B2 (en) Information processing program, information processing method, information processing apparatus, and information processing system
CN104239873A (en)Image processing apparatus and processing method
US11200437B2 (en)Method for iris-based living body detection and related products
US8953893B2 (en)System and method to determine feature candidate pixels of an image
JP2017130794A (en)Information processing apparatus, evaluation chart, evaluation system, and performance evaluation method
US9443138B2 (en)Apparatus and method for recognizing hand shape using finger pattern
CN113239817A (en)Fingerprint template acquisition method and related device
CN110992328A (en) Dark spot detection method and device
JP7668473B2 (en) Information processing device, information processing method, and program
CN106530286A (en)Method and device for determining definition level
CN111870950B (en)Game control display control method and device and electronic equipment
EP3309660A1 (en)Method for detecting input device, and detection device
CN106407888A (en) Fingerprint identification method, device and mobile terminal
CN114694157A (en)Table structured detection method, system, terminal and storage medium
KR20210085742A (en)Electronic apparatus capable of recognizing text included in an image captured by a camera and the method thereof
CN116894843B (en) Pu'er tea information traceability method based on perceptual hash algorithm and blockchain
CN117036206B (en) A method for determining the degree of image jaggedness and related electronic equipment
CN107392205B (en)Code value table generation method and device of remote controller

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp