Verification code encryption method, electronic device and storage medium

By encrypting and decrypting the verification code with random keys, the problem of insufficient difficulty in stealing the verification code is solved, efficient encryption of the verification code is achieved, the risk of identity counterfeiting and property loss is reduced, and information security is improved.

CN115765976BActive Publication Date: 2024-09-10CHINA FINANCIAL CERTIFICATION AUTHORITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210964869.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-11
Publication Date
2024-09-10
Estimated Expiration
2042-08-11

AI Technical Summary

Technical Problem

Existing verification codes are easily intercepted by Trojans and stolen by telecom fraudsters, leading to identity forgery and property losses. Encryption is urgently needed to make theft more difficult.

Method used

By obtaining the verification code and encrypting it with a random key, the encrypted verification code is generated. The user enters the encrypted verification code in the application for verification, and decrypts and verifies it on the application server to ensure that only those who hold the correct random key The user can complete the verification.

Benefits of technology

It effectively increases the difficulty of verification code theft, reduces the risk of property loss, and improves information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115765976B
    Figure CN115765976B
Patent Text Reader

Abstract

The present application discloses a verification code encryption method, an electronic device, and a storage medium. The method includes: obtaining a first verification code, the first verification code being verification information generated in response to a verification code input event of a target application; encrypting the first verification code by a random key to obtain a second verification code, wherein the random key is key information generated in response to a verification code input event, and the second verification code is information to be input for the verification code input event. The solution provided by the present application can increase the difficulty of verification code theft and reduce the risk of property loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of encryption processing, and in particular to a verification code encryption method, an electronic device and a storage medium. Background Art

[0002] In the era of mobile Internet, application developers and users generally pursue convenience and efficiency, and verification codes have become the most common way of identity authentication. However, the current verification code faces the risk of being intercepted by Trojan programs, which makes it easy for a third party to obtain the verification code and successfully log in to the application on another mobile phone to obtain services by impersonating the user's identity. For example, in some financial service applications, transactions and transfers can be made by knowing the user's verification code. In addition, if the user encounters telecommunications fraud and provides the verification code to the fraudster, it will also cause property losses. Therefore, it is urgent to develop technology to encrypt the verification code to increase the difficulty of stealing the verification code, thereby reducing the risk of property losses. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present application provides a verification code encryption method, an electronic device and a storage medium. The verification code encryption method can increase the difficulty of verification code theft and reduce the risk of property loss.

[0004] The first aspect of the present application provides a verification code encryption method, comprising: obtaining a first verification code, the first verification code being verification information generated in response to a verification code input event of a target application; encrypting the first verification code by a random key to obtain a second verification code, wherein the random key is key information generated in response to the verification code input event, and the second verification code is information to be input for the verification code input event.

[0005] In one implementation, before encrypting the first verification code with a random key: obtain a random key sent by an application server; or generate a random key according to the length of the character space of the information to be input.

[0006] In one embodiment, generating a random key based on the character space length of a verification code in a verification code input event includes: creating a key array, the array length of the key array is consistent with the character space length; arranging the element data in the key array in ascending order of the data type corresponding to the element data; traversing the key array; creating a random integer r each time each element data in the key array is traversed; exchanging the currently traversed element data with the rth element data in the key array; until all the element data in the key array are traversed, a random key is obtained.

[0007] In one implementation, encrypting the first verification code with a random key to obtain the second verification code includes: determining the number n of characters in the first verification code; and using the first n element data of the random key as the second verification code.

[0008] In one implementation, obtaining the first verification code includes: intercepting a verification code text message received by the terminal; and extracting the first verification code from the verification code text message.

[0009] In one embodiment, the verification code encryption method also includes, after encrypting the first verification code with a random key to obtain a second verification code: displaying the second verification code on the interface of the target application, so that the application user can respond to the verification code input event and input the second verification code into the verification code input box of the target application; obtaining the second verification code input by the application user, decrypting the second verification code input by the application user to obtain a third verification code; and sending the third verification code to the application server for verification.

[0010] In one embodiment, the verification code encryption method also includes: before intercepting the verification code SMS received by the mobile terminal, receiving an anti-counterfeiting random number issued by the application server in response to a verification code input event; after extracting the first verification code from the verification code SMS, sending the anti-counterfeiting random number to the application server for storage, and using the anti-counterfeiting random number as an authentication random number in the application server; sending the third verification code and the anti-counterfeiting random number to the application server; allowing the application server to compare the third verification code with the first verification code, and compare the anti-counterfeiting random number with the authentication random number.

[0011] In one embodiment, the second verification code input by the application user is decrypted to obtain a third verification code, including: comparing the second verification code input by the application user with a random key to determine the data position of n element data that form the second verification code input by the application user in the random key; and obtaining the third verification code based on the data position and the random key matching.

[0012] A second aspect of the present application provides an electronic device, including:

[0013] Processor; and

[0014] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.

[0015] A third aspect of the present application provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0016] The technical solution provided by this application may have the following beneficial effects:

[0017] A second verification code is obtained by obtaining a first verification code and encrypting the first verification code with a random key, wherein the first verification code is verification information sent in response to a verification code input event of a target application, and the second verification code is information to be input for the verification code input event, so that the user can complete the verification only after entering the encrypted second verification code. Even if a Trojan program or telecommunications fraud steals the real verification code for input, the authentication cannot be completed, thereby increasing the difficulty of stealing a valid verification code, reducing the risk of property loss, and improving information security.

[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0020] Figure 1 It is a flowchart of the first embodiment of the verification code encryption method shown in the embodiment of the present application;

[0021] Figure 2 It is a flow chart of Embodiment 2 of the verification code encryption method shown in the embodiment of the present application;

[0022] Figure 3 It is a flowchart of Embodiment 3 of the verification code encryption method shown in the embodiment of the present application;

[0023] Figure 4 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0024] Embodiments will now be described with reference to the accompanying drawings. It should be understood that for simplicity and clarity of explanation, reference numerals may be repeated in the accompanying drawings to indicate corresponding or similar elements where deemed appropriate. In addition, the present application sets forth many specific details in order to provide a thorough understanding of the embodiments described herein. However, it will be appreciated by those of ordinary skill in the art that the embodiments described herein may be practiced without these specific details. In other cases, well-known methods, processes, and components are not described in detail to avoid blurring the embodiments described herein. Moreover, the description should not be construed as limiting the scope of the embodiments described herein.

[0025] Embodiment 1

[0026] Currently, verification codes are at risk of being intercepted by Trojan programs, which makes it easy for third parties to obtain verification codes and successfully log in to applications on another mobile phone by impersonating the user's identity to obtain services. For example, in some financial service applications, transactions and transfers can be made by knowing the user's verification code. In addition, if the user encounters telecommunications fraud and provides the verification code to the fraudster, it will also cause property losses. Therefore, it is urgent to develop technology to encrypt verification codes to increase the difficulty of stealing verification codes, thereby reducing the risk of property losses.

[0027] In response to the above problems, an embodiment of the present application provides a verification code encryption method, which can increase the difficulty of verification code theft and reduce the risk of property loss.

[0028] In the embodiment of the present application, it mainly involves data interaction between a user terminal and an application server; further, if the first verification code is a text message verification code, it will also involve interaction with a telecom operator.

[0029] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0030] Figure 1 It is a flow chart of the first embodiment of the verification code encryption method shown in the embodiment of the present application.

[0031] See also Figure 1 , the first embodiment of the verification code encryption method shown in the embodiment of the present application includes:

[0032] In step 101, the user terminal obtains a first verification code;

[0033] In an embodiment of the present application, the first verification code is verification information generated in response to a verification code input event of a target application, wherein the target application refers to an application that currently requires the application user to perform operations such as verifying login or verifying transactions, which needs to be determined based on the actual application situation and is not uniquely limited.

[0034] It is understandable that the verification code input event can be initiated by the user terminal or by the application server of the target application, depending on the actual application situation, and is not limited here. For example, if an application user wants to log in to the target application on a mobile terminal, the application user can click "Send verification code" on the operation interface of the target application. In response to this operation, the application server of the target application will generate and maintain a verification code input event.

[0035] It can also be understood that there are various ways to obtain the first verification code. It can be obtained from a verification code SMS sent by a verification code sending agency. The verification code sending agency is the telecommunications operator that sends the verification code SMS. It can also be obtained by identifying characters in a picture verification code. In actual applications, the method for obtaining the first verification code needs to be determined based on the actual application situation, and no unique limitation is made here.

[0036] In step 102, the user terminal encrypts the first verification code using a random key to obtain a second verification code.

[0037] In the embodiment of the present application, the random key is key information generated in response to a verification code input event, and the second verification code is information to be input for the verification code input event. The random key may be generated by a user terminal or an application server, depending on the actual application situation, and is not limited here.

[0038] It is understandable that three parameters are generated in the verification code input event, namely, the first verification code obtained in response to the verification code input event, the second is the generated random key, and the third is the second verification code to be input for completing the verification code input event. Specifically, after the verification code input event is initiated, the application server can send the first verification code to the user terminal through the telecommunications operator, and generate a random key locally on the application server (or instruct the user terminal), and the user terminal encrypts the second verification code with the random key. When the application user enters the second verification code (the first verification code is encrypted with the random key) in the target application, the verification code input event ends.

[0039] The following beneficial effects can be seen from the above embodiment 1:

[0040] A second verification code is obtained by obtaining a first verification code and encrypting the first verification code with a random key, wherein the first verification code is verification information sent in response to a verification code input event of a target application, and the second verification code is information to be input for the verification code input event, so that the user can complete the verification only after entering the encrypted second verification code. Even if a Trojan program or telecommunications fraud steals the real verification code for input, the authentication cannot be completed, thereby increasing the difficulty of stealing a valid verification code, reducing the risk of property loss, and improving information security.

[0041] Embodiment 2

[0042] For ease of understanding, an embodiment of the verification code encryption method is provided below for illustration. In actual applications, a random key is generated by character replacement based on the character space length of the verification code so that the first verification code can be encrypted to obtain a second verification code provided to the application user for input.

[0043] Figure 2 It is a flow chart of Embodiment 2 of the verification code encryption method shown in the embodiment of the present application.

[0044] See also Figure 2 , the second embodiment of the verification code encryption method shown in the embodiment of the present application includes:

[0045] In step 201, the user terminal intercepts the verification code SMS received by the terminal and extracts the first verification code from the verification code SMS;

[0046] In an embodiment of the present application, a user terminal can be used to intercept verification code SMS messages. This can be achieved by registering a broadcast receiver to monitor SMS messages after the target application is started, or by directly monitoring the SMS database. In actual applications, the appropriate interception method needs to be determined based on the actual application situation, and this is not the only limitation here.

[0047] The verification code sending agency and the information content are determined based on the verification code SMS. The SMS sent will be accompanied by the number of the sending agency. The verification code sending agency can be determined based on the number, and the verification code sending agency can be judged. If the verification code sending agency is an authenticated verification code sending agency, the authenticated verification code sending agency is the authenticated communication operator, and the information content is further analyzed to extract the first verification code. The analysis and extraction method can be through character recognition. In actual applications, there are various ways to analyze and extract information content, and the appropriate method needs to be determined according to the actual application situation. It is not the only limitation here.

[0048] In step 202, the user terminal or application server forms a random key;

[0049] In an embodiment of the present application, the random key may be generated by an application server and sent to a user terminal through the application server; or, the application server instructs the user terminal to generate a random key according to the character space length of the verification code.

[0050] For generating a random key according to the character space length of the information to be input, specifically: first create a key array, where the array length of the key array is consistent with the character space length. Assuming that the verification code only contains the 10 numbers 0 to 9, the character space length of the verification code is 10, the array length of the key array is also 10, and the key array is any arrangement of the 10 numbers 0 to 9; assuming that the verification code contains the 10 numbers 0 to 9 and the 26 letters A to Z, the character space length of the verification code is 36, the array length of the key array is also 36, and the key array is any arrangement of the 10 numbers 0 to 9 and the 26 letters A to Z.

[0051] Furthermore, the element data in the key array are arranged in ascending order according to the data type corresponding to the element data. Assuming that the key array contains 10 numbers from 0 to 9, and assuming that the key array is from low to high from left to right, then 0 to 9 are arranged in ascending order from low to high to form the key array; assuming that the key array contains 10 numbers from 0 to 9 and 26 letters from A to Z, and assuming that the key array is from low to high from left to right, then 0 to 9 and A to Z are arranged in ascending order from low to high to form the key array. Among them, since the Askama values ​​of 0 to 9 are 48 to 57, and the Askama values ​​of A to Z are 65 to 96, 0 to 9 will be arranged before A to Z in ascending order. The Askama value is the ASCII code value. ASCII is a computer encoding system based on Latin letters, mainly used to display modern English and other Western European languages.

[0052] Then traverse the key array, the traversal order can be from low to high, that is, from the first bit to the last bit. Each time an element data in the key array is traversed, a random integer r will be created. Assuming that the key array contains 10 numbers from 0 to 9, the random integer r is an integer less than or equal to 10 and greater than or equal to 0. The element data currently traversed is exchanged with the rth element data in the key array. For example, assuming that the element data currently traversed is 2 and the random integer r is 9, the element data 2 is exchanged with the 9th element data in the key array. Until all the element data in the key array are traversed, a random key is obtained.

[0053] In step 203, the user terminal encrypts the first verification code using a random key to obtain a second verification code.

[0054] In the embodiment of the present application, encryption can be performed by character replacement, specifically: determine the number of characters n of the first verification code, use the first n elements of the random key as the second verification code, assume that the first verification code obtained is 123456, then the number of characters n of the first verification code is 6, assume that the current random key is 3168745209, then the second verification code is 316874. It can be understood that the above description of the encryption method for the first verification code is only exemplary. In actual applications, there are various encryption methods, and the appropriate encryption method needs to be selected according to the actual application situation, and it is not limited here.

[0055] The following beneficial effects can be seen from the above-mentioned embodiment 2:

[0056] By intercepting the verification code SMS received by the terminal, the first verification code is extracted from the verification code SMS, thereby ensuring that the first verification code cannot be obtained on a user terminal without an SMS acquisition function, that is, without a SIM card, and then the first verification code is encrypted by forming a random key to obtain a second verification code that needs to be input by the application user. Even if a Trojan program intercepts the real first verification code, it cannot complete the verification operation in the target application, thereby increasing the difficulty of stealing valid verification codes, reducing the risk of property loss, and improving information security.

[0057] Embodiment 3

[0058] For ease of understanding, an embodiment of the verification code encryption method is provided below for illustration. In actual applications, a random key is required to decrypt the second verification code. That is, even if the user encounters telecommunications fraud and leaks the second verification code, the fraudster cannot obtain the random key for decryption, thereby further improving information security. An anti-counterfeiting random number will also be sent to participate in the verification to prevent a fake base station from forging the application user's number and then sending the decrypted verification code to the attacker.

[0059] Figure 3 It is a flow chart of Embodiment 3 of the verification code encryption method shown in the embodiment of the present application.

[0060] See also Figure 3 , the third embodiment of the verification code encryption method shown in the embodiment of the present application includes:

[0061] In step 301, the user terminal receives an anti-counterfeiting random number sent by the application server;

[0062] After the user terminal obtains the first verification code, the application server will feedback a random number to the user terminal as an anti-counterfeiting random number.

[0063] In step 302, the user terminal intercepts the verification code SMS received by the terminal and extracts the first verification code from the verification code SMS;

[0064] In the embodiment of the present application, the content of step 302 is similar to the content of step 201 in embodiment 2, and will not be repeated here.

[0065] In step 303, the user terminal sends the anti-counterfeiting random number to the application server for storage, and uses the anti-counterfeiting random number as an authentication random number in the application server;

[0066] After intercepting the verification code SMS and extracting the first verification code from the verification code SMS, the anti-counterfeiting random number is immediately sent to the application server for storage as an authentication random number.

[0067] In step 304, the user terminal encrypts the first verification code using a random key to obtain a second verification code;

[0068] In the embodiment of the present application, the content of step 304 is similar to the content of step 203 in embodiment 2, and will not be repeated here.

[0069] In step 305, the user terminal displays the second verification code on the interface of the target application;

[0070] The target application needs to display the encrypted verification code, i.e., the second verification code, to the application user in a certain form and prompt the application user to enter the second verification code, rather than the first verification code in the verification code SMS obtained by the user terminal, so that the application user can respond to the verification code input event and enter the second verification code into the verification code input box of the target application.

[0071] In step 306, the user terminal obtains the second verification code input by the application user, decrypts the second verification code input by the application user, and obtains a third verification code;

[0072] The second verification code input by the application user is compared with the random key. The random key is the random key used to encrypt the first verification code to obtain the second verification code. Therefore, when the fraudster cannot obtain the current random key, even if the fraudster can further steal the second verification code, the second verification code cannot be decrypted, and the verification operation cannot be completed.

[0073] In the embodiment of the present application, decryption can also use the sampling character replacement method, and the third verification code can be obtained according to the data position and random key mapping matching through the data position of the n element data of the second verification code in the random key. Exemplarily, assuming that the current second verification code is 316874 and the current random key is 3168745209, the first 6 bits of the 6 element data of the second verification code in the random key are determined, and the verification code replaced by the first 6 bits in the random key is 123456, so the decrypted verification code is obtained, that is, the third verification code is 123456.

[0074] It is understandable that the above description of the decryption method is only exemplary. In actual applications, there are various decryption methods, and the appropriate decryption method needs to be determined according to the actual application situation. No sole limitation is made here.

[0075] In step 307, the user terminal sends the third verification code and the anti-counterfeiting random number to the application server for verification.

[0076] The application server requires the third verification code and the anti-counterfeiting random number to be verified at the same time, so that the application server compares the third verification code with the first verification code, and compares the anti-counterfeiting random number with the authentication random number. Only when the third verification code is consistent with the first verification code, and the anti-counterfeiting random number is consistent with the authentication random number, can the verification be successful; even if the attacker can crack or steal the third verification code, it cannot know the correct anti-counterfeiting random number for verification, making it difficult for the attacker to complete the verification, thereby improving information security.

[0077] The following beneficial effects can be seen from the above embodiment 3:

[0078] By receiving the anti-counterfeiting random number issued by the application server in response to the verification code input event, the verification code SMS received by the intercepting terminal, after extracting the first verification code from the verification code SMS, the anti-counterfeiting random number is sent to the application server for storage, and the anti-counterfeiting random number is used as the authentication random number in the application server, the first verification code is encrypted by a random key, and the obtained second verification code is displayed on the interface of the target application, so that the application user can respond to the verification code input event and input the second verification code into the verification code input box of the target application, and then obtain the second verification code input by the application user, and use the random key to decrypt the second verification code input by the application user to obtain the third verification code, thereby preventing the fraudster from decrypting the second verification code, and sending the third verification code and the anti-counterfeiting random number to the application server for verification. Even if the attacker can crack or steal the third verification code, he cannot know the correct anti-counterfeiting random number for verification, making it difficult for the attacker to complete the verification, thereby improving information security and reducing the risk of property loss.

[0079] Embodiment 4

[0080] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides an electronic device for executing a verification code encryption method and a corresponding embodiment.

[0081] Figure 4 FIG. 8 is a block diagram showing the hardware configuration of an electronic device 800 that can implement the verification code encryption method of an embodiment of the present application. Figure 4 As shown, the electronic device 800 may include a processor 810 and a memory 820. Figure 4 In the electronic device 800, only the components related to this embodiment are shown. Therefore, it is obvious to those skilled in the art that the electronic device 800 may also include Figure 4 The components shown in the figure are different from the common components. For example: fixed-point arithmetic units.

[0082] The electronic device 800 may correspond to a computing device having various processing functions, such as functions for generating a neural network, training or learning a neural network, quantizing a floating-point neural network to a fixed-point neural network, or retraining a neural network. For example, the electronic device 800 may be implemented as various types of devices, such as a personal computer (PC), a server device, a mobile device, etc.

[0083] The processor 810 controls all functions of the electronic device 800. For example, the processor 810 controls all functions of the electronic device 800 by executing a program stored in a memory 820 on the electronic device 800. The processor 810 may be implemented by a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an artificial intelligence processor chip (IPU), etc. provided in the electronic device 800. However, the present application is not limited thereto.

[0084] In some embodiments, the processor 810 may include an input / output (I / O) unit 811 and a computing unit 812. The I / O unit 811 may be used to receive various data.

[0085] The memory 820 is hardware for storing various data processed in the electronic device 800. For example, the memory 820 can store processed data and data to be processed in the electronic device 800. The memory 820 can store data sets involved in the neural network operation process that has been processed or to be processed by the processor 810, for example, data of an untrained initial neural network, intermediate data of a neural network generated during the training process, data of a neural network that has completed all training, data of a quantized neural network, etc. In addition, the memory 820 can store applications, drivers, etc. to be driven by the electronic device 800. For example: the memory 820 can store various programs related to the training algorithm, quantization algorithm, calibration algorithm, etc. of the neural network to be executed by the processor 810. The memory 820 can be a DRAM, but the present application is not limited thereto. The memory 820 can include at least one of a volatile memory or a non-volatile memory. The non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, a phase change RAM (PRAM), a magnetic RAM (MRAM), a resistive RAM (RRAM), a ferroelectric RAM (FRAM), etc. The volatile memory may include a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous DRAM (SDRAM), a PRAM, an MRAM, an RRAM, a ferroelectric RAM (FeRAM), etc. In an embodiment, the memory 820 may include at least one of a hard disk drive (HDD), a solid state drive (SSD), a high-density flash memory (CF), a secure digital (SD) card, a micro secure digital (Micro-SD) card, a mini secure digital (Mini-SD) card, an extreme digital (xD) card, caches, or a memory stick.

[0086] The processor 810 can generate a trained neural network by repeatedly training (learning) a given initial neural network. In this state, in the sense of ensuring the processing accuracy of the neural network, the parameters of the initial neural network are in a high-precision data representation format, such as a data representation format with 32-bit floating-point precision. The parameters may include various types of data input / output to / from the neural network, such as: input / output neurons, weights, biases, etc. of the neural network. Compared with fixed-point operations, a relatively large number of operations and relatively frequent memory accesses are required during floating-point operations. Specifically, most of the operations required for neural network processing are known to be various convolution operations. Therefore, in mobile devices with relatively low processing performance (such as smart phones, tablets, wearable devices, etc., embedded devices, etc.), neural network high-precision data operations will make the resources of the mobile device not fully utilized. As a result, in order to drive the neural network operation within the allowable precision loss range and fully reduce the amount of operations in the above-mentioned devices, the high-precision data involved in the neural network operation process can be quantized and converted into low-precision fixed-point numbers.

[0087] Considering the processing performance of devices such as mobile devices and embedded devices that deploy neural networks, the electronic device 800 performs quantization of converting the parameters of the trained neural network into fixed-point type with a specific number of bits, and the electronic device 800 sends the corresponding parameters to the device that deploys the neural network, so that when the artificial intelligence processor chip performs training, fine-tuning and other computing operations, it is a fixed-point number operation. The device that deploys the neural network can be an autonomous vehicle, a robot, a smart phone, a tablet device, an augmented reality (AR) device, an Internet of Things (IoT) device, etc. that performs speech recognition, image recognition, etc. by using a neural network, but the present application is not limited thereto.

[0088] In summary, the specific functions implemented by the memory 820 and the processor 810 of the electronic device 800 provided in the implementation mode of this specification can be explained in comparison with the aforementioned implementation modes in this specification, and can achieve the technical effects of the aforementioned implementation modes, and will not be repeated here.

[0089] In this embodiment, the processor 810 can be implemented in any suitable manner. For example, the processor 810 can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc.

[0090] It should be understood that the possible terms "first" or "second" etc. in the claims, specifications and drawings disclosed in this application are used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims disclosed in this application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0091] It should also be understood that the terms used in this disclosure specification of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the disclosure of the present application. As used in the disclosure specification of the present application and the claims, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms. It should also be further understood that the term "and / or" used in the disclosure specification of the present application and the claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0092] Although the implementation methods of the present application are as above, the contents described are only examples adopted to facilitate the understanding of the present application, and are not intended to limit the scope and application scenarios of the present application. Any technician in the technical field described in the present application can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present application, but the scope of patent protection of the present application shall still be subject to the scope defined in the attached claims.

[0093] It should also be understood that any module, unit, component, server, computer, terminal or device that executes instructions exemplified herein may include or otherwise access computer-readable media, such as storage media, computer storage media or data storage devices (removable and / or non-removable) such as disks, optical disks or tapes. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data.

Claims

1. A verification code encryption method, characterized in that: include: Obtaining a first verification code, where the first verification code is verification information generated in response to a verification code input event of a target application; Encrypting the first verification code by using a random key to obtain a second verification code, wherein the random key is key information generated in response to the verification code input event, and the second verification code is information to be input for the verification code input event; Before encrypting the first verification code by using a random key, the following steps are included: Get a random key sent by the application server; or Generate the random key according to the character space length of the information to be input; The step of generating the random key according to the character space length of the verification code in the verification code input event includes: Creating a key array, wherein the array length of the key array is consistent with the length of the character space; the element data in the key array are arranged in ascending order according to the data types corresponding to the element data; Iterate over the array of keys; Creating a random integer r each time each element data in the key array is traversed; Exchange the currently traversed element data with the rth element data in the key array; Until all element data in the key array are traversed, the random key is obtained; The first verification code is encrypted by a random key to obtain a second verification code, including: Determine the number of characters n of the first verification code; Using the first n elements of the random key as the second verification code; Wherein, obtaining the first verification code includes: Intercept the verification code SMS received by the terminal; Extracting the first verification code from the verification code SMS; Wherein, after encrypting the first verification code by using a random key to obtain a second verification code, the method further includes: Displaying the second verification code on the interface of the target application, so that the application user can respond to the verification code input event and input the second verification code into the verification code input box of the target application; Obtaining a second verification code input by the application user, decrypting the second verification code input by the application user, and obtaining a third verification code; and The third verification code is sent to the application server for verification.

2. The verification code encryption method according to claim 1, characterized in that: Also includes: Before intercepting the verification code SMS received by the mobile terminal, receiving the anti-counterfeiting random number sent by the application server in response to the verification code input event; After extracting the first verification code from the verification code SMS, Sending the anti-counterfeit random number to the application server for storage, and using the anti-counterfeit random number as an authentication random number in the application server; Sending the third verification code and the anti-counterfeiting random number to the application server; The application server compares the third verification code with the first verification code, and compares the anti-counterfeiting random number with the authentication random number.

3. The verification code encryption method according to claim 1, characterized in that: Decrypting the second verification code input by the application user to obtain a third verification code includes: Compare the second verification code input by the application user with the random key to determine the data positions of n element data forming the second verification code input by the application user in the random key; The third verification code is obtained according to the data position and the random key matching.

4. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 3.

5. A non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method as claimed in any one of claims 1 to 3.