Signature and verification method and device, equipment and medium
By using randomly selected signer private keys and preset system parameters in linkable ring signature technology to generate group-independent signature tags, the problem in the prior art that linkable signatures cannot be determined independently of the group under any circumstances, achieving higher signature verification efficiency and security.
Patent Information
- Application Number
- CN202411759122.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-02-28
AI Technical Summary
The existing linkable ring signature technology cannot determine linkable signatures from the same signer independently of the group under any circumstances, resulting in dishonest signature behaviors in scenarios such as anonymous voting and electronic payment.
By randomly selecting the first random number from the first preset addition loop group as the signer's private key of the signer, and determining the signer public key and tag based on the preset system parameters, a target linkable ring signature containing the signer tag is generated. This signer tag is independent of the target public key collection, ensuring uniqueness of the signer tag, thus achieving group-independent linkability.
Ensure that linkable ring signatures are independent of the group in any case, and can effectively determine linkable signatures from the same signer, reducing the abuse and fraud of linkable ring signatures by dishonest persons.
Smart Images

Figure CN119544231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital signatures, and in particular to a signature and verification method, device, equipment and medium. Background Art
[0002] Ordinary ring signature schemes cannot associate messages signed by the same signer due to their anonymity and untraceability, resulting in dishonest signers casting multiple votes or spending the same funds multiple times in scenarios such as anonymous voting and electronic payment. At present, in order to solve this problem, the academic community has proposed the linkable ring signature technology. Compared with the ordinary ring signature scheme, the linkable ring signature scheme can associate messages signed by the same signer. Among them, there are few studies on linkable ring signature schemes based on SM2 (elliptic curve public key cryptography algorithm), which cannot meet the privacy protection needs in the digital economy era. There is a design scheme for linkable ring signatures, which designs three schemes by embedding secure signature tags on the basis of the SM2 ring signature scheme. However, the security tags in these schemes are all associated with the public key set selected by the user. If the signer does not want to associate his two signatures, he only needs to select a different public key set. In the signature verification link, due to the different selected public key sets, the security tag verification is inconsistent, and two signatures from the same signer cannot be linked, and linkability independent of the group cannot be achieved.
[0003] In summary, how to ensure that the linkable ring signature is independent of the group and thus determine that the linkable signature comes from the same signer under any circumstances is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a signature and verification method, device, equipment and medium, which can ensure that the linkable ring signature is independent of the group and thus can determine the linkable signature from the same signer under any circumstances. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a signature and verification method, which is applied to a signature and verification system, including:
[0006] Randomly selecting a first random number from a first preset addition cycle group, using the first random number as a signer private key of the signer, and determining a signer public key according to preset system parameters and the signer private key;
[0007] Determine a signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the signer's target message according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag;
[0008] The target message and the target linkable ring signature are sent to a signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
[0009] Optionally, determining the signer public key according to the preset system parameters and the signer private key includes:
[0010] Determine the product of the public key generation factor in the preset system parameters and the signer's private key as the signer's public key;
[0011] The public key generation factor is a first generator of a second preset additive cyclic group; the order of the second preset additive cyclic group is consistent with the order of the first preset additive cyclic group.
[0012] Optionally, after randomly selecting a first random number from a first preset addition cycle group, using the first random number as a signer private key of the signer, and determining a signer public key according to preset system parameters and the signer private key, the method further includes:
[0013] A number of non-signer public keys are randomly selected to form the target public key set according to the number of non-signer public keys and the signer public key.
[0014] Optionally, determining the signer tag according to the signer private key and the preset system parameter includes:
[0015] The product of the signer private key and the label blinding factor in the preset system parameter is determined as the signer label; the label blinding factor is the second generator of the second preset additive cyclic group.
[0016] Optionally, generating a target linkable ring signature corresponding to the target message of the signer according to the preset system parameter, the signer tag, and a target public key set including the signer's public key includes:
[0017] Randomly selecting a second random number from the first preset addition cycle group, and performing an operation on the second random number, a target public key set including the signer's public key, the signer tag, the signer's target message, and the preset system parameter through a preset secure hash function to obtain a first hash value;
[0018] Randomly selecting a target random number group from the first preset addition cycle group, and performing a cyclic operation on the target random number group, the preset system parameters, the target public key set, the signer tag, the first hash value, and the target message through the preset secure hash function to obtain a plurality of hash values corresponding to the target public key set, until a repeated hash value appears in the plurality of hash values, so as to use the repeated hash value as the second hash value;
[0019] Determine a third hash value corresponding to the target message from the plurality of hash values, and calculate a target product of the third hash value and the signer private key, and a target sum value between the signer private key and a preset number of units;
[0020] Calculating a target difference between the second random number and the target product, and performing a modulo operation on the order based on a ratio of the target difference to the target sum value to obtain a corresponding target operation result;
[0021] The target operation result is used as the signer signature, and a target linkable ring signature corresponding to the target message is generated according to the signer signature, the target public key set, the signer tag, the second hash value and the target random number group.
[0022] Optionally, the correctness verification of the plurality of linkable ring signatures corresponding to the plurality of received messages includes:
[0023] Verify whether target parameters in several linkable ring signatures corresponding to several received messages belong to the first preset addition cycle group; the target parameters are the second hash value, the signer signature and the target random number group in the several linkable ring signatures;
[0024] If the target parameter belongs to the first preset additive cyclic group, performing cyclic operations on the messages to be verified among the plurality of messages respectively to determine whether a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified of the message to be verified is obtained;
[0025] If a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified is obtained, it indicates that the linkable ring signature to be verified passes the verification.
[0026] Optionally, the determining the linkable signature from the signer based on the target linkable ring signature among the plurality of linkable ring signatures includes:
[0027] Comparing the signer tag in the target linkable ring signature with the tag in the linkable ring signature to be verified that has passed verification;
[0028] If the tag in the linkable ring signature to be verified is consistent with the signer tag, the linkable ring signature to be verified and the target linkable ring signature corresponding to the signer tag are determined as linkable signatures from the signer.
[0029] In a second aspect, the present application provides a signature and verification device, which is applied to a signature and verification system, including:
[0030] a public key determination module, configured to randomly select a first random number from a first preset addition cycle group, use the first random number as a signer private key of the signer, and determine the signer public key according to preset system parameters and the signer private key;
[0031] a signature generation module, configured to determine a signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the signer's target message according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag;
[0032] A message determination module is used to send the target message and the target linkable ring signature to a signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
[0033] In a third aspect, the present application provides an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] The processor is used to execute the computer program to implement the aforementioned signing and verification method.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned signature and verification method is implemented.
[0037] In the present application, a first random number is randomly selected from a first preset addition cycle group to use the first random number as the signer's signer private key, and the signer public key is determined according to the preset system parameters and the signer private key; the signer tag is determined according to the signer private key and the preset system parameters, and a target linkable ring signature corresponding to the signer's target message is generated according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag; the target message and the target linkable ring signature are sent to a signature verification end, so that the signature verification end verifies the correctness of several linkable ring signatures corresponding to several received messages, and determines a linkable signature from the signer based on the target linkable ring signature among the several linkable ring signatures. As can be seen from the above, the present application uses the first random number randomly selected from the first preset addition cycle group as the signer's signer private key, and determines the signer public key and the signer tag based on the signer private key and the preset system parameters, and generates the target linkable ring signature corresponding to the signer's target message using the preset system parameters, the signer tag and the target public key set containing the signer public key. After the target message and the target linkable ring signature are sent to the signature verification end, the signature verification end performs correctness verification and linkability verification on the linkable ring signatures corresponding to the received messages. In this way, the preset system parameters unrelated to the target public key set are selected as the tag blinding factor through the above process of the present application, and the signer private key is associated with the tag blinding factor to generate the signer tag. The target linkable ring signature generated by the signer tag is used to verify and link the messages received by the signature verification end, which can ensure the uniqueness of the signer tag to achieve linkability independent of the group, thereby ensuring that the linkable ring signature is independent of the group and can determine the linkable signature from the same signer under any circumstances. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0039] Figure 1 A flow chart of a signature and verification method disclosed in this application;
[0040] Figure 2 A specific signature and verification method flow chart disclosed in this application;
[0041] Figure 3 This is a schematic diagram of the structure of a signature and verification device disclosed in this application;
[0042] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0044] At present, there are few studies on linkable ring signature schemes based on SM2, which cannot meet the privacy protection needs of the digital economy era. There is a design scheme for linkable ring signatures, in which the embedded security signature tags are associated with the public key set selected by the user, so that if the public key set selected by the signer is different when signing, two signatures from the same signer cannot be linked together, and linkability independent of the group is not achieved, which may still lead to abuse and fraud.
[0045] In order to overcome the above technical problems, the present application provides a signing and verification method to ensure that the linkable ring signature is independent of the group and that the linkable signature from the same signer can be determined in any case.
[0046] See also Figure 1 As shown, the embodiment of the present invention discloses a signature and verification method, which is applied to a signature and verification system, including:
[0047] Step S11: randomly select a first random number from a first preset addition cycle group, use the first random number as the signer's signer private key, and determine the signer public key according to preset system parameters and the signer private key.
[0048] In this embodiment, the message signing end in the signature and verification system first randomly selects a first random number from the first preset additive cyclic group as the signer's signer private key, and determines the signer's public key based on the preset system parameters and the signer's private key. The first preset additive cyclic group is of order The additive cyclic group of ; is a prime number and can be set by the signer through the corresponding setting interface. It should be noted that the preset system parameters may include large prime numbers , the order is the large prime number Finite field of , defined in the finite field Elliptic curve on , by the elliptic curve The second preset additive cyclic group composed of the points on , prime numbers , the second preset addition cyclic group The first generator of and the second generator , preset secure hash function The order of the second preset additive cyclic group G is the same as that of the first preset additive cyclic group G. The order of is the same, that is, a prime number ; The preset secure hash function A string of any length can be mapped to the first preset addition cyclic group That is, the expression of the preset system parameter can be specifically:
[0049] ;
[0050] In order to obtain the preset system parameters, this embodiment can use the preset system initialization algorithm to input the security parameters , to obtain the preset system parameters output by the system initialization algorithm. Among them, the security parameters Contains prime numbers set by the signer through the corresponding setting interface In a specific implementation, this embodiment can use a probabilistic primality test algorithm to generate large prime numbers. , defined as ranging from 0 to The finite field of integers And define a Elliptic curves on and satisfying the Weierstrass equation , based on the elliptic curve The points on generate a point of order The additive cyclic group is used as the second preset additive cyclic group And select the second preset additive cyclic group Two of them can generate the entire second preset addition cycle group The generators of With the second generator Finally, a cryptographically secure hash function is selected as the preset secure hash function. And the above large prime number , finite field The parameters are integrated into the preset system parameters Among them, the The size of is usually set according to the required ring signature security level, such as 256 bits, 384 bits, etc.; the probabilistic primality test algorithm includes but is not limited to the Fermat algorithm, the Solovay-Strassen algorithm (i.e., the Solovay-Strassen algorithm), the Miller-Rabin algorithm (i.e., the Miller-Rabin algorithm), etc.; the algorithm standard of the secure hash function includes but is not limited to the Secure Hash Algorithm (i.e., the Secure Hash Algorithm, SHA), the Whirlpool algorithm (i.e., the Whirlpool algorithm), the SM3 cryptographic hash algorithm, etc.
[0051] Specifically, determining the signer public key according to the preset system parameters and the signer private key may include: determining the product of the public key generation factor in the preset system parameters and the signer private key as the signer public key; wherein the public key generation factor is the first generator of the second preset additive cyclic group; the order of the second preset additive cyclic group is consistent with the order of the first preset additive cyclic group. That is, the formula for determining the signer public key may specifically be:
[0052] ;
[0053] in, is the signer's public key, is the signer's private key, Characterizes the signer.
[0054] It is understandable that before signing the target message of the signer, in addition to determining the signer's public key and the signer's private key, it is also necessary to select other public keys as the public keys of the ring members to obfuscate and protect the privacy of the signer. Therefore, after determining the signer's public key, this embodiment can also randomly select several non-signer public keys to form a target public key set based on the several non-signer public keys and the signer public key. For example, randomly select non-signer public keys, and the target public key set is formed based on the non-signer public keys and the signer public keys. That is, the determination formula of the target public key set can be specifically:
[0055] ;
[0056] in, is the target public key set, and the signer public key is the A public key, that is In this way, the present embodiment first uses a preset system initialization algorithm to obtain the preset system parameters, and determines the signer private key, the signer public key and the target public key set of the signer based on the preset system parameters and the first random number randomly selected from the first preset addition cycle group, so as to determine the relevant parameters required to generate the target linkable ring signature, prepare for the subsequent generation of the target linkable ring signature, and improve the efficiency of signature verification.
[0057] Step S12: determine the signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the target message of the signer according to the preset system parameters, the signer tag, and a target public key set including the signer public key; the target linkable ring signature includes the signer tag.
[0058] In this embodiment, the message signing end uses the signer private key and the preset system parameters to determine the signer tag, and uses the preset system parameters, the determined signer tag, and the target public key set to generate a target linkable ring signature corresponding to the signer's target message. Among them, the target linkable ring signature includes the signer tag as a link tag to facilitate the verification and linking of several received signatures. Specifically, the determination of the signer tag based on the signer private key and the preset system parameters may include: determining the product of the signer private key and the tag blinding factor in the preset system parameters as the signer tag; the tag blinding factor is the second generator of the second preset additive cyclic group. That is, the formula for determining the signer tag can be specifically:
[0059] ;
[0060] in, The generating of the target linkable ring signature corresponding to the target message of the signer according to the preset system parameters, the signer tag, and the target public key set including the signer's public key may specifically include: firstly randomly selecting a second random number from the first preset additive cycle group, and performing an operation on the second random number, the target public key set including the signer's public key, the signer tag, the target message of the signer, and the preset system parameters through a preset secure hash function to obtain a first hash value; that is, the formula for determining the first hash value may specifically be:
[0061] ;
[0062] in, is the first hash value, is the target message of the signer, A target random number group is randomly selected from the first preset addition cycle group, and the target random number group, the preset system parameters, the target public key set, the signer tag, the first hash value, and the target message are cyclically operated through the preset secure hash function to obtain a number of hash values corresponding to the target public key set, until a repeated hash value appears in the several hash values, and the repeated hash value is used as the second hash value; that is, define a variable , from the first preset additive cyclic group A target random number group is randomly selected from the random number Then, the target message is cyclically operated based on the preset secure hash function, the target random number group, the first hash value and the variable. The formula for cyclically operating the target message may be:
[0063] ;
[0064] in, The specific formula for determining can be:
[0065] ;
[0066] The specific formula for determining can be:
[0067] ;
[0068] in, is the first A random number, The hash value obtained in the previous cycle or the first hash value Specifically, the first hash value , in the target random number group and the target public key set The formula of the loop operation is looped as the parameter of the first loop operation to obtain a number of hash values corresponding to the target public key set until a repeated hash value appears in the number of hash values, that is, Stop when the repeated hash value is used as the second hash value .
[0069] This embodiment determines a third hash value corresponding to the target message from the plurality of hash values. , and calculate the target product of the third hash value and the signer's private key, and the target sum between the signer's private key and a preset number of units; calculate the target difference between the second random number and the target product, and perform a modulus operation on the order based on the ratio of the target difference to the target sum to obtain a corresponding target operation result; and use the target operation result as the signer's signature. That is, the formula for determining the signer's signature can be specifically:
[0070] ;
[0071] in, Sign for said signer, is a modulo operation. Finally, a target linkable ring signature corresponding to the target message is generated according to the signer signature, the target public key set, the signer tag, the second hash value, and the target random number group. That is, the formula for determining the target linkable ring signature can be specifically:
[0072] ;
[0073] in, In this way, this embodiment uses the signer private key and the second generator of the second preset additive cyclic group in the preset system parameters to determine the signer tag, weaken the association between the signer tag and the target public key set, and use the signer tag to generate the target linkable ring signature, so that the linkability of the generated target linkable ring signature is independent of the group, thereby reducing the abuse and fraud of the linkable ring signature by dishonest persons.
[0074] Step S13: Send the target message and the target linkable ring signature to the signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
[0075] In this embodiment, the message signing end sends the target message and the target linkable ring signature corresponding to the target message to the signature verification end in the signature and verification system, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature. It should be noted that the signature and verification system of this embodiment includes two parts, the signature verification end and the message signing end. The specific implementation process of the above steps S11 and S12 and the operation of sending the target message and the target linkable ring signature to the signature verification end are all performed by the message signing end.
[0076] In this embodiment, after the signature verification end receives several messages, the signature verification end is required to first verify the correctness of the several messages, and determine the linkable signature from the signer from the several messages that have passed the correctness verification based on the target linkable ring signature. Among them, the determination of the linkable signature from the signer based on the target linkable ring signature among the several linkable ring signatures may specifically include: comparing the signer tag in the target linkable ring signature with the tag in the linkable ring signature to be verified that has passed the verification; if the tag in the linkable ring signature to be verified is consistent with the signer tag, then the linkable ring signature to be verified and the target linkable ring signature corresponding to the signer tag are determined as the linkable signature from the signer. That is, the verification equation Is it established? Represents the labels in the several linkable ring signatures corresponding to the several messages that have passed the correctness verification. If the equation holds, the label is determined to be The message corresponding to the linkable ring signature and the target message corresponding to the signer tag are linkable signatures from the signer. In this way, in this embodiment, the message signing end of the signature and verification system sends the target message and the target linkable ring signature to the signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages. After the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, it verifies the linkability of the signatures that have passed the correctness verification based on the signer tag, thereby determining the linkable signature from the signer, and realizing the linkability of the linkable ring signature independent of the group.
[0077] As can be seen from the above, the embodiment of the present application selects the second generator of the second preset additive cyclic group as the label blinding factor, and associates the signer private key with the label blinding factor to generate the signer label. In this way, through the above process of the embodiment of the present application, on the one hand, the preset system parameters are first obtained, and the relevant parameters required to generate the target linkable ring signature are determined based on the preset system parameters, so as to prepare for the subsequent generation of the target linkable ring signature and improve the efficiency of signature verification. On the one hand, the signer label is determined by using the signer private key and the second generator in the preset system parameters to weaken the association between the signer label and the target public key set; on the other hand, the target linkable ring signature generated by the signer label is used to verify and link several messages and corresponding signatures received by the signature verification end, so as to ensure the uniqueness of the signer label to achieve linkability independent of the group, thereby ensuring that the linkable ring signature is independent of the group and can determine the linkable signature from the same signer under any circumstances.
[0078] Based on the above embodiments, it can be seen that when verifying a message through the method of the present application, it is possible to determine whether to further verify the message by verifying the correctness of the message, thereby improving the efficiency of message verification. For this reason, this embodiment describes in detail how to verify the signature. Figure 2 As shown, the embodiment of the present invention discloses a signature and verification method, which is applied to a signature and verification system, including:
[0079] Step S21: randomly select a first random number from a first preset addition cycle group, use the first random number as the signer's signer private key, and determine the signer public key according to preset system parameters and the signer private key.
[0080] Step S22: determine the signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the signer's target message according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag.
[0081] Step S23: Send the target message and the target linkable ring signature to the signature verification end, so that the signature verification end verifies whether the target parameters in the linkable ring signatures corresponding to the received messages belong to the first preset addition cycle group; the target parameters are the second hash value, the signer signature and the target random number group in the linkable ring signatures.
[0082] In this embodiment, due to the preset secure hash function A string of any length can be mapped to the first preset addition cyclic group The second hash value and the signer's signature in the correct linkable ring signature are based on the first preset additive cycle group. The target random number group in the generated and correct linkable ring signature comes from the first preset additive cyclic group , then the second hash value, the signer signature and the target random number group in the correct linkable ring signature should all belong to the first preset additive cycle group . Therefore, after the signature verification end of the signature and verification system receives several messages, it can first judge the target parameters in the several linkable ring signatures corresponding to the several received messages to determine whether the target parameters belong to the first preset additive cycle group, wherein the target parameters are the second hash value, the signer signature and the target random number group in the several linkable ring signatures. If the target parameter belongs to the first preset additive cycle group, it can be preliminarily judged that the message corresponding to the linkable ring signature whose target parameter belongs to the first preset additive cycle group may be correct and needs to be further verified. If the target parameter does not belong to the first preset additive cycle group, the message corresponding to the linkable ring signature whose target parameter does not belong to the first preset additive cycle group is rejected. In this way, before further verifying the several messages, this embodiment first performs a preliminary judgment and screening on them, thereby reducing the data processing load of the system and improving the efficiency of signature verification.
[0083] Step S24: If the target parameter belongs to the first preset additive cycle group, a cyclic operation is performed on the messages to be verified in the plurality of messages respectively to determine whether a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified of the message to be verified is obtained.
[0084] In this embodiment, after determining that the target parameter belongs to the first preset additive cyclic group, the signature verification end of the signature and verification system further verifies the plurality of messages that have passed the preliminary verification. Specifically, a cyclic operation is performed on each of the plurality of messages to be verified, that is, a variable is defined. , the formula for performing a loop operation on the message to be verified may specifically be:
[0085] ;
[0086] in, is the message to be verified, and the linkable ring signature corresponding to the message to be verified is , is the set of public keys in the linkable ring signature corresponding to the message to be verified, is the signer tag in the linkable ring signature corresponding to the message to be verified, is the second hash value in the linkable ring signature corresponding to the message to be verified, The specific formula for determining can be:
[0087] ;
[0088] The specific formula for determining can be:
[0089] ;
[0090] in, is the linkable ring signature corresponding to the message to be verified hash values, The hash value obtained from the previous loop operation or The determination whether a repeated hash value equal to the second hash value corresponding to the message to be verified is obtained, that is, determining the equation In this way, this embodiment further verifies the message to be verified by performing a loop operation on the message to be verified among the plurality of messages to determine whether a repeated hash value equal to the second hash value corresponding to the message to be verified is obtained, and verifies based on the generation step of the linkable ring signature, thereby improving the accuracy of signature verification.
[0091] Step S25: If a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified is obtained, it indicates that the linkable ring signature to be verified passes the verification.
[0092] In this embodiment, if a repeated hash value equal to the second hash value corresponding to the connectable ring signature to be verified corresponding to the message to be verified is determined by performing a cyclic operation on the message to be verified among the plurality of messages, it is indicated that the message to be verified is correct, and therefore it is characterized that the message to be verified has passed the verification and can be linked. In this way, before the linkability verification of the message is performed, the correctness of the message is first verified to exclude the possibility that the received message is illegal or incorrect, and a screening is performed in advance, thereby reducing the data processing amount of the system and improving the efficiency of message verification.
[0093] Step S26: Determine a linkable signature from the signer based on the target linkable ring signature among the plurality of linkable ring signatures.
[0094] The specific implementation process of steps S21, S22 and S26 may refer to the contents of the aforementioned embodiments and will not be described in detail here.
[0095] It can be seen that the present application uses a first random number randomly selected from a first preset additive cycle group as the signer's signer private key, and determines the signer public key and the signer tag based on the signer private key and the preset system parameters respectively, and uses the preset system parameters, the signer tag and the target public key set including the signer public key to generate a target linkable ring signature corresponding to the signer's target message. After sending the target message and the target linkable ring signature to the signature verification end, the signature verification end first performs a preliminary verification judgment on the several messages based on the target parameters in the several linkable ring signatures corresponding to the several received messages and the first preset additive cycle group, and then performs further in-depth verification judgment on the several messages that pass the preliminary verification judgment, and finally performs linkability verification on the several messages that pass the further in-depth verification judgment. Through the method in this embodiment, on the one hand, when the correctness of several messages received by the signature verification end is verified, it is divided into two major steps. First, the several messages are preliminarily verified and judged to screen out some incorrect messages, and then the several messages that pass the preliminary verification are further verified; on the other hand, before the linkability of the several messages is verified, the correctness of the several messages can be verified, thereby reducing the data processing amount of the system and improving the efficiency of message verification.
[0096] See also Figure 3 As shown, the embodiment of the present application also provides a signature and verification device, which is applied to a signature and verification system, including:
[0097] The public key determination module 11 is used to randomly select a first random number from a first preset addition cycle group, use the first random number as the signer's signer private key, and determine the signer's public key according to preset system parameters and the signer's private key;
[0098] The signature generation module 12 is used to determine the signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the target message of the signer according to the preset system parameters, the signer tag, and a target public key set including the signer public key; the target linkable ring signature includes the signer tag;
[0099] The message determination module 13 is used to send the target message and the target linkable ring signature to the signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
[0100] As can be seen from the above, the present application uses the first random number randomly selected from the first preset addition cycle group as the signer's signer private key, and determines the signer public key and the signer tag based on the signer private key and the preset system parameters, and generates the target linkable ring signature corresponding to the signer's target message using the preset system parameters, the signer tag and the target public key set containing the signer public key. After the target message and the target linkable ring signature are sent to the signature verification end, the signature verification end performs correctness verification and linkability verification on the linkable ring signatures corresponding to the received messages. In this way, the preset system parameters unrelated to the target public key set are selected as the tag blinding factor through the above process of the present application, and the signer private key is associated with the tag blinding factor to generate the signer tag. The target linkable ring signature generated by the signer tag is used to verify and link the messages received by the signature verification end, which can ensure the uniqueness of the signer tag to achieve linkability independent of the group, thereby ensuring that the linkable ring signature is independent of the group and can determine the linkable signature from the same signer under any circumstances.
[0101] In some specific implementations, the public key determination module 11 may specifically include:
[0102] A public key determination unit is used to determine the product of a public key generation factor in a preset system parameter and the signer private key as the signer public key; wherein the public key generation factor is a first generator of a second preset additive cyclic group; and the order of the second preset additive cyclic group is consistent with the order of the first preset additive cyclic group.
[0103] In some specific implementations, the public key determination module 11 may further include:
[0104] The set composition unit is used to randomly select a number of non-signer public keys to form the target public key set according to the number of non-signer public keys and the signer public key.
[0105] In some specific implementations, the signature generation module 12 may specifically include:
[0106] A label determination unit is used to determine the product of the signer private key and the label blinding factor in the preset system parameter as the signer label; the label blinding factor is the second generator of the second preset additive cyclic group.
[0107] In some specific implementations, the signature generation module 12 may specifically include:
[0108] a function operation unit, configured to randomly select a second random number from the first preset addition cycle group, and operate the second random number, a target public key set including the signer's public key, the signer tag, the signer's target message, and the preset system parameter through a preset secure hash function to obtain a first hash value;
[0109] a first cyclic operation unit, configured to randomly select a target random number group from the first preset addition cyclic group, and perform a cyclic operation on the target random number group, the preset system parameter, the target public key set, the signer tag, the first hash value, and the target message through the preset secure hash function to obtain a plurality of hash values corresponding to the target public key set, until a repeated hash value appears in the plurality of hash values, so as to use the repeated hash value as a second hash value;
[0110] a sum value calculation unit, configured to determine a third hash value corresponding to the target message from the plurality of hash values, and calculate a target product of the third hash value and the signer private key, and a target sum value between the signer private key and a preset number of units;
[0111] a modulo operation unit, configured to calculate a target difference between the second random number and the target product, and perform a modulo operation on the order based on a ratio of the target difference to the target sum value, so as to obtain a corresponding target operation result;
[0112] The signature generation unit is used to use the target operation result as the signer signature, and generate a target linkable ring signature corresponding to the target message according to the signer signature, the target public key set, the signer tag, the second hash value and the target random number group.
[0113] In some specific implementations, the message determination module 13 may specifically include:
[0114] A condition verification unit, used to verify whether target parameters in a number of linkable ring signatures corresponding to a number of received messages belong to the first preset addition cycle group; the target parameters are the second hash value, the signer signature and the target random number group in the number of linkable ring signatures;
[0115] a second loop operation unit, configured to, if the target parameter belongs to the first preset additive loop group, respectively perform loop operations on the messages to be verified among the plurality of messages to determine whether a repeated hash value equal to a second hash value corresponding to the linkable ring signature to be verified of the message to be verified is obtained;
[0116] The signature verification unit is configured to indicate that the linkable ring signature to be verified has passed the verification if a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified is obtained.
[0117] In some specific implementations, the message determination module 13 may specifically include:
[0118] a label comparison unit, configured to compare the signer label in the target linkable ring signature with the label in the linkable ring signature to be verified that has passed verification;
[0119] A signature determination unit is configured to determine the linkable ring signature to be verified and the target linkable ring signature corresponding to the signer tag as linkable signatures from the signer if the tag in the linkable ring signature to be verified is consistent with the signer tag.
[0120] Furthermore, the present application also discloses an electronic device. Figure 4 2 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the signature and verification method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0121] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0122] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0123] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the signature and verification method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0124] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed signature and verification method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiment, and will not be repeated here.
[0125] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0127] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0129] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A signature and verification method, characterized in that: Applied to signature and verification systems, including: Randomly selecting a first random number from a first preset addition cycle group, using the first random number as a signer private key of the signer, and determining a signer public key according to preset system parameters and the signer private key; Determine a signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the signer's target message according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag; The target message and the target linkable ring signature are sent to a signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
2. The signature and verification method according to claim 1, characterized in that: The determining the signer public key according to the preset system parameters and the signer private key includes: Determine the product of the public key generation factor in the preset system parameters and the signer's private key as the signer's public key; The public key generation factor is a first generator of a second preset additive cyclic group; the order of the second preset additive cyclic group is consistent with the order of the first preset additive cyclic group.
3. The signature and verification method according to any one of claims 1 or 2, characterized in that: After randomly selecting a first random number from a first preset addition cycle group, using the first random number as a signer private key of a signer, and determining a signer public key according to preset system parameters and the signer private key, the method further includes: A number of non-signer public keys are randomly selected to form the target public key set according to the number of non-signer public keys and the signer public key.
4. The signature and verification method according to claim 2, characterized in that: The determining the signer tag according to the signer private key and the preset system parameter includes: The product of the signer private key and the label blinding factor in the preset system parameter is determined as the signer label; the label blinding factor is the second generator of the second preset additive cyclic group.
5. The signature and verification method according to claim 4, characterized in that: The generating a target linkable ring signature corresponding to the target message of the signer according to the preset system parameters, the signer tag, and a target public key set including the signer's public key comprises: Randomly selecting a second random number from the first preset addition cycle group, and performing an operation on the second random number, a target public key set including the signer's public key, the signer tag, the signer's target message, and the preset system parameter through a preset secure hash function to obtain a first hash value; Randomly selecting a target random number group from the first preset addition cycle group, and performing a cyclic operation on the target random number group, the preset system parameters, the target public key set, the signer tag, the first hash value, and the target message through the preset secure hash function to obtain a plurality of hash values corresponding to the target public key set, until a repeated hash value appears in the plurality of hash values, so as to use the repeated hash value as the second hash value; Determine a third hash value corresponding to the target message from the plurality of hash values, and calculate a target product of the third hash value and the signer private key, and a target sum value between the signer private key and a preset number of units; Calculating a target difference between the second random number and the target product, and performing a modulo operation on the order based on a ratio of the target difference to the target sum value to obtain a corresponding target operation result; The target operation result is used as the signer signature, and a target linkable ring signature corresponding to the target message is generated according to the signer signature, the target public key set, the signer tag, the second hash value and the target random number group.
6. The signature and verification method according to claim 5, characterized in that: The correctness verification of the plurality of linkable ring signatures corresponding to the plurality of received messages includes: Verify whether target parameters in several linkable ring signatures corresponding to several received messages belong to the first preset addition cycle group; the target parameters are the second hash value, the signer signature and the target random number group in the several linkable ring signatures; If the target parameter belongs to the first preset additive cyclic group, performing cyclic operations on the messages to be verified among the plurality of messages respectively to determine whether a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified of the message to be verified is obtained; If a repeated hash value equal to the second hash value corresponding to the linkable ring signature to be verified is obtained, it indicates that the linkable ring signature to be verified passes the verification.
7. The signature and verification method according to claim 6, characterized in that: The determining the linkable signature from the signer based on the target linkable ring signature among the plurality of linkable ring signatures comprises: Comparing the signer tag in the target linkable ring signature with the tag in the linkable ring signature to be verified that has passed verification; If the tag in the linkable ring signature to be verified is consistent with the signer tag, the linkable ring signature to be verified and the target linkable ring signature corresponding to the signer tag are determined as linkable signatures from the signer.
8. A signature and verification device, characterized in that: Applied to signature and verification systems, including: a public key determination module, configured to randomly select a first random number from a first preset addition cycle group, use the first random number as a signer private key of the signer, and determine the signer public key according to preset system parameters and the signer private key; a signature generation module, configured to determine a signer tag according to the signer private key and the preset system parameters, and generate a target linkable ring signature corresponding to the signer's target message according to the preset system parameters, the signer tag, and a target public key set including the signer's public key; the target linkable ring signature includes the signer tag; A message determination module is used to send the target message and the target linkable ring signature to a signature verification end, so that the signature verification end verifies the correctness of the linkable ring signatures corresponding to the received messages, and determines the linkable signature from the signer based on the target linkable ring signature among the linkable ring signatures.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the signature and verification method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the signature and verification method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Privacy protection data aggregation method and device of distributed system, equipment and medium
CN120639314A