CN113158171A - Verification code generation method, verification code authentication method, electronic device, and medium - Google Patents

Verification code generation method, verification code authentication method, electronic device, and medium Download PDF

Info

Publication number
CN113158171A
CN113158171A CN202110578647.2A CN202110578647A CN113158171A CN 113158171 A CN113158171 A CN 113158171A CN 202110578647 A CN202110578647 A CN 202110578647A CN 113158171 A CN113158171 A CN 113158171A
Authority
CN
China
Prior art keywords
array
verification code
target
generating
picture
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.)
Pending
Application number
CN202110578647.2A
Other languages
Chinese (zh)
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.)
Chengdu Youxin Chuangzhan Information Technology Co ltd
Original Assignee
Chengdu Youxin Chuangzhan Information 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 Chengdu Youxin Chuangzhan Information Technology Co ltd filed Critical Chengdu Youxin Chuangzhan Information Technology Co ltd
Priority to CN202110578647.2A priority Critical patent/CN113158171A/en
Publication of CN113158171A publication Critical patent/CN113158171A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2133Verifying human interaction, e.g., Captcha

Abstract

The application relates to the field of communication security, and provides a verification code generation method, a verification code authentication method, an electronic device and a medium, wherein the verification code generation method comprises the following steps: responding to an authentication request sent by a terminal, and determining a target operator in a preset operator; generating a first array and a second array matched with the first array; according to the operation type corresponding to the target operator, operating the first array and the second array to obtain a target array, wherein the target array is used for verifying the verification content input by the user through the terminal; and generating a picture verification code according to the first array, the second array and the target operator. The method provided by the application improves the security of verification code authentication, thereby improving the security of communication.

Description

Verification code generation method, verification code authentication method, electronic device, and medium
Technical Field
The present application relates to the field of communication security, and in particular, to a verification code generation method, a verification code authentication method, an electronic device, and a medium.
Background
With the development of science and technology, information security becomes a problem that cannot be ignored, and performing security verification is a common means for ensuring information security. At present, the security verification is performed through a short message verification code which is a common digital verification code and generally consists of 4 to 6 random numbers. After receiving the short message, the user inputs a 4-6 digit verification code in the browser or the app, and verification of the verification code can be completed. This verification is too simple to be flexible and is not sufficient to handle some complex verification situations. Meanwhile, a large amount of illegal software or trojans on the market can directly acquire the verification codes in the short messages received by the user equipment, so that the short message verification mode has great potential safety hazards.
Disclosure of Invention
In view of the above, the present disclosure is directed to a verification code generation method, a verification code authentication method, an electronic device and a medium, and aims to solve the technical problem of how to improve the security of verification code authentication.
A first aspect of the present application provides a verification code generation method, including:
responding to an authentication request sent by a terminal, and determining a target operator in a preset operator;
generating a first array and a second array matched with the first array;
according to the operation type corresponding to the target operator, operating the first array and the second array to obtain a target array, wherein the target array is used for verifying the verification content input by the user through the terminal;
and generating a picture verification code according to the first array, the second array and the target operator.
According to an optional embodiment of the present application, the generating a first array and a second array matching the first array comprises:
and determining the operation type of the target operator, and generating a first array and a second array matched with the first array according to the operation type.
According to an optional embodiment of the present application, the generating a first array and a second array matched to the first array according to the operation type includes:
when the operation type is a first type, generating a first array according to a first database, and generating a second array matched with the first array according to a second database;
and when the operation type is a second type, generating a first array according to a third database, and generating a second array matched with the first array according to the first database.
According to an optional embodiment of the present application, the generating a picture verification code according to the first array, the second array, and the target operator comprises:
and generating a picture verification code according to the first array, the second array and the target operator according to a preset typesetting rule, wherein the numbers in the first array and the numbers in the second array are typeset correspondingly.
According to an optional embodiment of the present application, the generating a picture verification code according to the first array, the second array, and the target operator comprises:
performing interference processing on the first array, the second array and the target operator, and generating a picture verification code according to the first array, the second array and the target operator after the interference processing;
wherein the interference treatment comprises a random color changing floating treatment and/or a random interference line treatment.
According to an optional embodiment of the present application, after obtaining the target array, the method further includes:
acquiring a user identifier corresponding to the authentication request;
and storing the user identification and the target array into a preset storage space.
A second aspect of the present application provides a verification code authentication method, including:
responding to an authentication request sent by a terminal, and sending a picture verification code to the terminal;
acquiring verification content input by a user through the terminal;
comparing the verification content with a target array corresponding to the picture verification code;
and judging whether the user passes the verification according to the comparison result, wherein the picture verification code and the target array are obtained by the verification code generation method.
According to an optional embodiment of the present application, the verification code authentication method comprises:
presetting expiration time;
timing after the picture verification code is sent to the terminal to obtain timing time;
and when the timing time is greater than the expiration time, deleting the target array corresponding to the picture verification code.
A third aspect of the present application provides an electronic device, comprising:
a memory to store at least one instruction;
a processor configured to implement the captcha generation method as described above or the captcha authentication method as described above when the at least one instruction is executed.
A fourth aspect of the present application provides a computer-readable storage medium having stored therein at least one instruction which, when executed by a processor, implements a captcha generation method as described above or a captcha authentication method as described above.
According to the technical scheme, the target operator is determined in the preset operator by responding to the authentication request sent by the terminal, and the first array and the second array matched with the first array are generated; and according to the operation type corresponding to the target operator, the first array and the second array are operated to obtain a target array, the target array is used for verifying verification contents input by a user through the terminal, and finally, a picture verification code is generated according to the first array, the second array and the target operator.
Drawings
Fig. 1 is a schematic flow chart of a verification code generation method according to an embodiment of the present application;
fig. 2 is a scene schematic diagram of a picture verification code according to an embodiment of the present application;
fig. 3 is a schematic view of another scene of a picture verification code according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a verification code authentication method according to an embodiment of the present application;
fig. 5 is a schematic view of a scenario of authentication information according to an embodiment of the present application;
fig. 6 is a schematic block diagram of a structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The schematic flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The embodiment of the application provides a verification code generation method, a verification code authentication method, electronic equipment and a computer readable storage medium.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flow chart of a verification code generation method according to an embodiment of the present disclosure. The verification code generation method can be applied to terminal equipment or a server, the terminal equipment can be electronic equipment such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and wearable equipment, and the server can be a single server or a server cluster consisting of a plurality of servers.
As shown in fig. 1, the verification code generation method specifically includes steps S11 to S14, and the order of the steps in the schematic flowchart may be changed or some steps may be omitted according to different requirements.
Step S11, in response to the authentication request sent by the terminal, determining a target operator among preset operators.
For example, a plus sign and a minus sign may be used as preset operators. And randomly selecting one operator from the preset operators, and determining the operator as a target operator.
And step S12, generating a first array and a second array matched with the first array.
Wherein the first array and the second array comprise numbers, and the number of the numbers in the first array is the same as the number of the numbers in the second array.
In some embodiments, the generating a first array and a second array that matches the first array comprises:
and determining the operation type of the target operator, and generating a first array and a second array matched with the first array according to the operation type.
Under different operation types, the values of the first array and the second array are different, so that carry or borrow operation is avoided. For example, when the operation type of the target operator is addition, to avoid carry operation, the numbers in the first array are all natural numbers in 0-5, and the numbers in the second array are all natural numbers in 0-4; when the operation type of the target operator is subtraction, in order to avoid borrow operation, the numbers in the first array are all natural numbers in 5-9, and the numbers in the second array are all natural numbers in 0-4.
In some embodiments, the generating a first array and a second array matching the first array according to the operation type includes:
when the operation type is a first type, generating a first array according to a first database, and generating a second array matched with the first array according to a second database;
and when the operation type is a second type, generating a first array according to a third database, and generating a second array matched with the first array according to the first database.
A plurality of databases, such as a first database, a second database, and a third database, are preset. The first database stores numbers of {0,1,2,3,4,5}, the second database stores numbers of {0,1,2,3,4}, and the third database stores numbers of {5,6,7,8,9 }.
And when the operation type is a first type, namely when the operation type is an addition type, randomly selecting numbers in a first database according to the preset number to generate a first array, and randomly selecting numbers in a second database according to the preset number to generate a second array matched with the first array.
For example, when the operation type is a first type, that is, an addition type, the preset number is 6, 6 numbers are randomly selected from the first database to generate a first array, for example, the first array is {5,3,1,2,3,1}, and 6 numbers are randomly selected from the second database to generate a second array, for example, the second array is {3,2,4,1,2,3 }. And the second array is matched with the first array, namely, a corresponding relation exists between the first array and the second array. For example, in the first array {5,3,1,2,3,1} and the second array {3,2,4,1,2,3}, 5 of the first array corresponds to 3 of the second array, 3 of the first array corresponds to 2 of the second array, 1 of the first array corresponds to 4 of the second array, 2 of the first array corresponds to 1 of the second array, 3 of the first array corresponds to 2 of the second array, and 1 of the first array corresponds to 3 of the second array.
And when the operation type is a first type, namely when the operation type is an addition type, randomly selecting numbers in a first database according to the preset number to generate a first array, and randomly selecting numbers in a second database according to the preset number to generate a second array matched with the first array.
For example, when the operation type is a second type, that is, a subtraction type, the predetermined number is 6, 6 numbers are randomly selected in the third database to generate a first array, for example, the first array is {5,7,7,9,6,8}, and 6 numbers are randomly selected in the first database to generate a second array, for example, the second array is {3,2,4,1,2,3 }. And the second array is matched with the first array, namely, a corresponding relation exists between the first array and the second array. For example, in the first array {5,7,7,9,6,8} and the second array {3,2,4,1,2,3}, 5 of the first array corresponds to 3 of the second array, 7 of the first array corresponds to 2 of the second array, 7 of the first array corresponds to 4 of the second array, 9 of the first array corresponds to 1 of the second array, 6 of the first array corresponds to 2 of the second array, and 8 of the first array corresponds to 3 of the second array.
And step S13, according to the operation type corresponding to the target operator, operating the first array and the second array to obtain a target array, wherein the target array is used for verifying the verification content input by the user through the terminal.
And operating the first array and the second array according to an operation type corresponding to the target operator, such as an addition type or a subtraction type. For example, the first array is used as an addend, the second array is used as an addend, the first array is used as a subtrahend, and the second array is used as a subtrahend to perform subtraction.
And performing operation according to the corresponding relation between the first array and the second array.
For example, the first array is {5,3,1,2,3,1}, the second array is {3,2,4,1,2,3}, the first array is taken as an addend, and the second array is taken as an addend to perform addition operation, wherein 5 of the first array is added to 3 of the second array, 3 of the first array is added to 2 of the second array, 1 of the first array is added to 4 of the second array, 2 of the first array is added to 1 of the second array, 3 of the first array is added to 2 of the second array, 1 of the first array is added to 3 of the second array, and the obtained target array is {8,5,5,3,5,4 }.
For example, the first array is {5,7,7,9,6,8}, the second array is {3,2,4,1,2,3}, the first array is taken as a subtracted number, and the second array is taken as a subtracted number to perform subtraction operation, wherein 5 of the first array is subtracted from 3 of the second array, 7 of the first array is subtracted from 2 of the second array, 7 of the first array is subtracted from 4 of the second array, 9 of the first array is subtracted from 1 of the second array, 6 of the first array is subtracted from 2 of the second array, 8 of the first array is subtracted from 3 of the second array, and the obtained target array is {2,5,3,8,4,5 }.
After obtaining the target array in some embodiments, the method further includes:
acquiring a user identifier corresponding to the authentication request;
and storing the user identification and the target array into a preset storage space.
For example, the user identifier and the target array may be stored in a memory of a server, such as session or redis.
The user identification can be a mobile phone number of a user, and the user identification and the target array are stored in a preset storage space together. When a user inputs verification information through the terminal, the target array and the verification information are conveniently called for verification, the verification speed is increased, and therefore the verification code authentication speed is improved.
And step S14, generating a picture verification code according to the first array, the second array and the target operator.
Illustratively, the first array, the second array and the target operator are used for generating a picture verification code with a preset size. For example, a picture with a length W and a width H is generated, wherein the values of W and H can be customized according to requirements.
In some embodiments, the generating a picture verification code from the first array, the second array, and the target operator comprises:
and generating a picture verification code according to the first array, the second array and the target operator according to a preset typesetting rule, wherein the numbers in the first array and the numbers in the second array are typeset correspondingly.
Illustratively, a layout rule is preset, where the layout rule includes a layout region corresponding to the first array, a layout region corresponding to the second array, and a layout region corresponding to the target operator. And after generating a picture verification code according to the first array, the second array and the target operator according to a preset typesetting rule, typesetting the numbers in the first array and the numbers in the second array correspondingly.
For example, the first array is {5,3,1,2,3,1}, the second array is {3,2,4,1,2,3}, after the layout is performed according to the preset rule, as shown in fig. 2,5 of the first array is laid out corresponding to 3 of the second array, 3 of the first array is laid out corresponding to 2 of the second array, 1 of the first array is laid out corresponding to 4 of the second array, 2 of the first array is laid out corresponding to 1 of the second array, 3 of the first array is laid out corresponding to 2 of the second array, and 1 of the first array is laid out corresponding to 3 of the second array.
In some embodiments, the generating a picture verification code from the first array, the second array, and the target operator comprises:
performing interference processing on the first array, the second array and the target operator, and generating a picture verification code according to the first array, the second array and the target operator after the interference processing;
wherein the interference treatment comprises a random color changing floating treatment and/or a random interference line treatment.
And interference processing is carried out on the first array, the second array and the target operator, so that the difficulty of reading the picture verification code can be increased, and the safety of the verification code is further improved.
As shown in fig. 3, fig. 3 is a scene schematic diagram of a picture verification code generated according to the first array, the second array and the target operator after the interference processing in this embodiment.
In the verification code generation method provided in the foregoing embodiment, to-be-processed data and operating conditions of a plurality of accelerators are obtained, and a plurality of target accelerators are determined in the plurality of accelerators according to the to-be-processed data and the operating conditions; then, segmenting the data to be processed according to the running conditions of the target accelerators to obtain a plurality of sub data to be processed; and finally, each sub-to-be-processed data is sent to the corresponding target accelerator for processing, the to-be-processed data is segmented according to the operating conditions of the plurality of target accelerators, it is determined that each target accelerator can finish processing the corresponding sub-to-be-processed data, and the acceleration efficiency is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of a verification code authentication method according to an embodiment of the present disclosure. The verification code authentication method can be applied to terminal equipment or a server, the terminal equipment can be electronic equipment such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and wearable equipment, and the server can be a single server or a server cluster consisting of a plurality of servers.
The verification code authentication method specifically includes steps S41 to S44, and the order of the steps in the schematic flowchart may be changed or some of the steps may be omitted according to different requirements.
And step S41, responding to the authentication request sent by the terminal, and sending the picture verification code to the terminal.
The picture verification code is obtained by the verification code generation method.
For example, a verification code template may be preset, and the picture verification code and the verification code template may be spliced to generate verification information. The authentication information may be as shown in fig. 5.
Illustratively, the authentication information may be sent to the terminal through a mobile, internet or telecommunication business. Or the verification information can be sent to the terminal in a Wi-Fi mode, a 4G/5G mode and the like. The transmission method is not limited at all.
And step S42, acquiring the verification content input by the user through the terminal.
And acquiring verification content, such as a verification array, sent by a user through the terminal.
And step S43, comparing the verification content with the target array corresponding to the picture verification code.
Wherein the target array is obtained by the verification code generation method. The target array may be stored in a preset storage space, and the preset storage space may be a memory of a server, such as a session or a redis.
For example, the target array may be stored in a preset storage space together with the user identifier corresponding to the authentication request. And calling the target array corresponding to the picture verification code in the preset storage space conveniently and subsequently according to the user identification corresponding to the authentication request.
And comparing the verification array with a target array corresponding to the picture verification code to obtain a comparison result.
And step S44, judging whether the user passes the verification according to the comparison result.
Illustratively, when the comparison result is that the target array is consistent with the verification array, judging that the user passes the verification; and when the comparison result is that the target array is inconsistent with the verification array, judging that the user does not pass the verification.
In some embodiments, the passcode authentication method includes:
presetting expiration time;
timing after the picture verification code is sent to the terminal to obtain timing time;
and when the timing time is greater than the expiration time, deleting the target array corresponding to the picture verification code.
And setting expiration time, starting timing after the picture verification code is sent to the terminal, and deleting the target array corresponding to the picture verification code when the timing time exceeds the expiration time. And after the target array corresponding to the picture verification code is deleted, the picture verification code is invalid. Namely, after the target array corresponding to the picture verification code is deleted, even if the verification content input by the user through the terminal is consistent with the target array, the verification is still judged to be failed.
In the verification code authentication method provided by the above embodiment, the picture verification code is sent to the terminal by responding to the authentication request sent by the terminal; acquiring verification content input by a user through the terminal; comparing the verification content with a target array corresponding to the picture verification code; whether the user passes the verification is judged according to the comparison result, the picture verification code in the application has operation, the verification code corresponding to the picture verification code cannot be directly obtained even if the picture verification code sent to the user is scanned, violent cracking of illegal programs such as Trojan horses is effectively prevented, the safety of the verification code is improved, and therefore the safety of verification code authentication is improved.
Referring to fig. 6, fig. 6 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 60 may be a server or a terminal device.
The Network in which the electronic device 60 is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
As shown in fig. 6, the electronic device 60 includes a communication interface 601, a memory 602, a processor 603, an Input/Output (I/O) interface 604, and a bus 605. The processor 603 is coupled to the communication interface 601, the memory 602, and the I/O interface 604, respectively, via the bus 605.
The communication interface 601 is used for communication. The communication interface 601 may be an existing interface of the electronic device 60 or may be a newly established interface of the electronic device 60. Communication interface 601 may be a Network interface such as a Wireless Local Area Network (WLAN) interface, a cellular Network communication interface, a combination thereof, or the like.
The memory 602 may be used to store an operating system and computer programs. For example, the memory 602 stores a program corresponding to the above-described verification code generation method or a program corresponding to the above-described verification code authentication method.
It should be understood that the memory 602 may include a program storage area and a data storage area. Wherein, the storage program area can be used for storing an operating system, an application program required by at least one method (such as a verification code generation method, a verification code authentication method, etc.), and the like; the storage data area may store data (such as sub-pending data, etc.) created according to the use of the electronic device 60, and the like. In addition, the memory 602 may include volatile memory and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other storage device.
The processor 603 provides computing and control capabilities that support the operation of the overall computer device. For example, the processor 603 is configured to execute the computer program stored in the memory 602 to implement the steps of the verification code generation method described above or the steps of the verification code authentication method described above.
It should be understood that the Processor 603 is a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The I/O interface 604 is used to provide a channel for user input or output, for example, the I/O interface 604 may be used to connect various input and output devices (mouse, keyboard, 3D touch device, etc.), displays, so that a user may enter information, or visualize information.
The bus 605 is used at least to provide a channel for communication among the communication interface 601, the memory 602, the processor 603, and the I/O interface 604 in the electronic device 60.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, when the processor 603 executes the computer program stored in the memory 602 to implement the verification code generation method, the following steps are implemented:
responding to an authentication request sent by a terminal, and determining a target operator in a preset operator;
generating a first array and a second array matched with the first array;
according to the operation type corresponding to the target operator, operating the first array and the second array to obtain a target array, wherein the target array is used for verifying the verification content input by the user through the terminal;
and generating a picture verification code according to the first array, the second array and the target operator.
Specifically, the specific implementation method of the instruction by the processor 603 may refer to the description of the relevant steps in the foregoing verification code generation method embodiment, which is not described herein again.
In one embodiment, the processor 603 executes the computer program stored in the memory 602 to implement the verification code authentication method, and the following steps are implemented:
responding to an authentication request sent by a terminal, and sending a picture verification code to the terminal;
acquiring verification content input by a user through the terminal;
comparing the verification content with a target array corresponding to the picture verification code;
and judging whether the user passes the verification or not according to the comparison result.
Wherein the picture verification code and the target array are obtained by the verification code generation method as described above.
Specifically, the processor 603 may refer to the description of the relevant steps in the foregoing verification code authentication method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, where the computer program includes program instructions, and a method implemented when the program instructions are executed may refer to various embodiments of a method for generating a verification code of the present application or various embodiments of a method for authenticating a verification code of the present application.
The computer-readable storage medium may be an internal storage unit of the electronic device according to the foregoing embodiment, for example, a hard disk or a memory of the electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to use of the electronic device, and the like.
The electronic device and the computer-readable storage medium provided by the foregoing embodiments may determine a target operator in a preset operator by responding to an authentication request sent by a terminal, and generate a first array and a second array matched with the first array; and according to the operation type corresponding to the target operator, the first array and the second array are operated to obtain a target array, the target array is used for verifying verification contents input by a user through the terminal, and finally, a picture verification code is generated according to the first array, the second array and the target operator.
Or the electronic device and the computer-readable storage medium provided in the foregoing embodiments may send the picture verification code to the terminal by responding to an authentication request sent by the terminal; acquiring verification content input by a user through the terminal; comparing the verification content with a target array corresponding to the picture verification code; whether the user passes the verification is judged according to the comparison result, the picture verification code in the application has operation, the verification code corresponding to the picture verification code cannot be directly obtained even if the picture verification code sent to the user is scanned, violent cracking of illegal programs such as Trojan horses is effectively prevented, the safety of the verification code is improved, and therefore the safety of verification code authentication is improved.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A verification code generation method, characterized by comprising:
responding to an authentication request sent by a terminal, and determining a target operator in a preset operator;
generating a first array and a second array matched with the first array;
according to the operation type corresponding to the target operator, operating the first array and the second array to obtain a target array, wherein the target array is used for verifying the verification content input by the user through the terminal;
and generating a picture verification code according to the first array, the second array and the target operator.
2. The captcha generation method of claim 1, wherein generating a first array and a second array that matches the first array comprises:
and determining the operation type of the target operator, and generating a first array and a second array matched with the first array according to the operation type.
3. The captcha generating method of claim 2, wherein the generating a first array and a second array matching the first array according to the operation type comprises:
when the operation type is a first type, generating a first array according to a first database, and generating a second array matched with the first array according to a second database;
and when the operation type is a second type, generating a first array according to a third database, and generating a second array matched with the first array according to the first database.
4. The captcha generation method of claim 1, wherein the generating a picture captcha according to the first array, the second array, and the target operator comprises:
and generating a picture verification code according to the first array, the second array and the target operator according to a preset typesetting rule, wherein the numbers in the first array and the numbers in the second array are typeset correspondingly.
5. The method of claim 1 or 4, wherein the generating a picture validation code according to the first array, the second array, and the target operator comprises:
performing interference processing on the first array, the second array and the target operator, and generating a picture verification code according to the first array, the second array and the target operator after the interference processing;
wherein the interference treatment comprises a random color changing floating treatment and/or a random interference line treatment.
6. The method of claim 1, wherein after obtaining the target array, the method further comprises:
acquiring a user identifier corresponding to the authentication request;
and storing the user identification and the target array into a preset storage space.
7. A verification code authentication method, characterized in that the verification code authentication method comprises:
responding to an authentication request sent by a terminal, and sending a picture verification code to the terminal;
acquiring verification content input by a user through the terminal;
comparing the verification content with a target array corresponding to the picture verification code;
and judging whether the user passes the verification according to the comparison result, wherein the picture verification code and the target array are obtained by the verification code generation method of any one of claims 1 to 6.
8. The captcha authentication method of claim 7, wherein the captcha authentication method comprises:
presetting expiration time;
timing after the picture verification code is sent to the terminal to obtain timing time;
and when the timing time is greater than the expiration time, deleting the target array corresponding to the picture verification code.
9. An electronic device, comprising a memory and a processor;
the memory is to store at least one instruction;
the processor is configured to implement the captcha generation method of any one of claims 1 to 6 or the captcha authentication method of claim 7 or 8 when executing the at least one instruction.
10. A computer-readable storage medium having stored therein at least one instruction which, when executed by a processor, implements a captcha generation method as claimed in any one of claims 1 to 6 or a captcha authentication method as claimed in claim 7 or 8.
CN202110578647.2A 2021-05-26 2021-05-26 Verification code generation method, verification code authentication method, electronic device, and medium Pending CN113158171A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110578647.2A CN113158171A (en) 2021-05-26 2021-05-26 Verification code generation method, verification code authentication method, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110578647.2A CN113158171A (en) 2021-05-26 2021-05-26 Verification code generation method, verification code authentication method, electronic device, and medium

Publications (1)

Publication Number Publication Date
CN113158171A true CN113158171A (en) 2021-07-23

Family

ID=76877580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110578647.2A Pending CN113158171A (en) 2021-05-26 2021-05-26 Verification code generation method, verification code authentication method, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN113158171A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316120A (en) * 2011-10-17 2012-01-11 北京信息科技大学 Dynamic password lock based on network privacy protection
CN104200140A (en) * 2014-09-28 2014-12-10 北京奇虎科技有限公司 Method and device providing verification code
CN104320767A (en) * 2014-11-10 2015-01-28 吴东辉 Short message verification system and method
CN105024819A (en) * 2015-05-29 2015-11-04 北京中亦安图科技股份有限公司 Multifactor authentication method and system based on mobile terminal
CN105450657A (en) * 2015-12-16 2016-03-30 广州天懋信息系统有限公司 Dynamic password authentication method and system based on preset value and dynamic verification code combination
CN106612277A (en) * 2016-12-09 2017-05-03 武汉斗鱼网络科技有限公司 Method and system for realizing CAPTCHA verification using cipher disk
CN107454095A (en) * 2017-08-23 2017-12-08 深圳市优品壹电子有限公司 A kind of method and device for preventing machine from logging in
CN107590371A (en) * 2017-08-23 2018-01-16 深圳市优品壹电子有限公司 The terminal device and Related product that anti-machine logs in
CN110677239A (en) * 2019-08-26 2020-01-10 深圳市共进电子股份有限公司 Verification code generation method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316120A (en) * 2011-10-17 2012-01-11 北京信息科技大学 Dynamic password lock based on network privacy protection
CN104200140A (en) * 2014-09-28 2014-12-10 北京奇虎科技有限公司 Method and device providing verification code
CN104320767A (en) * 2014-11-10 2015-01-28 吴东辉 Short message verification system and method
CN105024819A (en) * 2015-05-29 2015-11-04 北京中亦安图科技股份有限公司 Multifactor authentication method and system based on mobile terminal
CN105450657A (en) * 2015-12-16 2016-03-30 广州天懋信息系统有限公司 Dynamic password authentication method and system based on preset value and dynamic verification code combination
CN106612277A (en) * 2016-12-09 2017-05-03 武汉斗鱼网络科技有限公司 Method and system for realizing CAPTCHA verification using cipher disk
CN107454095A (en) * 2017-08-23 2017-12-08 深圳市优品壹电子有限公司 A kind of method and device for preventing machine from logging in
CN107590371A (en) * 2017-08-23 2018-01-16 深圳市优品壹电子有限公司 The terminal device and Related product that anti-machine logs in
CN110677239A (en) * 2019-08-26 2020-01-10 深圳市共进电子股份有限公司 Verification code generation method and device

Similar Documents

Publication Publication Date Title
CN108269062B (en) Electronic contract making method, device, equipment and medium based on H5
CN113472774B (en) Account login-free method, system, device and computer readable storage medium
CN110661779B (en) Block chain network-based electronic certificate management method, system, device and medium
CN110768784A (en) Password transmission method, device, computer equipment and storage medium
CN112183496A (en) Secondary encryption method, device and equipment for face recognition information and storage medium
CN112507326A (en) SM3 hash algorithm-based password information encryption method and device and computer equipment
CN114238874A (en) Digital signature verification method and device, computer equipment and storage medium
CN111651749A (en) Method and device for finding account based on password, computer equipment and storage medium
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN108200075B (en) Identity authentication method, system, terminal and storage medium
WO2021169469A1 (en) Voiceprint data processing method and apparatus, computer device, and storage medium
CN111382425A (en) Application installation management method under multi-signature mechanism, intelligent terminal and storage medium
CN111628863A (en) Data signature method and device, electronic equipment and storage medium
CN113158171A (en) Verification code generation method, verification code authentication method, electronic device, and medium
CN111447178A (en) Access control method, system and computing device
CN114584324B (en) Identity authorization method and system based on block chain
CN108241732B (en) Electronic device, information processing method, and storage medium
US20080301654A1 (en) Program processing apparatus, program processing method and computer readable information recording medium
CN113254951B (en) Data processing method and computing device
CN112287324B (en) Picture verification method, server, terminal device and storage medium
CN115701607A (en) Rule updating method based on block chain, electronic equipment and storage medium
CN110995437B (en) ETC system-based user information input method, device, equipment and storage medium
CN114614972A (en) Data alignment method, system, electronic device and storage medium
CN114239004A (en) Electronic signature generation method and device, computer equipment and storage medium
CN109688158B (en) Financial execution chain authentication method, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210723

RJ01 Rejection of invention patent application after publication