Post-quantum signature method and device
By co-generating post-quantum signatures with the client and server, using shared random seeds and two-wheel interaction mechanisms, the problem of insufficient security of signature keys in traditional post-quantum signature solutions is solved, and high-security data in cloud environments is achieved transmission.
Patent Information
- Application Number
- CN202411088183.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In traditional post-quantum signature schemes, signature keys are usually generated and stored by a user, making it difficult to ensure security in a cloud environment. Especially when the terminal is attacked, the signature keys may be leaked, resulting in data insecure.
The client and server are used to generate the post-quantum signatures in a collaborative manner, and the promise key is generated by sharing random seeds, and the signature value is generated through two rounds of interaction to ensure the security and immutability of the signature.
Even if the client's private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of post-quantum signatures and ensures that the client and server complete the signature according to the agreement, adapting to data transmission in the cloud environment.
Smart Images

Figure CN118631455B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information security data processing, and in particular to a post-quantum signature method and device. Background Art
[0002] With the continuous development of quantum computing technology, the research and application of post-quantum signatures will become increasingly important. Post-quantum signatures are a type of signature that can resist attacks from quantum computers. They ensure the security and integrity of data in the era of quantum computing and are widely used in various application scenarios.
[0003] However, in traditional post-quantum signature schemes, the generation process of signature keys and digital signatures is usually completed by one user. For example, in a cloud environment, it is difficult to fully trust cloud service providers. Usually, the signature key for post-quantum signatures is stored in the terminal memory. When a digital signature is required, the signature key is obtained from the terminal memory to sign the information to be signed. Once the terminal is attacked, the signature key may be leaked, and the attacker can directly use the signature key to forge the digital signature of the terminal. This is very unsafe and may cause significant losses to users.
[0004] Therefore, there is an urgent need for a post-quantum signature scheme suitable for cloud environment application scenarios. Summary of the invention
[0005] The embodiments of the present invention provide a post-quantum signature method and device for enabling two parties to collaboratively generate a post-quantum signature to improve the security of the post-quantum signature, which is suitable for cloud environment application scenarios.
[0006] In a first aspect, an embodiment of the present invention provides a method, applied to a client, wherein the client and a server jointly generate a post-quantum signature, and the method includes:
[0007] Selecting a random seed and generating a commitment key based on the random seed, wherein the random seed is shared with the server;
[0008] Determine a first secret value for generating a signature, and generate a first commitment value based on the commitment key and the first secret value;
[0009] receiving a second commitment value sent by the server, and generating a first signature value according to the message to be signed, the first commitment value, and the second commitment value, wherein the second commitment value is generated based on the commitment key and the second secret value;
[0010] Determine a first sub-signature value according to the first signature value and a private key corresponding to the client;
[0011] Receive a second sub-signature value sent by the server, and determine a second signature value according to the first sub-signature value and the second sub-signature value, where the second sub-signature value is determined based on the first signature value and a private key corresponding to the server;
[0012] A target signature corresponding to the message to be signed is generated according to the first signature value and the second signature value.
[0013] In a second aspect, an embodiment of the present invention provides a post-quantum signature device, which is applied to a client, and the client and the server jointly generate a post-quantum signature, and the device includes:
[0014] A selection module, used to select a random seed and generate a commitment key based on the random seed, wherein the random seed is shared with the server;
[0015] A first generating module, configured to determine a first secret value for generating a signature, and to generate a first commitment value according to the commitment key and the first secret value;
[0016] a receiving module, configured to receive a second commitment value sent by the server, and generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value, wherein the second commitment value is generated based on the commitment key and the second secret value;
[0017] A first determining module, configured to determine a first sub-signature value according to the first signature value and a private key corresponding to the client;
[0018] A second determination module is configured to receive a second sub-signature value sent by the server, and determine a second signature value according to the first sub-signature value and the second sub-signature value, wherein the second sub-signature value is determined based on the first signature value and a private key corresponding to the server;
[0019] The second generating module is used to generate a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0020] In a third aspect, an embodiment of the present invention provides an electronic device, applied to a sender, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the post-quantum signature method as described in the first aspect.
[0021] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the post-quantum signature method described in the first aspect.
[0022] In a fifth aspect, an embodiment of the present invention provides a post-quantum signature method, which is applied to a server, wherein the server cooperates with a client to generate a post-quantum signature, and the method includes:
[0023] Obtaining a random seed, and generating a commitment key based on the random seed, wherein the random seed is shared with the client;
[0024] receiving a first commitment value sent by the client, where the first commitment value is generated according to the commitment key and a first secret value, where the first secret value is a secret value used to generate a signature;
[0025] Determining a second secret value for generating a signature, and generating a second commitment value based on the commitment key and the second secret value;
[0026] Generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value;
[0027] Receive a first subsignature value sent by the client, determine a second subsignature value according to the first signature value and a private key corresponding to the server, and determine a second signature value according to the first subsignature value and the second subsignature value, wherein the first subsignature value is determined based on the first signature value and the private key corresponding to the client;
[0028] A target signature corresponding to the message to be signed is obtained according to the first signature value and the second signature value.
[0029] In a sixth aspect, an embodiment of the present invention provides a post-quantum signature device, which is applied to a server, and the server cooperates with a client to generate a post-quantum signature. The device includes:
[0030] An acquisition module, used to acquire a random seed and generate a commitment key according to the random seed, wherein the random seed is shared with the client;
[0031] A receiving module, configured to receive a first commitment value sent by the client, where the first commitment value is generated according to the commitment key and a first secret value, where the first secret value is a secret value used to generate a signature;
[0032] A first determination module, configured to determine a second secret value for generating a signature, and to generate a second commitment value based on the commitment key and the second secret value;
[0033] A generating module, configured to generate a first signature value according to the message to be signed, the first commitment value and the second commitment value;
[0034] a second determination module, configured to receive a first subsignature value sent by the client, determine a second subsignature value according to the first signature value and a private key corresponding to the server, and determine a second signature value according to the first subsignature value and the second subsignature value, wherein the first subsignature value is determined based on the first signature value and the private key corresponding to the client;
[0035] An obtaining module is used to obtain a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0036] In the seventh aspect, an embodiment of the present invention provides an electronic device, applied to a sender, comprising: a memory, a processor, and a communication interface; wherein the memory stores an executable code, and when the executable code is executed by the processor, the processor can at least implement the post-quantum signature method as described in the fifth aspect.
[0037] In an eighth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the post-quantum signature method as described in the fifth aspect.
[0038] In the post-quantum signature scheme provided by the embodiment of the present invention, two parties can cooperate to jointly generate a post-quantum signature, so that even in a cloud environment, without the supervision of a trusted third party, the security of the post-quantum signature can be ensured to ensure the integrity and non-tamperability of the data.
[0039] Specifically, when two parties perform post-quantum signature, the client first selects a random seed and generates a commitment key based on the random seed. The random seed is shared with the server so that the server can generate the same commitment key based on the same random seed. Then, the client determines the first secret value used to generate the signature, generates the first commitment value based on the commitment key and the first secret value, and sends the first commitment value to the server. Similarly, the server can determine the second secret value used to generate the signature, generate the second commitment value based on the commitment key and the second secret value, and send the second commitment value to the client. Then, the client and the server can generate the first signature value based on the signed message, the first commitment value, and the second commitment value, respectively. The client determines the first sub-signature value based on the first signature value and the private key corresponding to the client, and sends the first sub-signature value to the server. The server can determine the second sub-signature value based on the first signature value and the private key corresponding to the server, and send the second sub-signature value to the client. Then, the client and the server can determine the second signature value based on the first sub-signature value and the second sub-signature value, respectively, and finally, obtain the target signature corresponding to the proxy signature message based on the first signature value and the let signature value.
[0040] In the above scheme, the client and the server generate the same commitment key by using the same random seed. In the subsequent signing process, the same commitment key can be used to verify the validity of the commitment value, thereby ensuring the security of the signature. In addition, in the process of generating the signature, the client and the server have two rounds of interaction. The first time, after the client and the server generate the corresponding commitment value, they send their corresponding commitment values to the other end, so that the other end can generate the first signature value based on the first commitment value and the second commitment value. The second time, when the client and the server generate the sub-signature value in the corresponding second signature value, they send their corresponding sub-signature values to the other end, so that the other end can determine the second signature value based on the first sub-signature value and the second sub-signature value, and then generate the target signature based on the first signature value and the second signature value. That is, through two interactions, the client and the server realize the collaborative generation of the post-quantum signature by the two participants. In this way, even if the client private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed, so as to adapt to the data transmission in the cloud environment application scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0042] Figure 1 A schematic diagram of a post-quantum signature system provided by an embodiment of the present invention;
[0043] Figure 2 An interactive flow chart of a post-quantum signature method provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a post-quantum signature method provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a process flow of another post-quantum signature method provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the structure of a post-quantum signature device provided by an embodiment of the present invention;
[0047] Figure 6 For Figure 5 A schematic diagram of the structure of an electronic device corresponding to the post-quantum signature device provided in the illustrated embodiment;
[0048] Figure 7A schematic diagram of the structure of another post-quantum signature device provided by an embodiment of the present invention;
[0049] Figure 8 For Figure 7 A schematic diagram of the structure of an electronic device corresponding to the post-quantum signature device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments 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.
[0051] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the situation of including at least one. It should be understood that the term "and / or" used in this article is only an association relationship describing the associated objects, indicating that three relationships can exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are a kind of "or" relationship. Depending on the context, the words "if" and "if" used herein can be interpreted as "at the time of..." or "when...".
[0052] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.
[0053] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0054] With the continuous development of quantum computing technology, the research and application of post-quantum signatures will become increasingly important. However, in traditional post-quantum signature schemes, the generation process of signature keys and digital signatures is usually completed by one user. For example, in a cloud environment, it is difficult to fully trust cloud service providers. The signature key for post-quantum signatures is usually stored in the terminal memory. When a digital signature is required, the signature key is obtained from the terminal memory to sign the information to be signed. Once the terminal is attacked, the signature key may be leaked, and the attacker can directly use the signature key to forge the digital signature of the terminal. This is very unsafe and may cause significant losses to users.
[0055] In order to solve the above technical problems, while improving the security of keys and signatures, and not affecting the user experience and usage costs, the present invention proposes a new post-quantum signature method, in which part of the user's signature key is generated by the client, and part is generated independently on the server, and the final key pair is generated by the interaction of the two parties, which improves the security of the key. In addition, by using the homomorphic commitment mechanism of the lattice, the two ends use their corresponding private keys to collaboratively generate the target signature through two rounds of interaction, so that even if the client private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed, so as to adapt to the data transmission in the cloud environment application scenario.
[0056] The post-quantum signature scheme is exemplarily described below in conjunction with the following embodiments.
[0057] Figure 1 A schematic diagram of a post-quantum signature system provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the system may include a client and a server, and the client and the server collaborate to generate a post-quantum signature.
[0058] The client can be any user device that needs to sign with the server, and can be any computing device with certain data transmission capabilities. In specific implementation, the client can be a mobile phone, a personal computer PC, a tablet computer, a setting application, etc. The server can be any device that can provide computing services, for example, a cluster server, a conventional server, a cloud server, a cloud host, a virtual center, etc.
[0059] In an embodiment of the present invention, the client and the server can collaboratively generate a signature key pair through interaction. When signing, both ends can interact and each use their own private key to perform distributed signing to collaboratively generate a target signature.
[0060] Specifically, first, the client generates a first random matrix, performs a hash operation on the first random matrix, obtains a hash value corresponding to the first random matrix, and sends the first random matrix and the hash value corresponding to the first random matrix to the server. Similarly, the server generates a second random matrix, performs a hash operation on the second random matrix, obtains a hash value corresponding to the second random matrix, and sends the second random matrix and the hash value corresponding to the second random matrix to the client. Then, the client receives the hash value corresponding to the second random matrix sent by the server, and verifies the second random matrix based on the hash value. If the verification is successful, the first random matrix and the second random matrix are synthesized to obtain a target matrix. Similarly, after the server receives the first random matrix and the hash value corresponding to the first random matrix sent by the client, it verifies the first random matrix based on the hash value. If the verification is successful, the first random matrix and the second random matrix are synthesized to obtain a target matrix. Then, the client generates a first random vector and a second random vector, and generates a private key corresponding to the client according to the target matrix, the first random vector and the second random vector. The server generates a third random vector and a fourth random vector, and generates a private key corresponding to the server according to the target matrix, the third random vector and the fourth random vector. Finally, a signature public key is generated according to the target matrix, the first random vector, the second random vector, the third random vector and the fourth random vector.
[0061] After generating the private key corresponding to the client and the private key corresponding to the server, the corresponding private keys can be used for post-quantum signature. Specifically, when generating the target signature, the client and the server interact twice. The first time, when the client and the server generate the commitment value corresponding to the secret value used to generate the signature, they send the corresponding commitment values to the other end, so that the other end can generate the first signature value based on the first commitment value and the second commitment value. Then the second interaction is carried out. When the client and the server generate the sub-signature value in the corresponding second signature value, they send the corresponding sub-signature value to the other end, so that the other end can determine the second signature value based on the first sub-signature value and the second sub-signature value, and then generate the target signature according to the first signature value and the second signature value. That is, the client and the server interact twice to realize the collaborative generation of the post-quantum signature by the two participants. In this way, even if the client private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed to adapt to the data transmission in the cloud environment application scenario.
[0062] In order to understand the specific process of the client and server jointly generating the target signature, Figure 2 The specific process of generating a post-quantum signature through interactive collaboration between the client and the server is illustrated by way of example.
[0063] Figure 2 An interactive flow chart of a post-quantum signature method provided by an embodiment of the present invention, such as Figure 2 As shown, the following steps may be included:
[0064] 201. The client randomly selects a random seed and generates a commitment key based on the random seed. The random seed is shared with the server.
[0065] 202. The server generates a commitment key based on the random seed.
[0066] 203. The client determines a first secret value for generating a signature, generates a first commitment value according to the commitment key and the first secret value, and sends the first commitment value to the server.
[0067] 204. The server determines a second secret value for generating a signature, generates a second commitment value according to the commitment key and the second secret value, and sends the second commitment value to the client.
[0068] 205. The client receives the second commitment value sent by the server, and generates a first signature value according to the message to be signed, the first commitment value, and the second commitment value.
[0069] 206. The client determines a first sub-signature value according to the first signature value and a private key corresponding to the client.
[0070] 207. The server determines a second sub-signature value according to the first signature value and the private key corresponding to the server, and sends the second sub-signature value to the client.
[0071] 208. The client receives the second sub-signature value sent by the server, and determines a second signature value according to the first sub-signature value and the second sub-signature value.
[0072] 209. The client generates a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0073] The post-quantum signature scheme provided in this embodiment can be implemented by using a lattice signature algorithm and a homomorphic commitment mechanism. Specifically, a signature key pair can be generated first, wherein a portion of the signature key is independently generated by the client, and a portion of the signature key is independently generated by the server, and then the two ends interact to generate a key pair for signing. After the client and the server generate the key pair for signing, the client and the server can use their respective private keys to interact and collaboratively generate the target signature.
[0074] Specifically, first, the client can select a random seed and generate a commitment key based on the random seed. The random seed is shared with the server, so that the server and the client can use the same random seed to generate the same commitment key, which can further ensure that the signatures completed by both ends are in accordance with the agreed conditions, ensuring the security and non-tamperability of the signature. Then, after the client selects a random seed, the random seed can be sent to the server, and the server generates a commitment key based on the random seed. In addition, other methods can also be used to share the random seed selected by the client with the server, which is not limited in the embodiments of the present invention.
[0075] In an optional embodiment, the specific implementation process of the client or server generating a commitment key according to a random seed may include: using a preset pseudo-random function, generating a third random matrix and a fourth random matrix according to the random seed, and splicing the third random matrix and the unit matrix to obtain a spliced matrix. Generate a commitment key according to the spliced matrix and the fourth random matrix. The client and the server may generate the commitment key in the same manner.
[0076] For example, the client randomly selects a random seed seed, uses a preset pseudo-random function, and generates a third random matrix based on the random seed and the fourth random matrix .in, , The identity matrix is , concatenate the third random matrix and the unit matrix to obtain the concatenated matrix . Horizontally concatenate the concatenated matrix and the fourth random matrix to generate the commitment key, that is, the commitment key is .
[0077] After generating the commitment key, the client determines a first secret value for generating a signature. The server determines a second secret value for generating a signature. The specific process of the client determining the first secret value may be: obtaining a private key corresponding to the client, the private key corresponding to the client including a target matrix. Generate a third random vector, and determine the third random vector as a mask vector, the mask vector being used to mask the target matrix. Determine the first secret value based on the mask vector and the target matrix.
[0078] Optionally, according to the mask vector and the target matrix, a specific implementation method for determining the first secret value may be: obtaining a second product value of the mask vector and the target matrix; and extracting high-order bits from the second product value as the first secret value.
[0079] For example, the private key corresponding to the client is , where the target matrix is . Generate the third random vector as , the third random vector is determined as a mask vector, which can be used to mask the target matrix to improve the security of the target matrix. And, , Signature range parameter. Get the second product value of the mask vector and the target matrix , extract the high-order bits from the second product value as the first secret value ,Right now .in, Used to extract the high-order bits from the data input to this function. Indicates from Extracted from The high-order bit of the bit.
[0080] In practical applications, if the second product value is directly determined as the first secret value for generating the signature, this may leak too much data information corresponding to the client. Therefore, in order to improve the security of the client data information, the high-order bits can be extracted only from the second product value of the mask vector and the target matrix. The client can hide most of the details in the second product value while maintaining enough information to verify the commitment, thereby protecting the privacy of the data and reducing the amount of data, thereby reducing communication and storage costs. At the same time, since the high-order bits often contain the "important" or "significant" part of the data, they may also be more difficult to tamper with or forge, thereby enhancing the security of the commitment.
[0081] The specific process of determining the second secret value at the server end may be: obtaining a private key corresponding to the server end, the private key corresponding to the server end including the target matrix; generating a fourth random vector, the fourth random vector being used to mask the target matrix; and determining the second secret value according to the fourth random vector and the target matrix.
[0082] Optionally, the specific implementation method of determining the second secret value according to the fourth random vector and the target matrix may be: obtaining a third product value of the fourth random vector and the target matrix; and extracting high-order bits from the third product value as the second secret value.
[0083] For example, the private key corresponding to the server is , where the target matrix is The fourth random vector is generated as , and the fourth random vector is used to mask the target matrix to improve the security of the target matrix. And, , Signature range parameter. Get the third product value of the fourth random vector and the target matrix as , extract the high-order bits from the third product value as the second secret value ,Right now .in, Used to extract the high-order bits from the data input to this function. Extracted from The high-order bit of the bit.
[0084] Next, the client generates a first commitment value based on the commitment key and the first secret value, and sends the first commitment value to the server. The server generates a second commitment value based on the commitment key and the second secret value, and sends the second commitment value to the client. Among them, the commitment key and the first secret value can be processed by a preset commitment function to generate the first commitment value. Similarly, the commitment key and the second secret value can be processed by a preset commitment function to generate the second commitment value. In addition, in order to increase the unpredictability and security of the commitment value, a blinding factor can be added when generating the first commitment value and the second commitment value, so as to blind the first commitment value (or the second commitment value) by the blinding factor, so that even if the first secret value (or the second secret value), the first random matrix and the second random matrix are obtained, the first secret value (or the second secret value) cannot be directly inferred.
[0085] Optionally, specifically, according to the commitment key and the first secret value, the first commitment value may be generated by: generating a random number; obtaining a preset commitment function; using the preset commitment function and the commitment key, processing the random number and the first secret value to generate the first commitment value. The random number generated here is equivalent to a blinding factor, and the blinding factor is used to blind the first commitment value.
[0086] For example, in an optional embodiment, the client may use a preset commitment function For the first secret value and the blinding factor Processing to obtain the first secret value ,Right now .in, , and the blinding factor A random number that can be randomly generated for the client. Continuing with the above example, The concatenation matrix , Similarly, the server can use the same preset commitment function as the client For the second secret value and the blinding factor Processed to obtain a second secret value ,Right now .in, , and the blinding factor A random number that can be randomly generated by the server.
[0087] From the above description, it can be seen that in the embodiment of the present invention, based on the homomorphic commitment scheme of random matrix and high-order bit extraction, the first commitment value corresponding to the client and the second commitment value corresponding to the server are generated, and information can be securely transmitted and verified between the client and the server. In the process of generating the target signature, the client and the server mainly perform two rounds of interaction, where the client and the server transmit their corresponding commitment values to each other to complete the first round of interaction.
[0088] In addition, after generating the first commitment value, the client may also perform a hash operation on the first commitment value to obtain a hash value corresponding to the first commitment value, and send the hash value to the server. After generating the second commitment value, the server may also perform a hash operation on the second commitment value to obtain a hash value corresponding to the second commitment value, and send the hash value to the client. After the client receives the hash value corresponding to the second commitment value sent by the server, the second commitment value may be verified by the hash value corresponding to the second commitment value to prevent the second commitment value from being tampered with during data transmission or by the server, to ensure the correctness of the second commitment value, and further ensure the correctness of the generated target signature. After the server receives the hash value corresponding to the first commitment value sent by the client, the first commitment value may be verified by the hash value corresponding to the first commitment value to prevent the first commitment value from being tampered with during data transmission or by the client.
[0089] For example, in an optional embodiment, the client can perform a hash operation on the second commitment value to obtain the operation result, and compare the operation result with the hash value corresponding to the second commitment value to see if they are equal. If they are equal, it indicates that the second commitment value is correct. If they are not equal, it indicates that the second commitment value has been tampered with and the signature should be terminated immediately. The same method can be used to verify the first commitment value, which will not be repeated here.
[0090] In actual applications, after the client successfully verifies the second commitment value, it can generate the first signature value according to the message to be signed, the first commitment value and the second commitment value, and then determine the first sub-signature value in the second signature value according to the first signature value and the private key corresponding to the client, and send the first sub-signature value to the server. At the same time, after the server successfully verifies the first commitment value, it can generate the first signature value according to the message to be signed, the first commitment value and the second commitment value, and then determine the second sub-signature value in the second signature value according to the first signature value and the private key corresponding to the server, and send the second sub-signature value to the client. Among them, the message to be signed can be a message, a video, an audio, a file or a transaction information, etc. The embodiment of the present invention does not limit the data type and data content corresponding to the message to be signed.
[0091] In an optional embodiment, according to the message to be signed, the first commitment value and the second commitment value, the specific implementation process of generating the first signature value can be: merging the first commitment value and the second commitment value to obtain the merged commitment value; performing a hash operation on the message to be signed and the merged commitment value to obtain the first signature value. Both the client and the server can use this method to generate the first signature value.
[0092] For example, the message to be signed is , the first commitment value is , the second commitment value is The first commitment value and the second commitment value are combined to obtain a combined commitment value of . Perform a hash operation on the signed message and the combined commitment value to obtain the first signature value .
[0093] After obtaining the first signature value, the client determines the first sub-signature value according to the first signature value and the private key corresponding to the client. The private key corresponding to the client includes the first random vector. In an optional embodiment, the third product value of the first signature value and the first random vector can be obtained; the second sum value of the mask vector and the third product value can be determined; and the second sum value can be determined as the first sub-signature value. For example, the first signature value is , the first random vector is , the mask vector is , then the first sub-signature value obtained is .
[0094] After obtaining the first signature value, the server determines the second sub-signature value according to the first signature value and the private key corresponding to the server. The private key corresponding to the server includes a third random vector. In an optional embodiment, the product value of the second signature value and the third random vector can be obtained; the sum of the mask vector corresponding to the server and the product value can be determined; and the sum is determined as the second sub-signature value. For example, the first signature value is , the third random vector is , the corresponding mask vector on the server is , then the second sub-signature value obtained is .
[0095] In addition, the client and server in the embodiment of the present invention jointly generate the target signature based on the lattice digital signature algorithm, so the generated signature value should satisfy the mathematical difficulty problem of the lattice, so that the generated target signature can better resist quantum computer attacks. In an optional embodiment, after the client generates the first sub-signature value, it can also verify whether the first sub-signature value satisfies the mathematical difficulty problem of the lattice. If it satisfies the mathematical difficulty problem of the lattice, the collaborative signature continues. If not, the client re-determines the first secret value for signing. Similarly, after the server generates the second sub-signature value, it can also verify whether the second sub-signature value satisfies the mathematical difficulty problem of the lattice, which will not be repeated here.
[0096] Then, after the client receives the second sub-signature value sent by the server, the second signature value can be determined according to the first sub-signature value and the second sub-signature value. Optionally, the second random number sent by the server can be received; the second random number, the second sub-signature value and the second commitment value can be verified using the commitment key. If the verification passes, the first sub-signature value and the second sub-signature value are merged to obtain the second signature value. When verifying, the client can first obtain the sub-private key component corresponding to the server, and predict the second secret value used by the server to generate the signature based on the target matrix, the second sub-signature value, the first signature value and the sub-private key component. The second commitment value is then opened using the commitment opening function, the commitment key, the predicted second secret value and the second random number. The sub-private key component is a part of the private key corresponding to the server.
[0097] For example, the second random number is , the target matrix is , the second sub-signature value , the first signature value is , the corresponding sub-private key component of the server is The second secret value used by the server to generate the signature is predicted to be .in, To extract high-bit functions, is the signature range parameter. If the value obtained after opening it using the commitment opening function is not equal to 1, that is , then the signature is terminated. If the value obtained after opening is equal to 1, the sum of the first sub-signature value and the second sub-signature value is determined as the second signature value, that is, the second signature value .in, Represents a promise opening function.
[0098] It should be noted that: in the embodiment of the present invention, the client finally outputs the collaboratively generated target signature, so the operation of synthesizing the second signature value and generating the target signature according to the first signature value and the second signature value can be completed only by the client. However, if in actual applications, the server also needs to obtain the target signature, the server can also perform the operation of synthesizing the second signature value and generating the target signature according to the first signature value and the second signature value, and output the corresponding target signature on the server, and there is no limitation on this.
[0099] From the above description, it can be seen that the client and the server have completed the second round of interaction. When the client or the server generates their respective sub-signature values, they send their respective sub-signature values to the other end, so that the server or the client synthesizes the second signature value based on their respective sub-signature values and the sub-signature value corresponding to the other end.
[0100] Finally, the client generates a target signature value corresponding to the message to be signed based on the first signature value and the second signature value. Optionally, the specific implementation process of obtaining the target signature corresponding to the message to be signed based on the first signature value and the second signature value may include: obtaining the fourth product value of the target matrix and the second signature value and the fifth product value of the first signature value and the first sum value; determining the difference between the fourth product value and the fifth product value; determining the third signature value based on the difference; obtaining the target signature corresponding to the message to be signed based on the first signature value, the second signature value and the third signature value. The first sum value is the sum of the first product value of the target matrix and the first random vector and the second random vector.
[0101] The implementation process of determining the third signature value based on the difference may be: extracting the high-order bits from the difference, and determining the third signature value based on the extracted high-order bit value, the first secret value, and the predicted second secret value. , Generate a third signature value. is the first secret value, is the predicted second secret value, is the third signature value, and q is the modulus. In this way, the client can directly output the target signature .in, is the first signature value, is the second signature value, is the third signature value.
[0102] In the embodiment of the present invention, the client and the server generate the same commitment key by using the same random seed. In the subsequent signing process, the same commitment key can be used to verify the validity of the commitment value, thereby ensuring the security of the signature. In addition, in the process of generating the signature, the client and the server perform two rounds of interaction. The first time, after the client and the server generate the corresponding commitment value, they send their respective corresponding commitment values to the other end, so that the other end can generate the first signature value based on the first commitment value and the second commitment value. The second time, when the client and the server generate the sub-signature value in the corresponding second signature value, they send their respective corresponding sub-signature values to the other end, so that the other end can determine the second signature value based on the first sub-signature value and the second sub-signature value, and then generate the target signature based on the first signature value and the second signature value. That is, the client and the server achieve the collaborative generation of the post-quantum signature by the two participants through two interactions. In this way, even if the client private key is leaked, the post-quantum signature cannot be successfully forged, thereby improving the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature according to the agreement, so as to adapt to the data transmission in the cloud environment application scenario.
[0103] The above embodiment introduces the process of generating a target signature through interaction between the client and the server in the post-quantum signature system. When generating the target signature, the signature public key, the private key corresponding to the client, and the private key corresponding to the server can be generated first. In order to better understand the generation process of the signature key pair, the specific process of generating the signature public key, the private key corresponding to the client, and the private key corresponding to the server is described below.
[0104] In a specific implementation, the client generates a first random matrix, performs a hash operation on the first random matrix, obtains a hash value corresponding to the first random matrix, and sends the hash value and the first random matrix to the server. The server generates a second random matrix, performs a hash operation on the second random matrix, obtains a hash value corresponding to the second random matrix, and sends the hash value and the second random matrix to the client. The client and the server exchange randomly generated random matrices, which ensures that both parties have a common randomness basis, and the generation of the first random matrix and the second random matrix is independent of the other end, thereby increasing the security of the method.
[0105] The first random matrix and the second random matrix may be a k×l matrix. Optionally, a k×l matrix may be randomly and uniformly selected from the ring Rq as the first random matrix. A k×l matrix may be randomly and uniformly selected from the ring Rq as the second random matrix.
[0106] Next, the client receives the second random matrix and the hash value corresponding to the second random matrix sent by the server, and verifies the second random matrix using the hash value corresponding to the second random matrix. If the verification is successful, the first random matrix and the second random matrix are synthesized to obtain the target matrix. Similarly, the server receives the first random matrix and the hash value corresponding to the first random matrix sent by the client, and verifies the first random matrix using the hash value corresponding to the first random matrix. If the verification is successful, the first random matrix and the second random matrix are synthesized to obtain the target matrix.
[0107] In actual applications, the client and the server exchange hash values to verify whether the other party has generated a random matrix. Specifically, the client can perform a hash operation on the second random matrix to obtain a result. If the result is equal to the hash value corresponding to the received second random matrix, it means that the verification is successful, indicating that the server has indeed generated a second random matrix. Similarly, the server can perform a hash operation on the received first random matrix to obtain a result. If the result is equal to the hash value corresponding to the received first random matrix, it means that the verification is successful, indicating that the client has indeed generated a second random matrix.
[0108] Optionally, the first random matrix and the second random matrix are synthesized to obtain the target matrix in a specific implementation manner: determine the sum of the first random matrix and the second random matrix, and determine the sum as the target matrix. For example, the first random matrix is , the second random matrix is , then the target matrix is .
[0109] In practical applications, the signature public key is usually public. If the target matrix is directly used as part of the signature public key, then if the attacker obtains the random matrix corresponding to either end, he can directly infer the random matrix corresponding to the other end based on the target matrix and the random matrix corresponding to one end, and then forge the corresponding target signature, so that the security of the target signature will be threatened. Therefore, in order to improve the security of the signature method, after obtaining the target matrix, the public matrix can be determined based on the target matrix and the unit matrix, and the public matrix can be used as part of the signature public key.
[0110] Optionally, the specific implementation method of determining the common matrix can be: horizontally concatenate the target matrix and the unit matrix to obtain the target matrix. The target matrix can be a k×l matrix whose elements come from the ring Rq, and the unit matrix can be a k×k unit matrix whose diagonal elements are all unit elements in Rq. Then the obtained common matrix is a k×(l+k) matrix. For example, the target matrix is , the identity matrix is , the obtained common matrix is .
[0111] In addition, after obtaining the target matrix, the client can generate a first random vector and a second random vector, and generate a private key corresponding to the client according to the target matrix, the first random vector and the second random vector. The server generates a third random vector and a fourth random vector, and generates a private key corresponding to the server according to the target matrix, the third random vector and the fourth random vector. Among them, the first random vector and the second random vector can be used as the sub-private key corresponding to the client, and the third random vector and the fourth random vector can be used as the sub-private key corresponding to the server.
[0112] In order to improve the security of the private key corresponding to the client and the private key corresponding to the server, when generating the corresponding private key, after the client generates the first random vector and the second random vector, the sub-private key component corresponding to the client can be determined according to the target matrix, the first random vector and the second random vector. Similarly, the server can determine the sub-private key component corresponding to the server according to the target matrix, the third random vector and the fourth random vector.
[0113] In an optional embodiment, the product value of the target matrix and the first random vector is obtained, and the sum of the product value and the second random vector is obtained, and the sum is determined as the first sub-private key component corresponding to the client. For example, continuing the above example, the target matrix is , the first random vector is , the second random vector is , then the first sub-private key component corresponding to the client is Here, the value range corresponding to the first random vector and the second random vector can also be specified. , .
[0114] For the server, the product value of the target matrix and the third random vector can be obtained, and the sum of the product value and the fourth random vector can be obtained, and the sum value can be determined as the second sub-private key component corresponding to the server. For example, the target matrix is , the third random vector is , the fourth random vector is , then the second sub-private key component corresponding to the server is The value ranges corresponding to the third random vector and the fourth random vector can also be specified. , .
[0115] After obtaining the first sub-private key component, the client can perform a hash operation on the first sub-private key component to obtain a hash value corresponding to the first sub-private key component, and send the first sub-private key component and the hash value to the server. After obtaining the second sub-private key component, the server can perform a hash operation on the second sub-private key component to obtain a hash value corresponding to the second sub-private key component, and send the second sub-private key component and the hash value corresponding to the second sub-private key component to the client. The client verifies the received hash value, and after the verification is passed, the first sub-private key component and the second private key component are synthesized to obtain the private key component, and the signature public key is determined according to the public matrix and the private key component, and the private key corresponding to the client is determined according to the target matrix, the private key component, the first random vector and the second random vector. The server verifies the received hash value, and after the verification is passed, the first sub-private key component and the second private key component are synthesized to obtain the private key component, and the private key corresponding to the server is determined according to the target matrix, the private key component, the third random vector and the fourth random vector.
[0116] For example, the target matrix is , the first sub-private key component is , the second sub-private key component is , the private key component is , the first random vector is , the second random vector is , the third random vector is , the fourth random vector is , the confirmed signature public key is , the private key corresponding to the client is , the private key corresponding to the client is .
[0117] From the above description, it can be seen that: in the key generation stage, the client and the server, each holding a private key, jointly generate a complete signature public key. At the same time, both ends can obtain the complete signature public key without leaking their own private keys.
[0118] The above embodiment introduces the interactive process of the client and the server in the post-quantum signature system to collaboratively generate the target signature, that is, an exemplary description of the target signature generation process from the system perspective. The following embodiments describe in detail the process of generating the target signature from the client perspective and from the server perspective.
[0119] Figure 3 A schematic diagram of a post-quantum signature method provided by an embodiment of the present invention; see Attachment Figure 3As shown, the execution subject of the method can be a post-quantum signature device, which is located at the client. It can be understood that the post-quantum signature device can be implemented as software, or a combination of software and hardware. Specifically, the post-quantum signature method can include the following steps:
[0120] 301. Select a random seed and generate a commitment key based on the random seed. The random seed is shared with the server.
[0121] 302. Determine a first secret value for generating a signature, and generate a first commitment value according to the commitment key and the first secret value.
[0122] 303. Receive a second commitment value sent by the server, and generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value, where the second commitment value is generated based on the commitment key and the second secret value.
[0123] 304. Determine a first sub-signature value according to the first signature value and a private key corresponding to the client.
[0124] 305. Receive a second sub-signature value sent by the server, and determine a second signature value according to the first sub-signature value and the second sub-signature value, where the second sub-signature value is determined based on the first signature value and a private key corresponding to the server.
[0125] 306. Generate a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0126] Among them, before the client collaborates with the server to generate the target signature, the client can first generate the private key corresponding to the client. Specifically, generate a first random matrix, a first random vector and a second random vector; receive the second random matrix and the first hash value sent by the server, the first hash value is obtained by performing a hash operation on the second random matrix; verify the second random matrix based on the second hash value, if the verification is successful, synthesize the first random matrix and the second random matrix to obtain the target matrix; generate the private key corresponding to the client according to the target matrix, the first random vector and the second random vector.
[0127] In an optional embodiment, the implementation process of generating a private key corresponding to the client based on the target matrix, the first random vector and the second random vector may include: obtaining a first product value of the target matrix and the first random vector, determining a first sum value of the first product value and the second random vector, and generating a private key corresponding to the client based on the target matrix, the first sum value, the first random vector and the second random vector.
[0128] After generating the private key corresponding to the client, the client and the server jointly generate the target signature. In specific implementation, the client can first randomly select a random seed and generate a commitment key based on the random seed. The random seed is shared with the server, so that the server can generate the same commitment key based on the same random seed as the client. This not only increases the randomness of generating the target signature, but also enables the client and the server to have a basis for collaboratively generating the target signature.
[0129] Optionally, a commitment key may be generated using a preset pseudo-random function and a random seed. Specifically, a third random matrix and a fourth random matrix are generated according to the random seed using a preset pseudo-random function. The third random matrix and the unit matrix are concatenated to obtain a concatenated matrix, and a commitment key is generated according to the concatenated matrix and the fourth random matrix.
[0130] After the commitment key is generated, a first secret value for generating a signature is determined. In an optional embodiment, a private key corresponding to the client is obtained, and the private key includes a target matrix; a third random vector is generated, and the third random vector is determined as a mask vector, and the mask vector is used to mask the target matrix; the first secret value is determined according to the mask vector and the target matrix. Among them, the specific implementation method of determining the first secret value according to the mask vector and the target matrix can be: obtaining a second product value of the mask vector and the target matrix; extracting high-order bits from the second product value as the first secret value.
[0131] Next, the first commitment value is generated according to the commitment key and the first secret value. In an optional embodiment, the specific implementation process of generating the first commitment value according to the commitment key and the first secret value may include: generating a random number and obtaining a preset commitment function. Using the preset commitment function and the commitment key, the random number and the first secret value are processed to generate the first commitment value.
[0132] Then, the second commitment value sent by the receiving server is generated according to the message to be signed, the first commitment value and the second commitment value, and the first signature value is generated based on the commitment key and the second secret value. In addition, before generating the first signature value, the second commitment value sent by the server can be verified. Specifically, the second hash value sent by the receiving server is obtained by performing a hash operation on the second commitment value. The second commitment value is verified based on the second hash value. If the verification passes, the first signature value is generated according to the message to be signed, the first commitment value and the second commitment value.
[0133] Optionally, based on the message to be signed, the first commitment value and the second commitment value, a specific implementation method of generating the first signature value may include: merging the first commitment value and the second commitment value to obtain a merged commitment value; performing a hash operation on the message to be signed and the merged commitment value to obtain the first signature value.
[0134] Then, according to the first signature value and the private key corresponding to the client, the first sub-signature value is determined. Optionally, the specific implementation process of determining the first sub-signature value may be: the private key corresponding to the client includes a first random vector, a third product value of the first signature value and the first random vector is obtained, and a second sum value of the mask vector and the third product value is determined. The second sum value is determined as the first sub-signature value.
[0135] Then, the second sub-signature value sent by the server is received, and the second signature value is determined according to the first sub-signature value and the second sub-signature value, wherein the second sub-signature value is determined based on the first signature value and the private key corresponding to the server. The specific implementation process of determining the second signature value according to the first sub-signature value and the second sub-signature value may include: receiving the second random number sent by the server, using the commitment key to verify the second random number, the second sub-signature value and the second commitment value, and if the verification is successful, merging the first sub-signature value and the second sub-signature value to obtain the second signature value.
[0136] Finally, a target signature corresponding to the message to be signed is generated according to the first signature value and the second signature value. Optionally, the specific implementation process of generating the target signature corresponding to the message to be signed may be: obtaining the fourth product value of the target matrix and the second signature value and the fifth product value of the first signature value and the first sum value; determining the difference between the fourth product value and the fifth product value; determining the third signature value according to the difference; obtaining the target signature corresponding to the message to be signed according to the first signature value, the second signature value and the third signature value.
[0137] In an embodiment of the present invention, the client receives the second commitment value sent by the server, and generates a first signature value based on the first commitment value and the second commitment value. Then, the client receives the sub-signature value in the second signature value generated by the server, determines the second signature value based on the first sub-signature value and the second sub-signature value, and then generates a target signature based on the first signature value and the second signature value. Using the homomorphic commitment mechanism of the lattice, the two ends use their corresponding private keys to collaboratively generate the target signature through two rounds of interaction, so that even if the client private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed, so as to adapt to data transmission in cloud environment application scenarios.
[0138] Among them, the specific implementation process involved in the embodiments of the present invention can refer to the contents in the above embodiments, and will not be repeated here.
[0139] Figure 4 A flowchart of another post-quantum signature method provided by an embodiment of the present invention; see Attachment Figure 4 As shown, the execution subject of the method can be a post-quantum signature device, which is located at the server end. It can be understood that the post-quantum signature device can be implemented as software, or a combination of software and hardware. Specifically, the post-quantum signature method can include the following steps:
[0140] 401. Obtain a random seed and generate a commitment key based on the random seed. The random seed is shared with the client.
[0141] 402. Receive a first commitment value sent by the client, where the first commitment value is generated based on a commitment key and a first secret value, and the first secret value is a secret value used to generate a signature.
[0142] 403. Determine a second secret value for generating a signature, and generate a second commitment value according to the commitment key and the second secret value.
[0143] 404. Generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value.
[0144] 405. Receive the first sub-signature value sent by the client, determine the second sub-signature value according to the first signature value and the private key corresponding to the server, and determine the second signature value according to the first sub-signature value and the second sub-signature value, wherein the first sub-signature value is determined based on the first signature value and the private key corresponding to the client.
[0145] 406. Obtain a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0146] When the server and the client collaborate to generate the target signature, the client selects a random seed, which is shared with the server. Then, when the server cooperates with the client to generate the target signature, it can first obtain the random seed and generate the commitment key based on the random seed.
[0147] Next, a first commitment value sent by the client is received. The first commitment value is generated based on the commitment key and the first secret value, and the first secret value is a secret value used to generate a signature. In addition, a second secret value used to generate the signature is determined, and a second commitment value is generated based on the commitment key and the second secret value. It should be noted that there is no limitation on the execution order of receiving the first commitment value sent by the client and generating the second commitment value. The second commitment value can be generated first, or these two operations can be performed simultaneously.
[0148] Then, a first signature value is generated according to the message to be signed, the first commitment value and the second commitment value. A first sub-signature value sent by the client is received. A second sub-signature value is determined according to the first signature value and the private key corresponding to the server, and a second signature value is determined according to the first sub-signature value and the second sub-signature value. The first sub-signature value is determined based on the first signature value and the private key corresponding to the client.
[0149] According to the first signature value and the second signature value, a target signature corresponding to the message to be signed is obtained. In an embodiment of the present invention, the server receives the first commitment value sent by the client, and generates a first signature value based on the first commitment value and the second commitment value. Then, the server receives the first sub-signature value in the second signature value generated by the client, determines the second signature value based on the first sub-signature value and the second sub-signature value, and then generates the target signature according to the first signature value and the second signature value. Using the homomorphic commitment mechanism of the lattice, the two ends use their respective corresponding private keys to collaboratively generate the target signature through two rounds of interaction, so that even if the private key corresponding to the client or the private key corresponding to the server is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed, so as to adapt to data transmission in cloud environment application scenarios.
[0150] Among them, the specific implementation process involved in the embodiments of the present invention can refer to the contents in the above embodiments, and will not be repeated here.
[0151] In order to facilitate the understanding of the implementation process of the above two ends jointly generating post-quantum signatures, the following is explained in combination with specific application scenarios. In specific applications, it is assumed that client A and the server need to jointly generate post-quantum signatures. Among them, the server can be a cloud server, and its specific implementation process may include the following steps:
[0152] Step 1: Get system parameters.
[0153] The system parameters include n, k, l, q, η, τ, γ, γ', and β. n is the degree of the polynomial in the ring R, k and l are the number of rows and columns of the target matrix A, q is the modulus, η is the range of the private key, τ is the number of ±1 in c, γ and γ' are the signature range parameters, and β is the signature interception parameter.
[0154] Step 2: Generate a signing key.
[0155] The client and the server jointly generate their own corresponding private keys and signature public keys. Part of the user's signature key is generated by the client, and part is generated independently on the server. The final key pair is generated by the interaction of the two parties, which improves the security of the key. Specifically, it includes the following steps:
[0156] Step 21: The client randomly generates a matrix . represents a k×l matrix randomly and uniformly selected from the ring Rq . And calculate the hash value corresponding to the random matrix, that is, the hash ,Will Send to the server.
[0157] Step 22: Randomly generate matrix on the server , and calculate the hash , Will Sent to the client.
[0158] Step 23: The client receives , the random matrix Sent to the server, the server receives it , the random matrix Sent to the client.
[0159] Step 24: Client Authentication , if they are not equal, terminate, otherwise, calculate the target matrix , generate a common matrix .
[0160] Step 25: The client randomly generates a sub-private key ,calculate , and calculate the hash value , the hash value Sent to the server. Randomly select an element or subset from the l-dimensional space associated with the private key range η and assign this element or subset to the variable .
[0161] Step 26: The server randomly generates a sub-private key ,calculate , and calculate the hash value , the hash value Sent to the client.
[0162] Step 27: Client Authentication If it is not true, terminate the signature, otherwise, calculate .
[0163] Step 28: Output the public key , client private key , server private key .
[0164] Step 3: Both ends interact and collaborate to generate the target signature.
[0165] When generating the target signature, the lattice homomorphic commitment mechanism is used. The two ends interact with each other through two rounds, and use their corresponding private keys to jointly generate the target signature. In this way, even if the client private key is leaked, the post-quantum signature cannot be successfully forged, which improves the security of the post-quantum signature. At the same time, it can also ensure that the client and the server complete the signature as agreed, so as to adapt to the data transmission in the cloud environment application scenario. The client and the server generate the target signature through two rounds of interaction. Specifically, it can include the following steps:
[0166] Step 31: The server and client use the same seed to randomly generate matrices . And let , generate commitment key .in, Will and A matrix formed by horizontal stitching.
[0167] Step 32: The client randomly generates a mask vector , random number ,calculate .
[0168] Step 33: The client generates a first commitment value , calculate its hash , and the hash value and the first commitment value Send to the server.
[0169] Step 34: The server randomly generates a mask vector , random number ,calculate .
[0170] Step 35: The server generates a second commitment value , calculate its hash , and the hash value and the second commitment value Sent to the client.
[0171] Step 36: Server Verification , if not established, the signature is terminated.
[0172] Step 37: Client Authentication If not, terminate the signature. Otherwise, continue as follows: ,calculate , m is the message to be signed, calculate ,if ,or , then return to step 32, otherwise, Send to the server. Representation vector The infinity norm or maximum norm of .
[0173] Step 38: Server-side calculation ,calculate , m is the message to be signed, calculate ,if ,or , then return to step 2, otherwise, Sent to the client. Representation vector The infinity norm or maximum norm of . It means extracting the low-order bits from a number x.
[0174] Step 39: Client Calculation ,if , then terminate the signature, otherwise, continue as follows: Calculate ,if , then return to step 32, otherwise, continue the following operations: , , . This function may represent "open" or "decrypt" related operations.
[0175] Step 310: Output target signature .
[0176] In addition, in practical applications, in order to confirm the integrity and correctness of the target signature, the target signature can also be verified. Specifically, the following steps can be included:
[0177] Step 41: Receive message Corresponding target signature and r, which is used to calculate the commitment value.
[0178] Step 42: Verification , is it established? If not, the verification fails.
[0179] Step 43: Utilize the Signature Public Key and Message and the corresponding commitment key to calculate the commitment key .
[0180] Step 44: Calculation , get the high bit , .
[0181] Step 45: Calculation .
[0182] Step 46: Verification ,If it is established, the signature verification passes, otherwise, the verification fails.
[0183] The embodiment of the present invention utilizes a lattice-based homomorphic commitment mechanism to effectively protect the security of the dilithium private key of the post-quantum signature algorithm. The signature key is generated in a distributed manner, and its key is generated independently on the client and server. Even if the client is leaked, the target signature will not be successfully forged, so that the generated target signature has a higher security.
[0184] The following will describe in detail the adapter signature generation device of one or more embodiments of the present invention. Those skilled in the art will appreciate that these devices can be configured using commercially available hardware components through the steps taught in this solution.
[0185] Figure 5 A schematic diagram of the structure of a post-quantum signature device provided by an embodiment of the present invention, located at the client, such as Figure 5 As shown, the device includes: a selection module 11, a first generation module 12, a receiving module 13, a first determination module 14, a second determination module 15, and a second generation module 16.
[0186] The selection module 11 is used to select a random seed and generate a commitment key based on the random seed, and the random seed is shared with the server.
[0187] The first generating module 12 is used to determine a first secret value for generating a signature, and to generate a first commitment value according to the commitment key and the first secret value.
[0188] The receiving module 13 is used to receive the second commitment value sent by the server, and generate a first signature value according to the message to be signed, the first commitment value and the second commitment value, where the second commitment value is generated based on the commitment key and the second secret value.
[0189] The first determining module 14 is used to determine a first sub-signature value according to the first signature value and a private key corresponding to the client.
[0190] The second determination module 15 is used to receive the second sub-signature value sent by the server, and determine the second signature value according to the first sub-signature value and the second sub-signature value, wherein the second sub-signature value is determined based on the first signature value and the private key corresponding to the server.
[0191] The second generating module 16 is used to generate a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0192] Optionally, the device also includes a key generation module, which is specifically used to: generate a first random matrix, a first random vector and a second random vector; receive the second random matrix and a first hash value sent by the server, wherein the first hash value is obtained by performing a hash operation on the second random matrix; verify the second random matrix based on the first hash value, and if the verification passes, synthesize the first random matrix and the second random matrix to obtain a target matrix; generate a private key corresponding to the client according to the target matrix, the first random vector and the second random vector.
[0193] Optionally, the key generation module is specifically used to: obtain a first product value of the target matrix and the first random vector; determine a first sum value of the first product value and the second random vector; and generate a private key corresponding to the client according to the target matrix, the first sum value, the first random vector and the second random vector.
[0194] Optionally, the selection module 11 is specifically used to: generate a third random matrix and a fourth random matrix according to the random seed using a preset pseudo-random function; concatenate the third random matrix and the unit matrix to obtain a concatenated matrix; and generate a commitment key according to the concatenated matrix and the fourth random matrix.
[0195] Optionally, the first generation module 12 is specifically used to: obtain a private key corresponding to the client, the private key including a target matrix; generate a third random vector, and determine the third random vector as a mask vector, the mask vector being used to mask the target matrix; determine a first secret value based on the mask vector and the target matrix.
[0196] Optionally, the first generating module 12 is specifically used to: obtain a second product value of the mask vector and the target matrix; and extract high-order bits from the second product value as the first secret value.
[0197] Optionally, the first generating module 12 is specifically used to: generate a random number; obtain a preset commitment function; use the preset commitment function and the commitment key to process the random number and the first secret value to generate the first commitment value.
[0198] Optionally, the receiving module 13 is specifically used to: receive a second hash value sent by the server, the second hash value is obtained by performing a hash operation on the second commitment value; verify the second commitment value based on the second hash value, and if the verification passes, generate a first signature value according to the message to be signed, the first commitment value and the second commitment value. Wherein, generating the first signature value according to the message to be signed, the first commitment value and the second commitment value includes: merging the first commitment value and the second commitment value to obtain a merged commitment value; performing a hash operation on the message to be signed and the merged commitment value to obtain the first signature value.
[0199] Optionally, the first determination module 14 is specifically used to: obtain a third product value of the first signature value and the first random vector; determine a second sum value of the mask vector and the third product value; and determine the second sum value as a first sub-signature value.
[0200] Optionally, the second determination module 15 is specifically used to: receive a second random number sent by the server; use the commitment key to verify the second random number, the second sub-signature value and the second commitment value, and if the verification passes, merge the first sub-signature value and the second sub-signature value to obtain a second signature value.
[0201] Optionally, the second generation module 16 is specifically used to: obtain a fourth product value of the target matrix and the second signature value and a fifth product value of the first signature value and the first sum value; determine a difference between the fourth product value and the fifth product value; determine a third signature value based on the difference; and obtain a target signature corresponding to the message to be signed based on the first signature value, the second signature value and the third signature value.
[0202] Figure 5 The device shown can execute the steps introduced in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments, which will not be repeated here.
[0203] In one possible design, the above Figure 5 The structure of the post-quantum signature device shown can be implemented as an electronic device, such as Figure 6 As shown, the electronic device may include: a memory 21, a processor 22, and a communication interface 23. The memory 21 stores executable code, and when the executable code is executed by the processor 22, the processor 22 can at least implement the post-quantum signature method provided in the above-mentioned embodiment.
[0204] Figure 7 A schematic diagram of the structure of another post-quantum signature device provided by an embodiment of the present invention, located at the server end, such as Figure 7 As shown, the device includes: an acquisition module 31, a receiving module 32, a first determination module 33, a generation module 34, a second determination module 35, and an obtaining module 36.
[0205] The acquisition module 31 is used to acquire a random seed and generate a commitment key according to the random seed, wherein the random seed is shared with the client.
[0206] The receiving module 32 is used to receive a first commitment value sent by the client, where the first commitment value is generated based on the commitment key and a first secret value, and the first secret value is a secret value used to generate a signature.
[0207] The first determination module 33 is used to determine a second secret value used to generate a signature, and generate a second commitment value according to the commitment key and the second secret value.
[0208] The generating module 34 is used to generate a first signature value according to the message to be signed, the first commitment value and the second commitment value.
[0209] The second determination module 35 is used to receive the first sub-signature value sent by the client, determine the second sub-signature value according to the first signature value and the private key corresponding to the server, and determine the second signature value according to the first sub-signature value and the second sub-signature value, wherein the first sub-signature value is determined based on the first signature value and the private key corresponding to the client.
[0210] The obtaining module 36 is used to obtain the target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0211] Figure 7 The device shown can execute the steps introduced in the aforementioned embodiments. For detailed execution process and technical effects, please refer to the description in the aforementioned embodiments, which will not be repeated here.
[0212] In one possible design, the above Figure 7 The structure of the post-quantum signature device shown can be implemented as an electronic device, such as Figure 8 As shown, the electronic device may include: a memory 41, a processor 42, and a communication interface 43. The memory 41 stores executable code, and when the executable code is executed by the processor 42, the processor 42 can at least implement the post-quantum signature method provided in the above-mentioned embodiment.
[0213] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the post-quantum signature method provided in the aforementioned embodiment.
[0214] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0215] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a computer product, and the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0216] 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 post-quantum signature method, characterized in that: Applied to a client, the client and the server jointly generate a post-quantum signature, and the method includes: Selecting a random seed, and using a preset pseudo-random function to generate a third random matrix and a fourth random matrix according to the random seed, wherein the random seed is shared with the server; Performing concatenation processing on the third random matrix and the unit matrix to obtain a concatenated matrix; generating a commitment key according to the concatenated matrix and the fourth random matrix; Determine a first secret value for generating a signature, and generate a first commitment value based on the commitment key and the first secret value; Receiving a second commitment value and a second hash value sent by the server, where the second commitment value is generated based on the commitment key and the second secret value, and the second hash value is obtained by performing a hash operation on the second commitment value; Verifying the second commitment value based on the second hash value, and if the verification passes, merging the first commitment value and the second commitment value to obtain a merged commitment value; Performing a hash operation on the message to be signed and the combined commitment value to obtain a first signature value; Determine a first sub-signature value according to the first signature value and a private key corresponding to the client; Receive a second sub-signature value sent by the server, and determine a second signature value according to the first sub-signature value and the second sub-signature value, where the second sub-signature value is determined based on the first signature value and a private key corresponding to the server; A target signature corresponding to the message to be signed is generated according to the first signature value and the second signature value.
2. The method according to claim 1, characterized in that The method further comprises: Generate a first random matrix, a first random vector, and a second random vector; receiving a second random matrix and a first hash value sent by the server, where the first hash value is obtained by performing a hash operation on the second random matrix; Verifying the second random matrix based on the first hash value, and if the verification passes, synthesizing the first random matrix and the second random matrix to obtain a target matrix; A private key corresponding to the client is generated according to the target matrix, the first random vector, and the second random vector.
3. The method according to claim 2, characterized in that The generating a private key corresponding to the client according to the target matrix, the first random vector, and the second random vector includes: Obtaining a first product value of the target matrix and the first random vector; determining a first sum value of the first product value and the second random vector; A private key corresponding to the client is generated according to the target matrix, the first sum, the first random vector, and the second random vector.
4. The method according to claim 3, characterized in that The determining of a first secret value for generating a signature comprises: Obtaining a private key corresponding to the client, wherein the private key includes a target matrix; Generate a third random vector, and determine the third random vector as a mask vector, wherein the mask vector is used to mask the target matrix; A first secret value is determined based on the mask vector and the target matrix.
5. The method according to claim 4, characterized in that Determining a first secret value according to the mask vector and the target matrix comprises: Obtaining a second product value of the mask vector and the target matrix; The high-order bits are extracted from the second product value as the first secret value.
6. The method according to claim 1, characterized in that Generating a first commitment value according to the commitment key and the first secret value includes: Generate a random number; Get the preset commitment function; The random number and the first secret value are processed using the preset commitment function and the commitment key to generate the first commitment value.
7. The method according to claim 4, characterized in that The private key corresponding to the client includes a first random vector, and determining a first sub-signature value according to the first signature value and the private key corresponding to the client includes: Obtaining a third product value of the first signature value and the first random vector; determining a second sum value of the mask vector and the third product value; The second sum value is determined as a first sub-signature value.
8. The method according to claim 7, characterized in that The determining the second signature value according to the first sub-signature value and the second sub-signature value includes: Receive a second random number sent by the server; The second random number, the second sub-signature value and the second commitment value are verified using the commitment key. If the verification passes, the first sub-signature value and the second sub-signature value are combined to obtain a second signature value.
9. The method according to claim 7, characterized in that: The generating, according to the first signature value and the second signature value, a target signature corresponding to the message to be signed includes: Obtain a fourth product value of the target matrix and the second signature value and a fifth product value of the first signature value and the first sum value; determining a difference between the fourth product value and the fifth product value; Determine a third signature value according to the difference; A target signature corresponding to the message to be signed is obtained according to the first signature value, the second signature value and the third signature value.
10. A post-quantum signature method, characterized in that: Applied to a server, the server cooperates with a client to generate a post-quantum signature, and the method includes: Obtain a random seed, and use a preset pseudo-random function to generate a third random matrix and a fourth random matrix according to the random seed, wherein the random seed is shared with the client; Performing concatenation processing on the third random matrix and the unit matrix to obtain a concatenated matrix; generating a commitment key according to the concatenated matrix and the fourth random matrix; Receive a first commitment value and a first hash value sent by the client, where the first commitment value is generated according to the commitment key and a first secret value, the first secret value is a secret value used to generate a signature, and the first hash value is obtained by performing a hash operation on the first commitment value; Determining a second secret value for generating a signature, and generating a second commitment value based on the commitment key and the second secret value; Performing a hash operation on the second commitment value to obtain a second hash value, and sending the second hash value to the client; Verifying the first commitment value based on the first hash value, and if the verification passes, merging the first commitment value and the second commitment value to obtain a merged commitment value; Performing a hash operation on the message to be signed and the combined commitment value to obtain a first signature value; Receive a first subsignature value sent by the client, determine a second subsignature value according to the first signature value and a private key corresponding to the server, and determine a second signature value according to the first subsignature value and the second subsignature value, wherein the first subsignature value is determined based on the first signature value and the private key corresponding to the client; A target signature corresponding to the message to be signed is obtained according to the first signature value and the second signature value.
11. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the post-quantum signature method as described in any one of claims 1 to 9 or 10.
Citation Information
Patent Citations
Collaborative signature method and device, and storage medium
CN116318688A
Message signature method and system, electronic equipment and storage medium
CN117499046A
Post-quantum two-party collaborative signature method based on modular lattice problem
CN117896077A
JWT signature generation method based on quantum algorithm and related product
CN118282665A
Signature generation terminal, signature verification terminal and method for verifying the hybrid-type quantum signature tag using the terminal
KR101269025B1
