Dual authentication prevention signature generation method and device, equipment and storage medium
By generating a user time private key based on time period, the problem of poor security performance in the prior art against dual-factor authentication signatures is solved, and effective signature and verification of different content payloads under the same address is realized to prevent illegal user behavior.
Patent Information
- Application Number
- CN202411528650.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In the prior art, the security performance of anti-dual authentication signatures is poor, and it is impossible to effectively suppress and punish the creation of double signatures for different content payloads under the same address.
By obtaining the security parameters and address set of the target system, the public parameters and system master private key of the target system are determined, the user private key of the target user is generated based on these parameters, and the user time private key is generated within the current time period for signature and verify.
During the same time period, when the target user signs two messages at the same address, the user's private key extraction condition will be triggered, exposing the target user's private key, thereby preventing "one vote and multiple votes" and "double spending" and other illegal user behaviors to improve the security performance of signatures.
Smart Images

Figure CN119402209A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a method, device, equipment and storage medium for generating an anti-double authentication signature. Background Art
[0002] Digital signature technology is a key cryptographic tool designed to verify the integrity of messages and prevent forgery. As part of the public key cryptography system, it plays an important role in many scenarios in our daily lives. By using the signer's private key and hash function, additional data can be added to the message data unit or encrypted, so that the receiver can verify the source of the data and ensure its integrity and authenticity. According to different application requirements, digital signatures have developed into various forms, including group signatures, ring signatures, blind signatures, and threshold signatures.
[0003] Double authentication prevention signature (DAPS) is a signature technology that aims to sign two messages with the same first part (called address) but different second parts (called content payload), thereby allowing the secret signing key to be publicly extracted without revealing the identity of the signer. DAPS is mainly used to suppress and punish the creation of double signatures for different content payloads under the same address, such as punishing certificate authorities that distribute different key certificates for the same domain name in the PKI system, or defending against double spending attacks in transaction systems. However, in practical applications, restrictions on double authentication are usually time-limited, and the existing conditions for double authentication prevention signatures are often too absolute and have poor security performance.
[0004] There is currently no effective solution to the problem of poor signature security performance in the prior art. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for generating a double-authentication-proof signature, so as to solve the defect of poor signature security performance in the prior art.
[0006] In a first aspect, the present invention provides a method for generating an anti-double authentication signature, comprising: Obtain security parameters and an address set of a target system, and determine public parameters and a system master private key of the target system; Obtaining the user identity of the target user, and generating a user private key of the target user based on the public parameters of the target system and the system master private key; Obtaining a time index, and generating a user time private key of the target user in the current time period based on the user private key of the target user; A message is received, a signature is generated based on the user time private key of the target user and the corresponding time index, and the signature is verified.
[0007] According to a double authentication-proof signature generation method provided by the present invention, a security parameter and an address set of a target system are obtained, and a public parameter and a system master private key of the target system are determined, including: Selecting a pseudo-random generation function based on a trapdoor generation algorithm and determining a private key; the private key belongs to a secret key space of the pseudo-random generation function; For each address in the address set of the target system, determine an address public key based on the private key; A time interval value is determined, and a public parameter of the target system is determined based on the time interval value, and a system master private key of the target system is determined.
[0008] According to a method for generating a double authentication-proof signature provided by the present invention, the user identity of a target user is obtained, and a user private key of the target user is generated based on the public parameters of the target system and the system master private key, including: Obtaining the user identity of the target user; Based on the original image sampling algorithm, the user identity of the target user is taken as input to generate a user private key of the target user.
[0009] According to a method for generating a double authentication-proof signature provided by the present invention, a time index is obtained, and a user time private key of the target user in the current time period is generated based on the user private key of the target user, including: Obtaining the time index; Based on the original image sampling algorithm, the time index is used as input to generate the user time key of the target user in the low-priority time period.
[0010] According to a method for generating a double authentication-proof signature provided by the present invention, a message is received, and a signature is generated based on a user time private key of the target user and a corresponding time index, including: Receive the message, parse the message and the corresponding address public key; A random vector is extracted, a hash value is determined based on the random vector, and the signature is generated according to the hash value calculation result; if the signature cannot be generated, a random vector is re-extracted.
[0011] According to a method for generating a double authentication proof signature provided by the present invention, the signature is verified, comprising: Parsing the message and the corresponding address public key; Based on the analysis result, determine whether the signature meets the preset conditions and verify the signature.
[0012] According to a method for generating a double authentication proof signature provided by the present invention, after verifying the signature, the method further comprises: The message and the signature of the target user are parsed, and the long-term private key of the target user is extracted.
[0013] In a second aspect, the present invention further provides a double authentication prevention signature generation device, comprising: An initialization module, used to obtain security parameters and an address set of a target system, and determine public parameters and a system master private key of the target system; An acquisition module, used to acquire the user identity of a target user, and generate a user private key of the target user based on the public parameters of the target system and the system master private key; A processing module, used for acquiring a time index, and generating a user time private key of the target user in a current time period based on a user private key of the target user; The generation module is used to receive a message, generate a signature based on the user time private key of the target user and the corresponding time index, and verify the signature.
[0014] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for generating an anti-double authentication signature as described in the first aspect above is implemented.
[0015] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the anti-double authentication signature generation method as described in the first aspect above.
[0016] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the anti-double authentication signature generation method as described in the first aspect above.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The anti-double authentication signature generation method provided by the present invention generates a corresponding user private key based on the public identity information of the target user. If the target user signs two messages at the same address within the same time period, the user private key extraction condition will be triggered, exposing the user private key of the target user. If the two messages are signed within different time periods, it is legal to sign them. This can prevent illegal user behaviors such as "multiple votes for one vote" and "double spending", and solves the problem of poor signature security performance in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flow chart of the method for generating a double authentication-proof signature provided by the present invention; Figure 2 It is a structural block diagram of the anti-double authentication signature generation device provided by the present invention; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The present invention provides a method for generating a double authentication-proof signature. Figure 1 is a flow chart of the method for generating a double authentication signature provided by the present invention. Figure 1 As shown, the method comprises the following steps: Step S101, obtaining the security parameters and address set of the target system, and determining the public parameters and system master private key of the target system.
[0022] Step S102, obtaining the user identity of the target user, and generating the user private key of the target user based on the public parameters of the target system and the system master private key.
[0023] Step S103, obtaining a time index, and generating a user time private key of the target user in the current time period based on the user private key of the target user.
[0024] Step S104, receiving the message, generating a signature based on the target user's user time private key and the corresponding time index, and verifying the signature.
[0025] For example, obtaining security parameters of the target system and address collection , the address set contains elements, based on security parameters and address collection Determine the common parameters of the target system pp And the system master private key msk Then, get the user identity of the target user ID , for the target user, according to the public parameters of the target system pp , System Master Private Key msk and address collection Determine the target user's private key Then, get the time index t j , according to the common parameters of the target system pp , System Master Private Key msk ,User ID ID and time index t j Generate the target user's user time private key for the current time period tsk j Finally, accept the message μ, based on the target user's user time private key tsk j and the corresponding time index t j Generate signature , and sign In this method, the corresponding user private key is generated based on the public identity information of the target user. If the target user signs two messages at the same address in the same time period, the user private key extraction condition will be triggered, exposing the user private key of the target user. If two messages are signed in different time periods, it is legal, which can prevent illegal user behaviors such as "multiple votes for one vote" and "double spending", and solve the problem of poor signature security performance in the prior art.
[0026] In some of the embodiments, step S101, obtaining the security parameters and address set of the target system, and determining the public parameters and system master private key of the target system, includes: selecting a pseudo-random generation function based on a trapdoor generation algorithm, and determining the private key; the private key belongs to the key space of the pseudo-random generation function; for each address in the address set of the target system, determining the address public key based on the private key; determining the time interval value, and determining the public parameters of the target system based on the time interval value, and determining the system master private key of the target system.
[0027] Exemplarily, the trapdoor generation algorithm is run, and the formula of the trapdoor generation algorithm is as follows:
[0028] in, q is a prime number, n is the grid parameter, represents the generated matrix, Indicates its trapdoor, represents a set of integers,m is the parameter on the grid. Select a pseudo-random generator function and select its private key , the formula of the pseudo-random generator function is as follows:
[0029] in, represents a pseudo-random generator function, represents the key space, represents the input space, Represents the output space. The calculation formula of the hash function is as follows:
[0030]
[0031]
[0032] in, n , k is the grid parameter, q is a prime number, represents a set of integers, v express Output vector, Indicates system parameters. For each address , , calculate the address public key, the calculation formula is as follows:
[0033] in, Represents a pseudo-random generator function The key of Indicates the address, Represents a pseudo-random generator function The output result is, k Select the time interval value shown. , and output common parameters pp , System Master Private Key msk , the specific formula is as follows:
[0034]
[0035] in, pp Represents public parameters, q is a prime number, n , m , k is the grid parameter, τ is the time parameter, is the time interval value, Represents the system master public key, Represents a collection of addresses; msk Indicates the system master private key, Indicates the system's partial master private key, β Represents the system's partial master private key.
[0036] In some of the embodiments, step S102, obtaining the user identity of the target user, and generating the user private key of the target user based on the public parameters of the target system and the system master private key, includes: obtaining the user identity of the target user; based on the original image sampling algorithm, taking the user identity of the target user as input, generating the user private key of the target user.
[0037] Exemplarily, the original image sampling algorithm is run, and the formula of the original image sampling algorithm is as follows:
[0038] in, represents the generated matrix, Indicates its trapdoor, represents the Gaussian parameter, is a hash function, ID is the user identity, Indicates the specific content of the user's long-term private key. q is a prime number, m , k is the grid parameter, Represents an integer set. Based on the original image sampling algorithm, the user private key of the target user is generated. The specific formula is as follows:
[0039] in, uk Represents the user's private key. Indicates the specific content of the user's long-term private key.
[0040] In some of the embodiments, step S103, obtaining a time index, and generating a user time private key of the target user in the current time period based on the user private key of the target user, includes: obtaining a time index; based on the original image sampling algorithm, taking the time index as input, generating a user time key of the target user in the low-current time period.
[0041] Exemplarily, the original image sampling algorithm is run, and the formula of the original image sampling algorithm is as follows:
[0042] in, represents the generated matrix, Indicates its trapdoor, represents the Gaussian parameter, is a hash function, ID is the user identity, t j is the time index, Indicates the specific content of the user's time private key. q is a prime number, m , k is the grid parameter, Represents an integer set. Based on the original image sampling algorithm, the user time private key of the target user is output. The specific formula is as follows:
[0043] in, tsk j Represents the user's time private key, Indicates the specific content of the user's time private key.
[0044] Based on the above embodiment, step S104, receiving a message, and generating a signature based on the user time private key of the target user and the corresponding time index, includes: accepting a message, parsing the message and the corresponding address public key; extracting a random vector, determining a hash value based on the random vector, and generating a signature according to the hash value calculation result; if the signature cannot be generated, re-extracting a random vector.
[0045] For example, first, parse the received message μ , ,in, Indicates the address, p Indicates the payload. And, parse the corresponding address public key, , Represents the address public key, v express Output vector, k is the grid parameter. Then, a random vector is drawn , y represents the mask vector, D represents the Gaussian distribution, represents the corresponding Gaussian parameters, m Represents the parameters on the grid. And calculate the hash value. The specific formula is as follows:
[0046]
[0047]
[0048] in, h express The output value of H 2 represents the hash function, represents the generated matrix, represents the mask vector, μ Indicates a message; z Indicates the intermediate calculation results, Indicates the specific content of the user's long-term private key. PProbability output of 1 ,by P The probability output of 2 w . P 1 and P The specific formula of 2 is as follows:
[0049]
[0050] in, m Indicates the parameters on the grid, represents the corresponding Gaussian parameters, Indicates the specific content of the user's long-term private key, and M indicates the average number of rounds of algorithm repetition. If both can be output, a signature is generated. ; Otherwise, re-draw the random vector for calculation.
[0051] On the basis of this embodiment, the signature is verified, including: parsing the message and the corresponding address public key; based on the parsing result, judging whether the signature meets the preset conditions, and verifying the signature.
[0052] Specifically, parse the message and signature, message , ; Parse the corresponding address public key ,in a Indicates the address. Determine whether the preset condition is met. If so, output 1, indicating that the signature is legal. Otherwise, output 0, indicating that the signature is illegal. The specific formula of the preset condition is as follows:
[0053] in, z Indicates a partial signature, m Indicates the parameters on the grid, represents the corresponding Gaussian parameters, w Indicates a partial signature, H 1. H 2 represents the hash function, A represents the generated matrix, h express The output value of μ Indicates the message, q represents a prime number, ID Indicates the user identity. t i Represents the time index, Represents the address public key.
[0054] Furthermore, after the signature is verified, the method further includes: parsing the message and the signature of the target user, and extracting the long-term private key of the target user.
[0055] For example, for the message , , and the corresponding signature , . Parse the message and the corresponding signature. The specific formula is as follows:
[0056]
[0057]
[0058]
[0059] in, and Indicates the address, and represents the load, t 1 and t 2 indicates two specific time indexes. If the condition is met , then extract the long-term private key of the target user. The specific formula is as follows:
[0060] in, Indicates a long-term private key. If the condition is not met, then output .
[0061] The present invention also provides an anti-double authentication signature generation device. The anti-double authentication signature generation device provided by the present invention is described below. The anti-double authentication signature generation device described below and the anti-double authentication signature generation method described above can be referenced to each other. Figure 2 is a structural block diagram of the anti-double authentication signature generation device provided by the present invention, such as Figure 2 As shown, the device comprises: Initialization module 201, used to obtain the security parameters and address set of the target system, and determine the public parameters and system master private key of the target system; An acquisition module 202 is used to acquire the user identity of the target user and generate a user private key of the target user based on the public parameters of the target system and the system master private key; The processing module 203 is used to obtain a time index and generate a user time private key of the target user in the current time period based on the user private key of the target user; The generation module 204 is used to receive a message, generate a signature based on the user time private key of the target user and the corresponding time index, and verify the signature.
[0062] When the device is in use, the initialization module 201 obtains the security parameters of the target system. and address collection , the address set contains elements, based on security parameters and address collection Determine the common parameters of the target system pp And the system master private key msk Then, the acquisition module 202 acquires the user identity of the target user ID , for the target user, according to the public parameters of the target system pp , System Master Private Key msk and address collection Determine the target user's private key Then, the processing module 203 obtains the time index t j , according to the common parameters of the target system pp , System Master Private Key msk ,User ID ID and time index t j Generate the target user's user time private key for the current time period tsk j Finally, the generation module 204 receives the message μ and generates the target user's private time key based on the target user's private time key. tsk j and the corresponding time index t j Generate signature , and sign When the device is used, the corresponding user private key is generated based on the public identity information of the target user. If the target user signs two messages at the same address in the same time period, the user private key extraction condition will be triggered, exposing the user private key of the target user. If two messages are signed in different time periods, it is legal, which can prevent illegal user behaviors such as "multiple votes for one vote" and "double spending", and solve the problem of poor signature security performance in the prior art.
[0063] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 communicate with each other through the communication bus 304. The processor 301 may call the logic instructions in the memory 303 to execute the anti-double authentication signature generation method, which includes: Obtain the target system's security parameters and address set, and determine the target system's public parameters and system master private key; Obtain the user identity of the target user, and generate the user private key of the target user based on the public parameters of the target system and the system master private key; Obtain the time index, and generate the target user's user time private key in the current time period based on the target user's user private key; Receive the message, generate a signature based on the target user's user time private key and the corresponding time index, and verify the signature.
[0064] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0065] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the anti-double authentication signature generation method provided by the above methods, the method includes: Obtain the target system's security parameters and address set, and determine the target system's public parameters and system master private key; Obtain the user identity of the target user, and generate the user private key of the target user based on the public parameters of the target system and the system master private key; Obtain the time index, and generate the target user's user time private key in the current time period based on the target user's user private key; Receive the message, generate a signature based on the target user's user time private key and the corresponding time index, and verify the signature.
[0066] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a double authentication-proof signature provided by the above methods is implemented, and the method includes: Obtain the target system's security parameters and address set, and determine the target system's public parameters and system master private key; Obtain the user identity of the target user, and generate the user private key of the target user based on the public parameters of the target system and the system master private key; Obtain the time index, and generate the target user's user time private key in the current time period based on the target user's user private key; Receive the message, generate a signature based on the target user's user time private key and the corresponding time index, and verify the signature.
[0067] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a signature to prevent double authentication, characterized in that: include: Obtain security parameters and an address set of a target system, and determine public parameters and a system master private key of the target system; Obtaining the user identity of the target user, and generating a user private key of the target user based on the public parameters of the target system and the system master private key; Obtaining a time index, and generating a user time private key of the target user in the current time period based on the user private key of the target user; A message is received, a signature is generated based on the user time private key of the target user and the corresponding time index, and the signature is verified.
2. The method for generating a double authentication-proof signature according to claim 1, characterized in that: Obtaining the security parameters and address set of the target system, and determining the public parameters and system master private key of the target system, including: Selecting a pseudo-random generation function based on a trapdoor generation algorithm and determining a private key; the private key belongs to a secret key space of the pseudo-random generation function; For each address in the address set of the target system, determine an address public key based on the private key; A time interval value is determined, and a public parameter of the target system is determined based on the time interval value, and a system master private key of the target system is determined.
3. The method for generating a double authentication-proof signature according to claim 1, characterized in that: Acquiring the user identity of the target user and generating the user private key of the target user based on the public parameters of the target system and the system master private key, including: Obtaining the user identity of the target user; Based on the original image sampling algorithm, the user identity of the target user is taken as input to generate a user private key of the target user.
4. The method for generating a double authentication-proof signature according to claim 1, characterized in that: Acquiring a time index, and generating a user time private key of the target user in the current time period based on the user private key of the target user, including: Obtaining the time index; Based on the original image sampling algorithm, the time index is used as input to generate the user time key of the target user in the low-priority time period.
5. The method for generating a double authentication-proof signature according to claim 2, characterized in that: Receiving a message, generating a signature based on the target user's user time private key and the corresponding time index, including: Receive the message, parse the message and the corresponding address public key; A random vector is extracted, a hash value is determined based on the random vector, and the signature is generated according to the hash value calculation result; if the signature cannot be generated, a random vector is re-extracted.
6. The method for generating a double authentication-proof signature according to claim 5, characterized in that: Verifying the signature includes: Parsing the message and the corresponding address public key; Based on the analysis result, determine whether the signature meets the preset conditions and verify the signature.
7. The method for generating a double authentication-proof signature according to claim 1, characterized in that: After verifying the signature, the method further includes: The message and the signature of the target user are parsed, and the long-term private key of the target user is extracted.
8. A double authentication-proof signature generation device, characterized in that: include: An initialization module, used to obtain security parameters and an address set of a target system, and determine public parameters and a system master private key of the target system; An acquisition module, used to acquire the user identity of a target user, and generate a user private key of the target user based on the public parameters of the target system and the system master private key; A processing module, used for acquiring a time index, and generating a user time private key of the target user in a current time period based on a user private key of the target user; The generation module is used to receive a message, generate a signature based on the user time private key of the target user and the corresponding time index, and verify the signature.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the anti-double authentication signature generation method as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a double authentication-proof signature as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Secret key processing method and device
CN104753666A
Identity-based blind signature method on lower lattice of standard model
CN106533699A
Certificateless searchable public key encryption method and system for time-limited revocation of search token
CN113422685A
Identity-based forward security ring signature method
CN113505396A
SM9-based dual authentication signature prevention method and system
CN116346352A