SM2-based anti-double authentication signature method and device
By combining the SM2 algorithm with elliptic curve cryptography, a signature method to prevent two-factor authentication was designed. This method solves the problem that the correctness and unforgeability of signatures in existing technologies are difficult to meet the requirements for preventing two-factor authentication, and achieves a signature verification scheme with high efficiency and low computational cost.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN UNIV
- Filing Date
- 2023-03-06
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, two-factor authentication to prevent signature (DAP) is difficult to meet the functional characteristics of preventing two-factor authentication while ensuring the correctness and non-forgeability of the signature, especially in application scenarios of certificate management authorities that distribute different key certificates for the same domain name in PKI systems.
The SM2 algorithm is used to generate a public parameter set through system initialization, randomly select the user's private key and SOT private key, calculate the public key and signature, and combine the principles of elliptic curve cryptography to implement a double authentication prevention signature method, including initialization, key generation, signature generation and signature verification processes.
It achieves efficient anti-two-factor authentication signatures, meets the requirements of unforgeable security, has low computational load, high efficiency, and promotes the generalization process of cryptographic algorithms.
Smart Images

Figure CN116405216B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of information security technology, and in particular to a method and device for preventing dual authentication signatures based on SM2. Background Technology
[0002] Digital signatures, as part of public-key cryptography, play a crucial role in many situations. By appending extra data to data units or performing cryptographic transformations on them, they allow the recipient of the data to verify its origin and integrity and prevent forgery. Depending on the application scenario and requirements, various forms of digital signatures have emerged, such as ring signatures, blind signatures, aggregation signatures, and non-repudiation signatures.
[0003] Two-factor authentication prevention signature (DAP) is a signature property designed to sign two messages that share the same first part (called the address) but differ in their second part (called the payload). It allows the secret signing key to be publicly extracted from both signatures without revealing the signer's identity. The primary application of DAP is to suppress and / or punish the creation of two signatures on different payloads within the same address. For example, it can be used to punish certificate authorities in a PKI system that distribute different key certificates for the same domain. This necessitates ensuring the correctness and unforgeability of the signature while simultaneously meeting the functional characteristics of two-factor authentication prevention. Therefore, developing an SM2-based two-factor authentication prevention signature method and device to effectively overcome the shortcomings of the aforementioned related technologies has become a pressing technical problem for the industry. Summary of the Invention
[0004] To address the aforementioned problems in the existing technology, embodiments of the present invention provide a method and device for preventing dual authentication signatures based on SM2.
[0005] In a first aspect, embodiments of the present invention provide an SM2-based method for preventing dual authentication signatures, including: Step 1, system initialization, inputting security parameters. Step 1: Output the public parameter set PP; Step 2: Input the public parameter set PP to generate the key; Step 3: Input the public parameter set PP and the message to be signed. Generate a signature s with the private key sk; Step 4, input the public parameter set PP and the message to be verified. The signature 's' and public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified.
[0006] Based on the above method embodiments, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 1: selecting a finite field. Generate elliptic curve equations mod q, where a and b are both finite field parameters, and The points that satisfy the equation form an Abelian group Q; a generator is randomly selected. The coordinates of G are q is a finite field The number of elements in the hash function, the order of the Abelian group Q; the choice of hash function. Select a pseudo-random function Output public parameter set ;in, Let k be the set of integers 1, 2, ..., q-1, where k and x are both evaluation keys.
[0007] Based on the above method embodiments, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 2: randomly selecting... As the user's private key; initialization function , Random selection As the SOT private key; for all addresses for F is a pseudo-random function; calculate for Partial public key P=[d]G, random element R=[u]G; let ;make ; ; Returns a public / private key pair (vk, sk); where n is a natural number greater than 1. A function to generate a public key for users, used to generate a public key for verifying signatures; Indicates the generation of the corresponding address The user's public key, This is a partial public key generation function for SOT (System of Origin and Development), used to generate a public key for extracting the user's private key. A is a set of addresses, u is a partial result calculated by the pseudo-random function F, sk is the user's private key, and vk is the user's public key. To evaluate the key set.
[0008] Based on the above method embodiments, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 3: parsing. Random selection As the user's private key; calculation ; Calculate the point R = [u]G on the elliptic curve; Calculate ;calculate mod q; calculate mod q; output signature s; where r is a pseudo-random function. The calculated result, c, represents an intermediate result during the signature generation or verification process.
[0009] Based on the above method embodiments, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 4: parsing. ;calculate ;calculate ;calculate mod q; calculate ;judge If r is equal to r, the validation passes; otherwise, the validation fails. This represents the x-coordinate of a point on the elliptic curve. This represents the ordinate value of a point on the elliptic curve.
[0010] Secondly, embodiments of the present invention provide an SM2-based anti-dual authentication signature device, comprising: a first main module, used to implement step 1, system initialization, and input security parameters. The first main module outputs a public parameter set PP; the second main module implements step 2, which involves inputting the public parameter set PP to generate a key; the third main module implements step 3, which involves inputting the public parameter set PP and the message to be signed. Generate a signature s using the private key sk; the fourth main module is used to implement step 4, which involves inputting the public parameter set PP and the message to be verified. The signature 's' and public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified.
[0011] Thirdly, embodiments of the present invention provide an electronic device, comprising:
[0012] At least one processor; and
[0013] At least one memory communicatively connected to the processor, wherein:
[0014] The memory stores program instructions that can be executed by the processor. The processor can call the program instructions to execute the SM2-based anti-dual authentication signature method provided by any of the various implementations of the first aspect.
[0015] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions that cause a computer to execute the SM2-based anti-dual authentication signature method provided by any of the various implementations of the first aspect.
[0016] The SM2-based anti-dual authentication signature method and device provided in this invention employ anti-dual authentication signature, and have been implemented and tested. This is conducive to promoting the generalization process of cryptographic algorithms. The signature scheme meets the requirements of unforgeable security, and the implementation involves a small amount of computation, is highly efficient, and has great application potential. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart of an SM2-based anti-dual authentication signature method provided in an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the anti-dual authentication signature device based on SM2 provided in an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In addition, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined with each other to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0022] The SM2 algorithm is an elliptic curve cryptography algorithm released by the State Cryptography Administration and is one of the core technologies for cyberspace security. The standard document mainly includes four parts: general principles, digital signature algorithm, key exchange protocol, and public-key encryption algorithm. The hash algorithm used is the SM3 cryptographic hash algorithm, and the key derivation function is also defined in the standard. Based on the SM2 digital signature algorithm, a new method and system for generating signatures to prevent two-factor authentication is designed. While ensuring the correctness and unforgeability of the signature, it also meets the functional characteristics of two-factor authentication signatures, effectively connecting the key generation, signature generation, and signature verification algorithms of the SM2 signature scheme. Based on this idea, this invention provides an SM2-based method for preventing two-factor authentication signatures. See [link to relevant documentation]. Figure 1 The method includes: Step 1, system initialization, inputting security parameters. Step 1: Output the public parameter set PP; Step 2: Input the public parameter set PP to generate the key; Step 3: Input the public parameter set PP and the message to be signed. Generate a signature s with the private key sk; Step 4, input the public parameter set PP and the message to be verified. The signature 's' and public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified.
[0023] Based on the above method embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 1: selecting a finite field. Generate elliptic curve equations mod q, where a and b are both finite field parameters, and The points that satisfy the equation form an Abelian group Q; a generator is randomly selected. The coordinates of G are q is a finite field The number of elements in the hash function, the order of the Abelian group Q; the choice of hash function. Select a pseudo-random function Output public parameter set ;in, Let k be the set of integers 1, 2, ..., q-1, where k and x are both evaluation keys.
[0024] Based on the above method embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 2: randomly selecting... As the user's private key; initialization function , Random selection As the SOT private key; for all addresses for F is a pseudo-random function; calculate for Partial public key P=[d]G, random element R=[u]G; let ;make ; ; Returns a public / private key pair (vk, sk); where n is a natural number greater than 1. A function to generate a public key for users, used to generate a public key for verifying signatures; Indicates the generation of the corresponding address The user's public key, This is a partial public key generation function for SOT (System of Origin and Development), used to generate a public key for extracting the user's private key. A is a set of addresses, u is a partial result calculated by the pseudo-random function F, sk is the user's private key, and vk is the user's public key. To evaluate the key set.
[0025] Based on the above method embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 3: parsing. Random selection As the user's private key; calculation ; Calculate the point R = [u]G on the elliptic curve; Calculate ;calculate mod q; calculate mod q; output signature s; where r is a pseudo-random function. The calculated result, c, represents an intermediate result during the signature generation or verification process.
[0026] Based on the above method embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature method provided in this embodiment of the invention specifically includes step 4: parsing. ;calculate ;calculate ;calculate mod q; calculate ;judge If r is equal to r, the validation passes; otherwise, the validation fails. This represents the x-coordinate of a point on the elliptic curve. This represents the ordinate value of a point on the elliptic curve.
[0027] The SM2-based anti-dual authentication signature method provided in this invention employs anti-dual authentication signature, and has been implemented and tested. This is beneficial for promoting the generalization of cryptographic algorithms. The signature scheme meets the requirements of unforgeable security, and the implementation involves a small amount of computation, is highly efficient, and has great application potential.
[0028] The implementation of the various embodiments of the present invention is based on programmed processing through a device with processor functionality. Therefore, in practical engineering, the technical solutions and functions of the various embodiments of the present invention can be encapsulated into various modules. Based on this reality, and building upon the above embodiments, the embodiments of the present invention provide an SM2-based anti-dual authentication signature device, which is used to execute the SM2-based anti-dual authentication signature method in the above method embodiments. See also... Figure 2 The device includes: a first main module, used to implement step 1, system initialization, and input security parameters. The first main module outputs a public parameter set PP; the second main module implements step 2, which involves inputting the public parameter set PP to generate a key; the third main module implements step 3, which involves inputting the public parameter set PP and the message to be signed. Generate a signature s using the private key sk; the fourth main module is used to implement step 4, which involves inputting the public parameter set PP and the message to be verified. The signature 's' and public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified.
[0029] The SM2-based anti-dual authentication signature device provided in this embodiment of the invention adopts... Figure 2 Several modules in the system employ anti-dual authentication signatures, which are implemented and tested. This is beneficial for promoting the generalization of cryptographic algorithms. The signature scheme meets the requirements of unforgeable security, and the implementation involves a small amount of computation, is highly efficient, and has great application potential.
[0030] It should be noted that the apparatus in the device embodiments provided by the present invention can be used not only to implement the methods in the above method embodiments, but also to implement the methods in other method embodiments provided by the present invention. The difference lies only in the setting of corresponding functional modules. Its principle is basically the same as that of the above device embodiments provided by the present invention. As long as those skilled in the art, based on the above device embodiments and referring to the specific technical solutions in other method embodiments, obtain corresponding technical means and technical solutions composed of these technical means by combining technical features, and improve the apparatus in the above device embodiments while ensuring the practicality of the technical solutions, they can obtain corresponding device-type embodiments for implementing the methods in other method-type embodiments. For example:
[0031] Based on the above device embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature device provided in this embodiment of the invention further includes: a first submodule, used to implement step 1, specifically including: selecting a finite field. Generate elliptic curve equations mod q, where a and b are both finite field parameters, and The points that satisfy the equation form an Abelian group Q; a generator is randomly selected. The coordinates of G are q is a finite field The number of elements in the hash function, the order of the Abelian group Q; the choice of hash function. Select a pseudo-random function Output public parameter set ;in, Let k be the set of integers 1, 2, ..., q-1, where k and x are both evaluation keys.
[0032] Based on the above device embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature device provided in this embodiment of the invention further includes: a second submodule, used to implement step 2, specifically including: randomly selecting... As the user's private key; initialization function , Random selection As the SOT private key; for all addresses for F is a pseudo-random function; calculate for Partial public key P=[d]G, random element R=[u]G; let ;make ; ; Returns a public / private key pair (vk, sk); where n is a natural number greater than 1. A function to generate a public key for users, used to generate a public key for verifying signatures; Indicates the generation of the corresponding address The user's public key, This is a partial public key generation function for SOT (System of Origin and Development), used to generate a public key for extracting the user's private key. A is a set of addresses, u is a partial result calculated by the pseudo-random function F, sk is the user's private key, and vk is the user's public key. To evaluate the key set.
[0033] Based on the above device embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature device provided in this embodiment of the invention further includes: a third submodule, used to implement step 3, specifically including: parsing Random selection As the user's private key; calculation ; Calculate the point R = [u]G on the elliptic curve; Calculate ;calculate mod q; calculate mod q; output signature s; where r is a pseudo-random function. The calculated result, c, represents an intermediate result during the signature generation or verification process.
[0034] Based on the above device embodiments, as an optional embodiment, the SM2-based anti-dual authentication signature device provided in this embodiment of the invention further includes: a fourth submodule, used to implement step 4, specifically including: parsing ;calculate ;calculate ;calculate mod q; calculate ;judge If r is equal to r, the validation passes; otherwise, the validation fails. This represents the x-coordinate of a point on the elliptic curve. This represents the ordinate value of a point on the elliptic curve.
[0035] The method in this embodiment of the invention is implemented using an electronic device; therefore, it is necessary to introduce the relevant electronic device. For this purpose, this embodiment of the invention provides an electronic device, such as... Figure 3 As shown, the electronic device includes at least one processor, a communications interface, at least one memory, and a communications bus, wherein the at least one processor, the communications interface, and the at least one memory communicate with each other via the communications bus. The at least one processor can invoke logical instructions stored in the at least one memory to execute all or part of the steps of the methods provided in the foregoing method embodiments.
[0036] Furthermore, when the logical instructions in at least one of the aforementioned memories can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various method embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0037] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0038] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0039] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Based on this understanding, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0040] It should be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for preventing two-factor authentication signatures based on SM2, characterized in that, include: Step 1: System initialization, input security parameters Step 1: Output the public parameter set PP; Step 2: Input the public parameter set PP to generate the key; Step 3: Input the public parameter set PP and the message to be signed. Generate a signature s with the private key sk; Step 4, input the public parameter set PP and the message to be verified. The signature 's' and the public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified; Step 1 specifically includes: selecting a finite field Generate elliptic curve equations mod q, where a and b are both finite field parameters, and The points that satisfy the equation form an Abelian group Q; a generator is randomly selected. The coordinates of G are q is a finite field The number of elements in the hash function, the order of the Abelian group Q; the choice of hash function. Select a pseudo-random function Output public parameter set ;in, Let k be the set of integers 1, 2, ..., q-1, where k and x are both evaluation keys; Step 2 specifically includes: randomly selecting As the user's private key; initialization function , Random selection As the SOT private key; for all addresses for F is a pseudo-random function; calculate for Partial public key P=[d]G, random element R=[u]G; let ;make ; ; Returns a public / private key pair (vk, sk); where n is a natural number greater than 1. A function to generate the user's public key, used to generate a public key for verifying signatures; Indicates the generation of the corresponding address The user's public key, This is a partial public key generation function for SOT (System of Origin and Development), used to generate a public key for extracting the user's private key. A is a set of addresses, u is a partial result calculated by the pseudo-random function F, sk is the user's private key, and vk is the user's public key. To evaluate the key set; Step 3 specifically includes: analysis Random selection As the user's private key; calculation ; Calculate the point R = [u]G on the elliptic curve; Calculate ;calculate mod q; calculate mod q; output signature s; where r is a pseudo-random function. The calculated result, c, represents an intermediate result during the signature generation or verification process; Step 4 specifically includes: analysis ;calculate ;calculate ;calculate modq; calculate ;judge If r is equal to r, the validation passes; otherwise, the validation fails. This represents the x-coordinate of a point on the elliptic curve. This represents the ordinate value of a point on the elliptic curve.
2. A dual authentication signature device based on SM2 using the method of claim 1, characterized in that, include: The first main module is used to implement step 1, system initialization, and inputting security parameters. The first main module outputs a public parameter set PP; the second main module implements step 2, which involves inputting the public parameter set PP to generate a key; the third main module implements step 3, which involves inputting the public parameter set PP and the message to be signed. Generate a signature s using the private key sk; the fourth main module is used to implement step 4, which involves inputting the public parameter set PP and the message to be verified. The signature 's' and the public key 'vk' are used for verification; among them, is the address portion of the message m to be verified; p is the content payload of the message m to be verified.
3. An electronic device, characterized in that, include: At least one processor, at least one memory, and a communication interface; wherein, The processor, memory, and communication interface communicate with each other; The memory stores program instructions that can be executed by the processor, which invokes the program instructions to perform the method of claim 1.
4. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the method of claim 1.
Citation Information
Patent Citations
Dual-authentication method and device based on identity passwords and fingerprint identification
CN104639315A
Mobile health medical sensor data privacy protection method based on certificateless dual authentication protection aggregate signature
CN108881279A