Verification method, verification code generation method, system and related device

By generating and verifying CAPTCHAs through exponentiation and modulo operations between the main device and offline devices, the leakage problem during CAPTCHA transmission is solved, thereby improving the security and success rate of CAPTCHA acquisition.

CN118842628BActive Publication Date: 2025-11-25CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410925441.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2025-11-25
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Existing CAPTCHA verification technologies suffer from leakage and security risks during transmission, affecting the success rate and security of CAPTCHA acquisition.

Method used

By coordinating operations between the master device and offline devices, and using exponentiation and modulo operations to generate and verify verification codes, the security of verification codes during transmission is ensured.

Benefits of technology

It improves the success rate of obtaining verification codes, enhances the security of verification codes, and avoids the risk of leakage during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118842628B_ABST
    Figure CN118842628B_ABST
Patent Text Reader

Abstract

The application relates to a verification method, a verification code generation method, a system and related equipment, and the method comprises the following steps: receiving a verification instruction input by a user on a host device, the verification instruction being used for instructing the host device to verify a verification code generated by an offline device; in response to the verification instruction, obtaining first data generated by the host device for the offline device in advance, second data randomly generated by the host device in advance, and third data stored by the host device in advance, wherein the third data is generated by the offline device; performing a modulo operation on the first data by taking the power operation result of the third data as a base and the second data as an exponent to obtain verification reference data; if the verification code is consistent with the verification reference data, it is determined that the verification code verification is successful; and if the verification code is inconsistent with the verification reference data, it is determined that the verification code verification fails. The scheme provided in the application can avoid leakage when the verification code is obtained, improve the success rate of obtaining the verification code, and increase the security of the verification code.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of verification, in particular to a verification method, a verification code generation method, a system and related equipment. BACKGROUND

[0002] With the development of Internet technology, along with the widespread use of software applications, web pages and systems, in order to ensure the security of users logging into software applications, web pages and systems, the verification code technology is widely used in system login, user identity verification and other aspects. Verification code is the abbreviation of Turing test for automatically distinguishing computers and humans, which is a public automatic program for distinguishing whether the user is a computer or a person, and can effectively prevent password cracking, ticket brushing, forum spamming and other network security problems.

[0003] However, the existing verification code verification technology is transmitted through the network or short message, which may cause leakage or interception during transmission, causing security risks. SUMMARY

[0004] To solve or partially solve the problems in the related art, the present application provides a verification method, a verification code generation method, a system and related equipment, which can avoid leakage when obtaining a verification code, improve the success rate of obtaining a verification code, and increase the security of the verification code.

[0005] The first aspect of the present application provides a verification method applied to a master device, including receiving a verification instruction input by a user on the master device, the verification instruction being used to instruct the master device to verify a verification code generated by an offline device; in response to the verification instruction, obtaining first data generated by the master device for the offline device, second data randomly generated by the master device in advance, and third data stored by the master device in advance, the third data being generated by the offline device; performing a modulo operation on the first data by taking the third data as the base and the second data as the exponent of the power operation result, to obtain the verification reference data; if the verification code is consistent with the verification reference data, it is determined that the verification of the verification code is successful; if the verification code is inconsistent with the verification reference data, it is determined that the verification of the verification code fails.

[0006] In combination with the first aspect, in a possible implementation manner of the first aspect, the generation process of the first data includes: obtaining a target data set in advance; taking the largest prime number smaller than the target data as the first data; displaying and storing the first data, the first data being used to generate the third data.

[0007] In conjunction with the first aspect, in one possible implementation of the first aspect, the method further includes: generating fourth data randomly in real time; displaying and storing the fourth data, wherein the fourth data is used to generate the third data in combination with the first data.

[0008] In conjunction with the first aspect, in one possible implementation of the first aspect, the method further includes: receiving third data input by the user; and storing the third data in the master device.

[0009] In conjunction with the first aspect, in one possible implementation of the first aspect, the method further includes: generating the second data randomly in real time; performing a modulo operation on the first data using the result of a power operation with the fourth data as the base and the second data as the exponent to obtain a verification exchange code; and displaying the verification exchange code, wherein the verification exchange code is used to generate the verification code.

[0010] In conjunction with the first aspect, in one possible implementation of the first aspect, after determining that the verification code verification is successful, the method further includes: responding to the operation instruction received from the user on the main device; and after determining that the verification code verification fails, the method further includes: prompting the user that the operation instruction failed to execute when the user's operation instruction is received on the main device.

[0011] A second aspect of this application provides a verification code generation method applied to an offline device, comprising: receiving a verification exchange code input by a user on the offline device and first data used in generating the verification exchange code, wherein the verification exchange code is generated by a main device; obtaining fifth data pre-randomly generated by the offline device; performing a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent to obtain the verification code; and displaying the verification code, wherein the verification code is used for identity verification on the main device.

[0012] In conjunction with the second aspect, in one possible implementation of the second aspect, the method further includes: receiving fourth data input by a user, the fourth data being generated by the main device; randomly generating fifth data; performing a modulo operation on the first data using the result of a power operation with the fourth data as the base and the fifth data as the exponent, to obtain third data; and displaying the third data.

[0013] In conjunction with the second aspect, in one possible implementation of the second aspect, displaying the verification code includes: displaying the verification code as text and / or graphic codes; displaying the third data includes: displaying the third data as text and / or graphic codes.

[0014] A third aspect of this application provides a verification device interaction method applied to a verification system, the verification system including a main device and an offline device, comprising: the offline device receiving a verification exchange code input by a user on the offline device and first data used when generating the verification exchange code, the verification exchange code being generated by the main device;

[0015] The offline device acquires fifth data that is pre-randomly generated by the offline device;

[0016] The offline device performs a modulo operation on the first data, using the verification exchange code as the base and the fifth data as the exponent, to obtain the verification code.

[0017] The offline device displays the verification code;

[0018] The main device receives a verification command input by the user on the main device. The verification command is used to instruct the main device to verify the verification code generated by the offline device.

[0019] In response to the verification command, the master device acquires first data pre-generated by the master device for the offline device, second data pre-generated randomly by the master device, and third data pre-stored by the master device, wherein the third data F is generated by the offline device;

[0020] The main device performs a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain the verification reference data;

[0021] If the verification code matches the verification reference data, the master device determines that the verification code verification was successful; if the verification code does not match the verification reference data, the master device determines that the verification code verification failed.

[0022] A fourth aspect of this application provides a verification device, including a first receiving module for receiving a verification command input by a user on a main device, wherein the verification command is used to instruct the main device to verify a verification code generated by an offline device;

[0023] The first acquisition module, in response to the verification command, acquires first data pre-generated by the main device for the offline device, second data pre-generated randomly by the main device, and third data pre-stored by the main device, wherein the third data is generated by the offline device;

[0024] The judgment module is used to perform a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain the verification reference data.

[0025] If the verification code matches the verification reference data, then the verification code verification is successful.

[0026] If the verification code does not match the verification reference data, then the verification code verification is determined to have failed.

[0027] In conjunction with the fourth aspect, in one possible implementation of the fourth aspect, the first acquisition module is further configured to acquire pre-set target data; take the largest prime number less than the target data as the first data; display and store the first data, and use the first data to generate the third data.

[0028] In conjunction with the fourth aspect, in one possible implementation of the fourth aspect, the first acquisition module is further configured to randomly generate fourth data in real time; display and store the fourth data, which is used to generate the third data in combination with the first data.

[0029] In conjunction with the fourth aspect, in one possible implementation of the fourth aspect, the first acquisition module is further configured to receive third data input by the user and store the third data in the main device.

[0030] In conjunction with the fourth aspect, in one possible implementation of the fourth aspect, the first acquisition module is further configured to randomly generate the second data in real time; perform a modulo operation on the first data using the result of a power operation with the fourth data as the base and the second data as the exponent to obtain a verification exchange code; and display the verification exchange code, which is used to generate the verification code.

[0031] In conjunction with the fourth aspect, in one possible implementation of the fourth aspect, the judgment module is further configured to, after determining that the verification code verification is successful, also include: responding to the operation instruction received from the user on the main device; and after determining that the verification code verification fails, further include: prompting the user that the operation instruction failed to execute when the user's operation instruction is received on the main device.

[0032] A fifth aspect of this application provides a verification code generation apparatus, including a second receiving module for receiving a verification exchange code input by a user on an offline device and first data used when generating the verification exchange code, wherein the verification exchange code is generated by a main device.

[0033] The second acquisition module is used to acquire the fifth data that is pre-randomly generated by the offline device;

[0034] The calculation module is used to perform a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent, to obtain the verification code;

[0035] A display module is used to display the verification code, which is used for identity verification on the main device.

[0036] In conjunction with the fifth aspect, in one possible implementation of the fifth aspect, the second acquisition module is further configured to receive fourth data input by the user, the fourth data being generated by the main device; randomly generate fifth data; perform a modulo operation on the first data using the result of a power operation with the fourth data as the base and the fifth data as the exponent to obtain the third data; and display the third data.

[0037] In conjunction with the fifth aspect, in one possible implementation of the fifth aspect, the display module is further configured to display the verification code in the form of text and / or graphic codes; the display of the third data includes: displaying the third data in the form of text and / or graphic codes.

[0038] A sixth aspect of this application provides a verification system, comprising: a main device and an offline device; wherein the main device is used to perform the method described above, and the offline device is used to perform the method described above.

[0039] The seventh aspect of this application provides an electronic device, comprising:

[0040] Processor; and

[0041] A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.

[0042] The eighth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.

[0043] The technical solution provided in this application may include the following beneficial effects:

[0044] The verification method of this application includes receiving a verification command input by a user on a main device, the verification command instructing the main device to verify a verification code generated by an offline device; in response to the verification command, acquiring first data pre-generated by the main device for the offline device, second data pre-randomized by the main device, and third data pre-stored by the main device, the third data being generated by the offline device; obtaining verification reference data by performing a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent; if the verification code matches the verification reference data, the verification code verification is determined to be successful; if the verification code does not match the verification reference data, the verification code verification is determined to be unsuccessful. This method can avoid leakage when obtaining the verification code, improve the success rate of obtaining the verification code, and increase the security of the verification code.

[0045] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0046] The above and other objects, features and advantages of this application will become more apparent from the following description of exemplary embodiments of this application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components.

[0047] Figure 1 This is a flowchart illustrating the verification method in an embodiment of this application;

[0048] Figure 2 This is a flowchart illustrating the verification code generation method according to an embodiment of this application;

[0049] Figure 3 This is a schematic diagram of the verification device shown in the embodiments of this application;

[0050] Figure 4 This is a schematic diagram of the structure of the verification code generation device shown in the embodiments of this application;

[0051] Figure 5 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation

[0052] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0053] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0054] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, "a plurality of" means two or more, unless otherwise specifically defined.

[0055] First, some terms involved in this application and related technologies are explained to facilitate understanding by those skilled in the art.

[0056] A CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is an abbreviation for a fully automated Turing test that distinguishes between computers and humans. It is a public fully automated program that can effectively prevent network security problems such as password cracking, vote stuffing, and forum spamming. It is usually a code composed of numbers, letters, or a combination of both, and is used to verify a person's identity when performing sensitive operations.

[0057] Exponentiation is used to represent the value of a natural power of a number. In exponentiation, the base represents the number of times to be multiplied, and the result is called the power. The general form of the exponentiation expression is a n , where a is the base and n is the exponent. Here, the exponent must be a natural number or 0, and the base can be any real number.

[0058] The modulo operation is to find the remainder of the division of two numbers. When a positive integer p and any integer n are given, there must exist an equation: n = kp + r, where k and r are integers, and 0 ≤ r < p. Then k is called the quotient of n divided by p, and r is called the remainder of n divided by p.

[0059] A prime number is a natural number greater than 1 that cannot be divided evenly by other natural numbers except 1 and itself.

[0060] With the increasingly severe cybersecurity situation, traditional SMS verification codes are sent via internet API interfaces and then through operators to users' mobile phones. During this process, the verification codes may be intercepted, compromising user privacy. Furthermore, the delivery rate of SMS verification codes is affected not only by the service provider's quality but also by the device itself and signal strength in the user's area. It cannot be guaranteed that the verification code will be completely transmitted to the user's device. Secondly, the device's own software may also intercept SMS messages, preventing users from seeing the required verification code.

[0061] Existing SMS verification codes can be used as a verification method and are frequently used in scenarios such as login or identity verification. However, SMS verification codes transmitted over the network are at risk of being leaked, posing a security risk.

[0062] To address the aforementioned issues, this application provides a verification method that can prevent leakage during verification code acquisition, improve the success rate of verification code acquisition, and enhance the security of the verification code.

[0063] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0064] Figure 1 This is a flowchart illustrating the verification method shown in the embodiments of this application.

[0065] See Figure 1 A verification method, including but not limited to the following steps:

[0066] S110: The master device receives the verification command entered by the user on the master device. The verification command is used to instruct the master device to verify the verification code generated by the offline device.

[0067] Specifically, users can enter verification commands on the main device. For example, they can enter verification commands on the main device through external devices such as a keyboard. The verification command can be a number symbol composed of multiple numbers, such as 666, 1234, 8888, 85241, etc. There are no restrictions here. The verification command can be the same as the verification code generated by the offline device. For example, when the entered verification command is 1234, the verification code generated by the offline device can also be 1234.

[0068] S120: In response to the verification command, the master device obtains the first data pre-generated by the master device for the offline device, the second data pre-generated randomly by the master device, and the third data pre-stored by the master device. The third data is generated by the offline device.

[0069] Specifically, after receiving the verification command, the master device can obtain the first data, the second data, and the third data. The first data, the second data, and the third data can be numerical symbols composed of multiple digits, such as 8, 45, 123, 8901, etc. There are no restrictions here. The first data and the second data composed of numerical symbols can be the same data symbols. For example, if the first data is 123, the second data can also be 123. The third data can be numerical symbols that are different from the first data and the second data.

[0070] In another possible implementation, the master device acquires pre-set target data; takes the largest prime number less than the target data as the first data; displays and stores the first data, which is then used to generate the third data.

[0071] Specifically, the target data can be data pre-stored on the main device or input by the user on the main device. The target data can be a number symbol composed of multiple digits, such as 123 or 4567. There is no limitation here. Preferably, the number symbol of the target data is at least 3 digits. Having more than 3 digits can better prevent the target data from being obtained and prevent the subsequent generated data from being intercepted.

[0072] Specifically, the main device can generate first data from the target data. The first data is the largest prime number less than the target data. For example, when the target data is 100, the first data is 97. The target data can be obtained through relevant algorithmic techniques, such as reverse division, which will not be elaborated here. Furthermore, after obtaining the first data, the main device can store the first data and display it on the screen, allowing the user to see the first data.

[0073] In another possible implementation, the master device randomly generates fourth data in real time; the fourth data is displayed and stored, and is used to combine with the first data to generate third data.

[0074] Specifically, the main device can randomly generate a fourth data point in real time. This fourth data point can be a numerical symbol composed of multiple digits, such as 5, 20, 60, etc., without any restrictions. The fourth data point can be the same as the first data point. After randomly generating the fourth data point, the main device can store it and display it on the screen, allowing the user to access the fourth data point.

[0075] In another possible implementation, third data input by the user is received; the third data is stored in the master device.

[0076] Specifically, the third data is generated by the offline device. Users can input the third data into the main device, and the main device will store the third data.

[0077] In another possible implementation, the master device randomly generates second data in real time; the first data is moduloed by the result of a power operation with the fourth data as the base and the second data as the exponent to obtain the verification exchange code; the verification exchange code is displayed and used to generate the verification code.

[0078] Specifically, the main device can generate second data randomly in real time. The second data can be a number symbol composed of multiple numbers, such as 5, 15, 30, etc. There are no restrictions here; the fourth data and the second data can be the same.

[0079] Specifically, the master device can obtain the verification exchange code using the fourth, second, and first data. For example, when the fourth and second data are the same (both are 5), and the first data is 97, the verification exchange code is calculated by taking the modulo of 5^5 and 97, resulting in 21. When the fourth and second data are different (the fourth data can be 60, the second data can be 5, and the first data is 97), the verification exchange code is calculated by taking the modulo of 60^5 and 97, resulting in 48. After obtaining the verification exchange code, the master device can display it on the screen, allowing the user to see it.

[0080] S130: The master device performs a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain verification reference data; if the verification code matches the verification reference data, the verification code verification is successful; if the verification code does not match the verification reference data, the verification code verification fails.

[0081] Specifically, verification reference data can be used to verify CAPTCHAs. Verification reference data can be a numerical symbol composed of multiple digits, such as 20, 36, etc., without limitation. For example, if the third digit is 5, the second digit can be 8, and the first digit can be 97, then the verification reference data is calculated by taking the modulo of 5^8 and 97, resulting in 36. Therefore, the verification reference data is 36. The verification reference data is used to verify the CAPTCHA and determine whether the user has passed the verification. In other words, if a user needs to log in on the main device, after the main device receives the CAPTCHA generated by the offline device, the user can input this CAPTCHA into the main device. The main device generates verification reference data and verifies the CAPTCHA using this data. If the CAPTCHA matches the verification reference data, the verification is successful, indicating successful login. If the CAPTCHA does not match the verification reference data, the verification fails, indicating failed login.

[0082] In another possible implementation, after confirming successful verification of the verification code, the method further includes: responding to the operation instruction received from the user on the main device; and after confirming failed verification of the verification code, the method further includes: prompting the user that the operation instruction failed to execute when the user's operation instruction is received on the main device.

[0083] Specifically, after successful verification, the main device can continue to receive and respond to user operation commands, such as the user's login operation. If the verification fails, the main device can display a message indicating that the operation command failed. For example, if the user attempts to log in, the main device's screen will display "Login failed".

[0084] The verification method of this application includes receiving a verification command input by a user on a main device, the verification command instructing the main device to verify a verification code generated by an offline device; in response to the verification command, acquiring first data pre-generated by the main device for the offline device, second data pre-randomized by the main device, and third data pre-stored by the main device, the third data being generated by the offline device; obtaining verification reference data by performing a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent; if the verification code matches the verification reference data, the verification code verification is determined to be successful; if the verification code does not match the verification reference data, the verification code verification is determined to be unsuccessful. This method can avoid leakage when obtaining the verification code, improve the success rate of obtaining the verification code, and increase the security of the verification code.

[0085] Figure 1 The method of the illustrated embodiment can be considered as a method for the main device to verify the verification code. Based on this, the method for an offline device to generate the verification code is described below. Please refer to... Figure 2 This is a flowchart illustrating a method for generating verification codes using an offline device according to an embodiment of the present invention.

[0086] See Figure 2 A method for generating verification codes, including but not limited to the following steps:

[0087] S210: The offline device receives the verification exchange code entered by the user on the offline device and the first data used when generating the verification exchange code. The verification exchange code is generated by the master device.

[0088] Specifically, users can enter the verification exchange code and initial data on the offline device. For example, they can enter the verification exchange code and initial data on the offline device through an external device such as a keyboard. Both the initial data and the verification exchange code are generated by the main device.

[0089] In another possible implementation, the offline device receives fourth data input by the user, which is generated by the main device; a fifth data is randomly generated; the first data is moduloed by the result of a power operation with the fourth data as the base and the fifth data as the exponent to obtain the third data; and the third data is displayed.

[0090] Specifically, the fourth data is generated by the main device, and the user can input the fourth data on the offline device. The offline device then retrieves and stores the fourth data. After retrieving the fourth data, the offline device can randomly generate a fifth data. The fifth data can be the same as the fourth data. The third data is obtained by performing a modulo operation on the first data using the result of a power operation with the fourth data as the base and the fifth data as the exponent. When the fourth and fifth data are the same, for example, when the fourth data is 4, the fifth data is 4, and the first data is 97, the result is 62, which can be used as the third data. When the fourth and fifth data are different, for example, when the fourth data is 4, the fifth data is 6, and the first data is 97, the result is 96, which can be used as the third data. Understandably, after generating the third data, the offline device can display it on its screen.

[0091] S220: The offline device obtains the fifth data that is pre-randomly generated by the offline device.

[0092] Specifically, the fifth data can be a numerical symbol composed of multiple digits, such as 5, 15, 20, etc., without any restrictions.

[0093] S230: The offline device performs a modulo operation on the first data by verifying the result of a power operation with the exchange code as the base and the fifth data as the exponent, and obtains the verification code.

[0094] Specifically, the verification code can be a numerical symbol composed of multiple digits, such as 5, 15, 86, etc., without restriction. The fifth digit can be the same as the verification exchange code. For example, when the verification exchange code is 6, the fifth digit is 6, and the first digit is 97, the first digit is moduloed by the result of a power operation where the verification exchange code is the base and the fifth digit is the exponent. The result is 93, which can be used as the verification code. Alternatively, the fifth digit can be different from the verification exchange code. For example, when the verification exchange code is 6, the fifth digit is 10, and the first digit is 97, the first digit is moduloed by the result of a power operation where the verification exchange code is the base and the fifth digit is the exponent. The result is 91, which can be used as the verification code.

[0095] S240: The offline device displays a verification code, which is used for authentication on the main device.

[0096] Specifically, after the offline device obtains the verification code through calculation, it can display the verification code on the screen. The user can then see the verification code, input it into the main device, and verify the verification code.

[0097] In another possible implementation, the offline device displays the verification code as text and / or graphic code; the offline device displays third-party data as text and / or graphic code.

[0098] Specifically, both verification codes and third-party data can be displayed on the screen of the offline device in the form of text or graphic codes. When displayed as text, users can input the third-party data or verification code into the main device. When displayed as graphic codes, such as QR codes, users can use the main device to scan the graphic code displayed on the screen of the offline device to obtain the verification code or third-party data.

[0099] The verification code generation method of this application includes receiving a verification exchange code entered by a user on an offline device and first data used when generating the verification exchange code, wherein the verification exchange code is generated by a main device; obtaining fifth data pre-generated randomly by the offline device; performing a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent to obtain the verification code; and displaying the verification code, which is used for identity verification on the main device. This method can prevent leakage when obtaining the verification code, improve the success rate of obtaining the verification code, and increase the security of the verification code.

[0100] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a verification device, a verification code generation device, an electronic device, and corresponding embodiments.

[0101] Figure 3 This is a schematic diagram of the structure of the verification device 300 shown in the embodiments of this application.

[0102] See Figure 3 The verification device 300, applied to the main equipment, includes a first receiving module 310, a first acquiring module 320, and a judging module 330. Wherein:

[0103] The first receiving module 310 is used to receive the verification command input by the user on the main device. The verification command is used to instruct the main device to verify the verification code generated by the offline device.

[0104] Specifically, users can enter verification commands on the main device. For example, they can enter verification commands on the main device through external devices such as a keyboard. The verification command can be a number symbol composed of multiple numbers, such as 666, 1234, 8888, 85241, etc. There are no restrictions here. The verification command can be the same as the verification code generated by the offline device. For example, when the entered verification command is 1234, the verification code generated by the offline device can also be 1234.

[0105] The first acquisition module 320, in response to the verification command, acquires first data pre-generated by the main device for the offline device, second data pre-generated randomly by the main device, and third data pre-stored by the main device, wherein the third data is generated by the offline device.

[0106] Specifically, after receiving the verification command, the master device can obtain the first data, the second data, and the third data. The first data, the second data, and the third data can be numerical symbols composed of multiple digits, such as 8, 45, 123, 8901, etc. There are no restrictions here. The first data and the second data composed of numerical symbols can be the same data symbols. For example, if the first data is 123, the second data can also be 123. The third data can be numerical symbols that are different from the first data and the second data.

[0107] In another possible implementation, the first acquisition module 320 is also used to receive third data input by the user and store the third data in the master device.

[0108] In another possible implementation, the first acquisition module 320 is also used to acquire pre-set target data; take the largest prime number less than the target data as the first data; display and store the first data, and use the first data to generate the third data.

[0109] In another possible implementation, the first acquisition module 320 is also used to randomly generate fourth data in real time; display and store the fourth data, and use the fourth data to generate third data in combination with the first data.

[0110] In another possible implementation, the first acquisition module 320 is also used to randomly generate second data in real time; to perform a modulo operation on the first data using the result of a power operation with the fourth data as the base and the second data as the exponent, to obtain a verification exchange code; and to display the verification exchange code, which is used to generate a verification code.

[0111] The judgment module 330 is used to perform a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain verification reference data; if the verification code matches the verification reference data, the verification code is determined to be successfully verified; if the verification code does not match the verification reference data, the verification code is determined to be unsuccessful.

[0112] Specifically, verification reference data can be used to verify CAPTCHAs. Verification reference data can be a numerical symbol composed of multiple digits, such as 20, 36, etc., without limitation. For example, if the third digit is 5, the second digit can be 8, and the first digit can be 97, then the verification reference data is calculated by taking the modulo of 5^8 and 97, resulting in 36. Therefore, the verification reference data is 36. The verification reference data is used to verify the CAPTCHA and determine whether the user has passed the verification. In other words, if a user needs to log in on the main device, after the main device receives the CAPTCHA generated by the offline device, the user can input this CAPTCHA into the main device. The main device generates verification reference data and verifies the CAPTCHA using this data. If the CAPTCHA matches the verification reference data, the verification is successful, indicating successful login. If the CAPTCHA does not match the verification reference data, the verification fails, indicating failed login.

[0113] In another possible implementation, the judgment module 330 is further configured to: after determining that the verification code verification is successful, respond to the operation instruction when receiving the user's operation instruction to the main device; and after determining that the verification code verification fails, prompt the user that the operation instruction execution failed when receiving the user's operation instruction to the main device.

[0114] As can be seen from this embodiment, the device provided in this application can avoid leakage when obtaining verification codes, improve the success rate of obtaining verification codes, and increase the security of verification codes.

[0115] The modules mentioned above can transmit data to each other through communication channels. It should be understood that the modules included in the verification device 300 can be software units, hardware units, or a combination of both.

[0116] Figure 4 This is a schematic diagram of the structure of the verification code generation device 400 shown in the embodiments of this application.

[0117] See Figure 4 The verification code generation device 400, used in offline devices, includes a second receiving module 410, a second acquiring module 420, a calculation module 430, and a display module 440. Among them:

[0118] The second receiving module 410 is used to receive the verification exchange code entered by the user on the offline device and the first data used when generating the verification exchange code. The verification exchange code is generated by the main device.

[0119] Specifically, users can enter the verification exchange code and initial data on the offline device. For example, they can enter the verification exchange code and initial data on the offline device through an external device such as a keyboard. Both the initial data and the verification exchange code are generated by the main device.

[0120] The second acquisition module 420 is used to acquire the fifth data that is pre-randomly generated by the offline device.

[0121] Specifically, the fifth data can be a numerical symbol composed of multiple digits, such as 5, 15, 20, etc., without any restrictions.

[0122] In another possible implementation, the second acquisition module 420 is also used to receive fourth data input by the user, which is generated by the main device; randomly generate fifth data; perform a modulo operation on the first data using the result of a power operation with the fourth data as the base and the fifth data as the exponent to obtain the third data; and display the third data.

[0123] The calculation module 430 is used to perform a modulo operation on the first data by verifying the result of the power operation with the exchange code as the base and the fifth data as the exponent, and then obtain the verification code.

[0124] Specifically, the verification code can be a numerical symbol composed of multiple digits, such as 5, 15, 86, etc., without restriction. The fifth digit can be the same as the verification exchange code. For example, when the verification exchange code is 6, the fifth digit is 6, and the first digit is 97, the first digit is moduloed by the result of a power operation where the verification exchange code is the base and the fifth digit is the exponent. The result is 93, which can be used as the verification code. Alternatively, the fifth digit can be different from the verification exchange code. For example, when the verification exchange code is 6, the fifth digit is 10, and the first digit is 97, the first digit is moduloed by the result of a power operation where the verification exchange code is the base and the fifth digit is the exponent. The result is 91, which can be used as the verification code.

[0125] Display module 440 is used to display the verification code, which is used for authentication on the main device.

[0126] Specifically, after the offline device obtains the verification code through calculation, it can display the verification code on the screen. The user can then see the verification code, input it into the main device, and verify the verification code.

[0127] In another possible implementation, the display module 440 is also used to display the verification code in the form of text and / or graphic codes; and to display third data, including: displaying the third data in the form of text and / or graphic codes.

[0128] As can be seen from this embodiment, the device provided in this application can avoid leakage when obtaining verification codes, improve the success rate of obtaining verification codes, and increase the security of verification codes.

[0129] The modules mentioned above can transmit data to each other through communication channels. It should be understood that the modules included in the verification code generation device 400 can be software units, hardware units, or a combination of both.

[0130] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.

[0131] This application also includes a verification device interaction method applied to a verification system, the verification system including a master device and an offline device, comprising: the offline device receiving a verification exchange code input by a user on the offline device and first data used when generating the verification exchange code, the verification exchange code being generated by the master device; the offline device acquiring fifth data pre-generated randomly by the offline device; the offline device performing a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent, to obtain a verification code; the offline device displaying the verification code; the master device receiving a verification command input by a user on the master device, the verification command being used to instruct the master device to verify the verification code generated by the offline device; the master device responding to the verification command acquiring the first data pre-generated by the master device for the offline device, second data pre-generated randomly by the master device, and third data pre-stored by the master device, the third data F being generated by the offline device; the master device performing a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain verification reference data; if the verification code matches the verification reference data, the master device determines that the verification code verification is successful; if the verification code does not match the verification reference data, the master device determines that the verification code verification has failed.

[0132] This application also includes a verification system, comprising: a main device and an offline device; wherein the main device is used to execute the verification method described above, and the offline device is used to execute the verification code generation method described above.

[0133] Figure 5 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.

[0134] See Figure 5 The electronic device 500 includes a memory 510 and a processor 520.

[0135] The processor 520 can be a Central Processing Unit (CPU), or 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. The general-purpose processor can be a microprocessor or any conventional processor.

[0136] Memory 510 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 520 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 510 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 510 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.

[0137] The memory 510 stores executable code, which, when processed by the processor 520, can cause the processor 520 to execute part or all of the methods described above.

[0138] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.

[0139] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) thereon, which, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.

[0140] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A verification method, characterized in that, Applied to the main equipment, including: The device receives a verification command input by a user on the main device, the verification command being used to instruct the main device to verify the verification code generated by the offline device; In response to the verification command, the system acquires first data pre-generated by the main device for the offline device, second data pre-generated randomly by the main device, and third data pre-stored by the main device, wherein the third data is generated by the offline device. The first data is moduloed by the result of a power operation with the third data as the base and the second data as the exponent to obtain verification reference data; If the verification code matches the verification reference data, then the verification code verification is successful. If the verification code does not match the verification reference data, then the verification code verification is determined to have failed.

2. The method according to claim 1, characterized in that, The process of generating the first data includes: Obtain the pre-set target data; The largest prime number smaller than the target data is taken as the first data; The first data is displayed and stored, and the first data is used to generate the third data.

3. The method according to claim 2, characterized in that, The method further includes: The fourth data point is generated randomly in real time. The fourth data is displayed and stored, and the fourth data is used to generate the third data in combination with the first data.

4. The method according to claim 3, characterized in that, The method further includes: Receive third-party data input by the user; The third data is stored in the main device.

5. The method according to claim 4, characterized in that, The method further includes: The second data is generated randomly in real time; The verification exchange code is obtained by performing a modulo operation on the first data using the result of a power operation with the fourth data as the base and the second data as the exponent. The verification exchange code is displayed and is used to generate the verification code.

6. The method according to any one of claims 1 to 5, characterized in that, After confirming that the verification code has been successfully verified, the process also includes: When a user's operation command is received for the main device, the operation command is responded to; After determining that the verification code verification has failed, the process also includes: When a user's operation command for the main device is received, the user is prompted that the operation command has failed to be executed.

7. A method for generating verification codes, characterized in that, Applicable to offline devices, including: Receives a verification exchange code input by a user on the offline device and first data used when generating the verification exchange code, wherein the verification exchange code is generated by the main device; Obtain the fifth piece of data that has been randomly generated in advance by the offline device; The verification code is obtained by performing a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent. The verification code is displayed and used for authentication on the host device.

8. The method according to claim 7, characterized in that, The method further includes: Receive fourth data input by the user, the fourth data being generated by the main device; The fifth data point is generated randomly; The first data is moduloed by the result of the power operation with the fourth data as the base and the fifth data as the exponent to obtain the third data; Display the third data.

9. The method according to claim 8, characterized in that, The display of the verification code includes: The verification code shall be displayed as text and / or graphic code; The display of the third data includes: The third data is displayed in the form of text and / or graphic codes.

10. A method for verifying device interaction, characterized in that, This is applied to a verification system, which includes a master device and an offline device, including: The offline device receives a verification exchange code entered by the user on the offline device and first data used when generating the verification exchange code, wherein the verification exchange code is generated by the main device; The offline device acquires fifth data that is pre-randomly generated by the offline device; The offline device performs a modulo operation on the first data, using the verification exchange code as the base and the fifth data as the exponent, to obtain the verification code. The offline device displays the verification code; The main device receives a verification command input by the user on the main device. The verification command is used to instruct the main device to verify the verification code generated by the offline device. In response to the verification command, the master device acquires first data pre-generated by the master device for the offline device, second data pre-generated randomly by the master device, and third data pre-stored by the master device, wherein the third data is generated by the offline device; The main device performs a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain verification reference data; If the verification code matches the verification reference data, the main device determines that the verification code verification was successful. If the verification code is inconsistent with the verification reference data, the master device determines that the verification code verification has failed.

11. A verification device, characterized in that, include: The first receiving module is used to receive a verification command input by the user on the main device, the verification command being used to instruct the main device to verify the verification code generated by the offline device; The first acquisition module, in response to the verification command, acquires first data pre-generated by the main device for the offline device, second data pre-generated randomly by the main device, and third data pre-stored by the main device, wherein the third data is generated by the offline device; The judgment module is used to perform a modulo operation on the first data using the result of a power operation with the third data as the base and the second data as the exponent, to obtain verification reference data. If the verification code matches the verification reference data, then the verification code verification is successful. If the verification code does not match the verification reference data, then the verification code verification is determined to have failed.

12. A verification code generation device, characterized in that, include: The second receiving module is used to receive the verification exchange code entered by the user on the offline device and the first data used when generating the verification exchange code, wherein the verification exchange code is generated by the main device. The second acquisition module is used to acquire the fifth data that is pre-randomly generated by the offline device; The calculation module is used to perform a modulo operation on the first data using the result of a power operation with the verification exchange code as the base and the fifth data as the exponent, to obtain the verification code; A display module is used to display the verification code, which is used for identity verification on the main device.

13. A verification system, comprising: Main device and offline device; The main device is used to execute the method of any one of claims 1 to 6, and the offline device is used to execute the method of any one of claims 7 to 9.

14. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-9.

15. A computer-readable storage medium, characterized in that: It stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Digital signature method, device and system based on identity forward secrecy

    CN101873307A

  • Verification method and device

    CN107979467A