Post-quantum signature method and device
By collaboratively generating post-quantum signatures between the client and the server, using shared random seeds and a two-round interaction mechanism, the problem of insufficient signature key security in traditional post-quantum signatures is solved, and high-security data transmission in the cloud environment is achieved. .
Patent Information
- Application Number
- CN202411088183.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In traditional post-quantum signature schemes, the signature key is generated by a single user, making it difficult to ensure security in a cloud environment. Especially when the terminal is attacked, key leakage may lead to forged signatures, causing data security risks.
The client and server are used to collaboratively generate post-quantum signatures, and a commitment key is generated by sharing a random seed, and two rounds of interactions are performed to generate a signature value to ensure the security and non-tamperability 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 the signature and ensures that the client and server complete the signature as agreed, adapting to data transmission in the cloud environment.
Smart Images

Figure CN118631455A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security data processing technology, 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 quantum computing era and are widely used in various application scenarios.
[0003] However, in traditional post-quantum signature schemes, the generation of signing keys and digital signatures is typically performed by a single user. For example, in cloud environments, it is difficult to fully trust cloud service providers. Post-quantum signature keys are typically stored in the terminal's memory. When a digital signature is required, the signing key is retrieved from the terminal's memory to sign the information to be signed. However, if the terminal is attacked, the signing key could be leaked, allowing an attacker to directly use the signing key to forge the terminal's digital signature. This is highly unsafe and could 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] Embodiments of the present invention provide a post-quantum signature method and device for enabling two parties to collaboratively generate a post-quantum signature, thereby improving the security of the post-quantum signature and being 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 collaborate to generate a post-quantum signature, the method comprising: Select a random seed and generate a commitment key based on the random seed, where the random seed is shared with the server; Determining a first secret value for generating a signature, and generating a first commitment value based on the commitment key and the first secret value; 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, where the second commitment value is generated based on the commitment key and the second secret value; Determine a first sub-signature value based on the first signature value and a private key corresponding to the client; receiving a second subsignature value sent by the server, and determining a second signature value based on the first subsignature value and the second subsignature value, where the second subsignature value is determined based on the first signature value and a private key corresponding to the server; Generate a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0007] In a second aspect, an embodiment of the present invention provides a post-quantum signature device, which is applied to a client. The client and the server collaborate to generate a post-quantum signature. The device includes: A selection module, configured to select a random seed and generate a commitment key based on the random seed, wherein the random seed is shared with the server; a first generating module, configured to 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; 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; A first determining module, configured to determine a first sub-signature value based on the first signature value and a private key corresponding to the client; a second determining module, configured to receive a second sub-signature value sent by the server, and determine a second signature value based on 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; 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.
[0008] 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 described in the first aspect.
[0009] 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.
[0010] 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: Obtaining a random seed and generating a commitment key based on the random seed, wherein the random seed is shared with the client; 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; 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; Generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value; Receive a first subsignature value sent by the client, determine a second subsignature value based on the first signature value and a private key corresponding to the server, and determine a second signature value based on the first subsignature value and the second subsignature value, where the first subsignature value is determined based on the first signature value and the private key corresponding to the client; Obtain a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0011] 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: An acquisition module, configured to acquire a random seed and generate a commitment key based on the random seed, wherein the random seed is shared with the client; a receiving module, configured 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, where the first secret value is a secret value used to generate a signature; a first determining module, configured to determine a second secret value for generating a signature, and generate a second commitment value based on the commitment key and the second secret value; a generating module, configured to generate a first signature value based on the message to be signed, the first commitment value, and the second commitment value; a second determining module, configured to receive a first subsignature value sent by the client, determine a second subsignature value based on the first signature value and a private key corresponding to the server, and determine a second signature value based on 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; An obtaining module is used to obtain a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0012] 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 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.
[0013] In an eighth 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 fifth aspect.
[0014] 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. In this way, even in a cloud environment, without trusted third-party supervision, the security of the post-quantum signature can be ensured to ensure the integrity and non-tamperability of the data.
[0015] Specifically, when two parties perform a post-quantum signature, the client first selects a random seed and generates a commitment key based on it. This random seed is shared with the server, allowing the server to generate the same commitment key based on the same random seed. Next, the client determines a first secret value for generating the signature, generates a 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 determines a second secret value for generating the signature, generates a second commitment value based on the commitment key and the second secret value, and sends the second commitment value to the client. The client and server then generate a first signature value based on the signed message, the first commitment value, and the second commitment value, respectively. The client determines a first subsignature value based on the first signature value and the client's corresponding private key, and sends the first subsignature value to the server. The server determines a second subsignature value based on the first signature value and the server's corresponding private key, and sends the second subsignature value to the client. The client and server then determine a second signature value based on the first and second subsignature values, respectively. Finally, based on the first signature value and the derived signature value, they obtain the target signature corresponding to the proxy-signed message.
[0016] In the above scheme, the client and server use the same random seed to generate the same commitment key. During the subsequent signing process, the same commitment key can be used to verify the validity of the commitment value, ensuring the security of the signature. Furthermore, during the signature generation process, the client and server interact in two rounds. First, after generating the corresponding commitment value, the client and server send their respective commitment values to the other party, allowing the other party to generate a first signature value based on the first and second commitment values. Second, when generating the subsignature value within the corresponding second signature value, the client and server send their respective subsignature values to the other party. The other party can then determine the second signature value based on the first and second subsignature values, and then generate the target signature based on the first and second signature values. In other words, through these two interactions, the client and server achieve collaborative post-quantum signature generation. This ensures that even if the client's private key is compromised, the post-quantum signature cannot be successfully forged, improving the security of the post-quantum signature. This also ensures that the client and server complete the signature as agreed, making it suitable for data transmission in cloud environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to 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 paying any creative work.
[0018] Figure 1 A schematic diagram of a post-quantum signature system provided by an embodiment of the present invention; Figure 2 An interactive flow chart of a post-quantum signature method provided by an embodiment of the present invention; Figure 3 A schematic diagram of a post-quantum signature method according to an embodiment of the present invention; Figure 4 A schematic diagram of a process flow of another post-quantum signature method provided by an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a post-quantum signature device provided by an embodiment of the present invention; Figure 6 For Figure 5 A schematic diagram of the structure of an electronic device corresponding to the post-quantum signature device provided by the illustrated embodiment; Figure 7 A schematic structural diagram of another post-quantum signature device provided by an embodiment of the present invention; Figure 8 For Figure 7Schematic diagram of the structure of the electronic device corresponding to the post-quantum signature device provided by the illustrated embodiment. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0020] 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 merely a description of the association relationship of associated objects, indicating that there may be three relationships, for example, A and / or B, which can represent: 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 in an "or" relationship. Depending on the context, the words "if" and "if" used herein can be interpreted as "at the time of" or "when..."
[0021] It should also be noted that the terms "include," "comprises," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the product or system comprising the element.
[0022] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0023] 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 of signing keys and digital signatures is typically performed by a single user. For example, in cloud environments, it is difficult to fully trust cloud service providers. Post-quantum signature keys are typically stored in the terminal's memory. When a digital signature is required, the signing key is retrieved from the terminal's memory to sign the information to be signed. However, if the terminal is attacked, the signing key may be leaked, allowing an attacker to directly use the signing key to forge the terminal's digital signature. This is highly insecure and could cause significant losses to users.
[0024] To address the aforementioned technical issues, while improving the security of keys and signatures without compromising user experience or cost, the present invention proposes a new post-quantum signature method. Part of the user's signature key is generated on the client side, while part is independently generated on the server side. The two parties interact to generate the final key pair, enhancing key security. Furthermore, utilizing the lattice's homomorphic commitment mechanism, both parties collaborate to generate the target signature using their respective private keys through two rounds of interaction. This prevents the successful forgery of a post-quantum signature even if the client's private key is compromised, improving the security of the post-quantum signature while ensuring that the client and server complete the signature as agreed upon. This approach is suitable for data transmission in cloud environments.
[0025] The post-quantum signature scheme is exemplified below with reference to the following embodiments.
[0026] 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.
[0027] The client can be any user device that needs to collaborate with the server to sign. The client can be any computing device with certain data transmission capabilities. In specific implementations, 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, such as a cluster server, a regular server, a cloud server, a cloud host, a virtual center, etc.
[0028] In an embodiment of the present invention, the client and the server can interact to collaboratively generate a signature key pair. When signing, both ends can interact and each use their own private key to perform distributed signing to collaboratively generate a target signature.
[0029] Specifically, the client first 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 hash value corresponding to the second random matrix and the second random matrix to the client. Next, the client receives the hash value corresponding to the second random matrix and the second random matrix sent by the server and verifies the second random matrix based on the hash value. If the verification passes, the first random matrix and the second random matrix are synthesized to obtain a target matrix. Similarly, after receiving the first random matrix and the hash value corresponding to the first random matrix sent by the client, the server verifies the first random matrix based on the hash value. If the verification passes, 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 based on 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 based on 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.
[0030] After generating the client's corresponding private key and the server's corresponding private key, a post-quantum signature can be performed using their respective private keys. Specifically, when generating the target signature, the client and server interact twice. The first time, when generating a commitment value corresponding to the secret value used to generate the signature, the client and server send their respective commitment values to the other party, allowing the other party to generate a first signature value based on the first and second commitment values. Then, in the second interaction, when generating the subsignature value within the corresponding second signature value, the client and server send their respective subsignature values to the other party, allowing the other party to determine the second signature value based on the first and second subsignature values, and then generate the target signature based on the first and second signature values. In other words, through these two interactions, the client and server achieve collaborative post-quantum signature generation. This ensures that even if the client's private key is leaked, the post-quantum signature cannot be successfully forged, improving the security of the post-quantum signature. This also ensures that the client and server complete the signature as agreed, adapting to data transmission in cloud environment scenarios.
[0031] In order to understand the specific process of the client and server collaborating to generate the target signature, Figure 2 The specific process of the client and server collaboratively generating a post-quantum signature through interaction is illustrated.
[0032] 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: 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.
[0033] 202. The server generates a commitment key based on the random seed.
[0034] 203. The client determines a first secret value for generating a signature, generates a first commitment value based on the commitment key and the first secret value, and sends the first commitment value to the server.
[0035] 204. The server determines a second secret value for generating a signature, generates a second commitment value based on the commitment key and the second secret value, and sends the second commitment value to the client.
[0036] 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.
[0037] 206. The client determines a first sub-signature value based on the first signature value and the private key corresponding to the client.
[0038] 207. The server determines a second sub-signature value based on the first signature value and the private key corresponding to the server, and sends the second sub-signature value to the client.
[0039] 208. The client receives the second sub-signature value sent by the server, and determines a second signature value based on the first sub-signature value and the second sub-signature value.
[0040] 209. The client generates a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0041] The post-quantum signature scheme provided in this embodiment can be implemented by utilizing a lattice signature algorithm and a homomorphic commitment mechanism. Specifically, a signing key pair can be generated, with one portion of the signing key independently generated by the client and another portion by the server. The two parties then interact to generate a key pair for signing. After the client and server generate the signing key pair, they can interact with each other using their respective private keys to collaboratively generate the target signature.
[0042] Specifically, the client can first select a random seed and generate a commitment key based on the random seed. This random seed is shared with the server, so that the server and client can use the same random seed to generate the same commitment key. This further ensures that the signatures completed by both parties comply with the agreed-upon conditions, ensuring the security and tamper-proof nature of the signatures. After the client selects a random seed, it can send the random seed to the server, which then generates a commitment key based on the random seed. Alternatively, other methods can be used to share the random seed selected by the client with the server, which is not limited in this embodiment of the present invention.
[0043] In an optional embodiment, the specific implementation process of the client or server generating a commitment key based on a random seed may include: using a preset pseudorandom function to generate a third random matrix and a fourth random matrix based on the random seed; concatenating the third random matrix and the identity matrix to obtain a concatenated matrix; and generating the commitment key based on the concatenated matrix and the fourth random matrix. The client and server may generate the commitment key in the same manner.
[0044] 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 identity 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 .
[0045] 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 client may determine the first secret value by obtaining a private key corresponding to the client, where the private key includes a target matrix. A third random vector is generated and used as a mask vector to mask the target matrix. The first secret value is then determined based on the mask vector and the target matrix.
[0046] Optionally, the specific implementation method of determining the first secret value based on the mask vector and the target matrix can 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.
[0047] For example, the private key corresponding to the client is , where the target matrix is The third random vector is generated 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.
[0048] In practical applications, if the second product value is directly determined as the first secret value used to generate the signature, this may leak too much information about the client's corresponding data. Therefore, to improve the security of the client's data information, by extracting only the high-order bits 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 sufficient 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, because 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.
[0049] The server may determine the second secret value by obtaining a private key corresponding to the server, the private key corresponding to the server 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 based on the fourth random vector and the target matrix.
[0050] Optionally, the specific implementation method of determining the second secret value based on the fourth random vector and the target matrix can 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.
[0051] 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 , 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.
[0052] 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. The commitment key and the first secret value can be processed using a preset commitment function to generate the first commitment value. Similarly, the commitment key and the second secret value can be processed using 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 that the first commitment value (or the second commitment value) can be blinded by the blinding factor. In this way, 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.
[0053] Optionally, specifically, generating the first commitment value based on the commitment key and the first secret value may be achieved by: generating a random number; obtaining a preset commitment function; and processing the random number and the first secret value using the preset commitment function and the commitment key 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.
[0054] For example, in an optional embodiment, the client can 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, is 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 Processing to obtain the second secret value ,Right now .in, , and the blinding factor A random number that can be randomly generated by the server.
[0055] As can be seen from the foregoing description, in this embodiment of the present invention, a homomorphic commitment scheme based on a random matrix and high-order bit extraction generates a first commitment value corresponding to the client and a second commitment value corresponding to the server, enabling secure information transmission and verification between the client and server. During the target signature generation process, the client and server primarily interact in two rounds, completing the first round by exchanging their respective commitment values.
[0056] 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, it may verify the second commitment value through the hash value corresponding to the second commitment value to prevent tampering with the second commitment value during data transmission or by the server, to ensure the correctness of the second commitment value, and thereby 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, it may verify the first commitment value through the hash value corresponding to the first commitment value to prevent tampering with the first commitment value during data transmission or by the client.
[0057] For example, in an optional embodiment, the client can perform a hash operation on the second commitment value to obtain a result, and compare the 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 signing should be terminated immediately. The same method can be used to verify the first commitment value, and will not be repeated here.
[0058] In actual applications, after the client successfully verifies the second commitment value, it can generate a first signature value based on 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 based on 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 a first signature value based on 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 based on the first signature value and the private key corresponding to the server, and send the second sub-signature value to the client. 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.
[0059] In an optional embodiment, the specific implementation process for generating the first signature value based on the message to be signed, the first commitment value, and the second commitment value may include: merging the first commitment value and the second commitment value to obtain a merged commitment value; and 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 may use this method to generate the first signature value.
[0060] 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 the combined commitment value . Hash the signed message and the combined commitment value to obtain the first signature value .
[0061] After obtaining the first signature value, the client determines the first sub-signature value based on 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 .
[0062] After obtaining the first signature value, the server determines the second sub-signature value based on 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 value can be 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 .
[0063] Furthermore, in the embodiments of the present invention, the client and server collaboratively generate a target signature using a lattice-based digital signature algorithm. Therefore, the generated signature value must satisfy the lattice's mathematical difficulty problem to ensure that the generated target signature is more resistant to 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 lattice's mathematical difficulty problem. If so, the collaborative signing process 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 lattice's mathematical difficulty problem. This operation will not be further described here.
[0064] Then, after the client receives the second sub-signature value sent by the server, it can determine the second signature value based on 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 performing verification, 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.
[0065] 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 prediction server to generate the signature is .in, To extract high-bit functions, Is the signature range parameter. If the value obtained after opening it using the promise opening function is not equal to 1, that is , then terminate the signature. 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.
[0066] It should be noted that in this embodiment of the present invention, the client ultimately outputs the collaboratively generated target signature. Therefore, the operations of synthesizing the second signature value and generating the target signature based on the first and second signature values can be performed solely by the client. However, if, in actual applications, the server also needs to obtain the target signature, the server can also perform the operations of synthesizing the second signature value and generating the target signature based on the first and second signature values, and output the corresponding target signature on the server. This is not limited to this.
[0067] 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.
[0068] 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 generating the target signature corresponding to the message to be signed based on the first signature value and the second signature value may include: obtaining 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 the difference between the fourth product value and the fifth product value; determining a third signature value based on the difference; and 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.
[0069] 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 the 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.
[0070] In this embodiment of the present invention, the client and server use the same random seed to generate the same commitment key. During the subsequent signing process, the same commitment key can be used to verify the validity of the commitment value, ensuring the security of the signature. Furthermore, during the signature generation process, the client and server interact in two rounds. First, after generating the corresponding commitment value, the client and server send their respective commitment values to the other party, allowing the other party to generate a first signature value based on the first and second commitment values. Second, when generating the subsignature value within the corresponding second signature value, the client and server send their respective subsignature values to the other party, allowing the other party to determine the second signature value based on the first and second subsignature values, and then generate the target signature based on the first and second signature values. In other words, through these two interactions, the client and server achieve collaborative post-quantum signature generation. This ensures that even if the client's private key is compromised, the post-quantum signature cannot be successfully forged, improving the security of the post-quantum signature. This also ensures that the client and server complete the signature as agreed, adapting to data transmission in cloud environment scenarios.
[0071] The above examples describe the process by which a client and server interact to generate a target signature in a post-quantum signature system. This process involves generating a public signature key, a corresponding client private key, and a corresponding server private key. To better understand the signature key pair generation process, the following describes the specific steps involved in generating these keys.
[0072] In a specific implementation, the client generates a first random matrix and performs a hash operation on the first random matrix to obtain a hash value corresponding to the first random matrix. The hash value and the first random matrix are then sent to the server. The server generates a second random matrix and performs a hash operation on the second random matrix to obtain a hash value corresponding to the second random matrix. The hash value and the second random matrix are then sent to the client. The exchange of randomly generated random matrices between the client and the server ensures that both parties have a common randomness foundation, and the generation of the first and second random matrices is independent of the other party, thereby increasing the security of the method.
[0073] The first random matrix and the second random matrix may be a k×l matrix. Alternatively, 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.
[0074] 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.
[0075] In actual applications, the client and 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, 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, the verification is successful, indicating that the client has indeed generated a second random matrix.
[0076] Optionally, the first random matrix and the second random matrix are synthesized to obtain the target matrix in a specific implementation manner: determining the sum of the first random matrix and the second random matrix, and determining the sum as the target matrix. For example, the first random matrix is , the second random matrix is , then the target matrix is .
[0077] In practical applications, signature public keys are typically public. If the target matrix is directly used as part of the signature public key, then if an attacker obtains the random matrix corresponding to either end, they 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, thus threatening the security of the target signature. Therefore, to improve the security of this signature method, after obtaining the target matrix, the public matrix can be determined based on the target matrix and the identity matrix, and this public matrix can be used as part of the signature public key.
[0078] Alternatively, a specific implementation method for determining the common matrix may be: horizontally concatenate the target matrix and the identity matrix to obtain the target matrix. The target matrix may be a k×l matrix whose elements come from the ring Rq, and the identity matrix may be a k×k identity matrix whose diagonal elements are all identity elements in Rq. Then the common matrix obtained is a k×(l+k) matrix. For example, the target matrix is , the identity matrix is , the obtained common matrix is .
[0079] 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 based on 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 based on the target matrix, the third random vector, and the fourth random vector. The first and second random vectors can be used as the sub-private key corresponding to the client, and the third and fourth random vectors can be used as the sub-private key corresponding to the server.
[0080] To improve the security of the generated private keys corresponding to the client and the server, when generating the corresponding private keys, after the client generates the first random vector and the second random vector, the client's corresponding sub-private key components can be determined based on the target matrix, the first random vector, and the second random vector. Similarly, the server can determine the server's corresponding sub-private key components based on the target matrix, the third random vector, and the fourth random vector.
[0081] 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 The value ranges of the first random vector and the second random vector can also be specified. , .
[0082] 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 of the third random vector and the fourth random vector can also be specified. , .
[0083] 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 hash values corresponding to the second sub-private key component and the second sub-private key component to the client. The client verifies the received hash value. If the verification is successful, it combines the first sub-private key component and the second sub-private key component to obtain a private key component. Based on the public matrix and the private key component, it determines the signature public key. Based on the target matrix, the private key component, the first random vector, and the second random vector, it determines the client's corresponding private key. The server verifies the received hash value. If the verification is successful, it combines the first sub-private key component and the second sub-private key component to obtain a private key component. Based on the target matrix, the private key component, the third random vector, and the fourth random vector, it determines the server's corresponding private key.
[0084] 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 .
[0085] From the above description, we can see that: in the key generation phase, the client and server, each holding their own 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.
[0086] The above examples describe the interactive process of generating a target signature between a client and a server in a post-quantum signature system. This provides an illustrative description of the target signature generation process from a system perspective. The following examples describe the target signature generation process in detail from both the client and server perspectives.
[0087] Figure 3 A schematic diagram of a post-quantum signature method provided by an embodiment of the present invention; see the attached Figure 3As shown, the execution subject of this method can be a post-quantum signature device, which is located on the client. It is 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: 301. Select a random seed and generate a commitment key based on the random seed. The random seed is shared with the server.
[0088] 302. 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.
[0089] 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.
[0090] 304. Determine a first sub-signature value based on the first signature value and the private key corresponding to the client.
[0091] 305. Receive the second sub-signature value sent by the server, and determine the second signature value based on 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 the private key corresponding to the server.
[0092] 306. Generate a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0093] Before collaborating with the server to generate a target signature, the client can first generate a private key corresponding to the client. Specifically, a first random matrix, a first random vector, and a second random vector are generated; the second random matrix and a first hash value sent by the server are received, where the first hash value is obtained by performing a hash operation on the second random matrix; the second random matrix is verified based on the second hash value. If the verification passes, the first random matrix and the second random matrix are synthesized to obtain the target matrix; and the private key corresponding to the client is generated based on the target matrix, the first random vector, and the second random vector.
[0094] 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 the private key corresponding to the client based on the target matrix, the first sum value, the first random vector, and the second random vector.
[0095] After generating the client's corresponding private key, the client and server collaborate to generate the target signature. Specifically, the client can first randomly select a random seed and generate a commitment key based on this random seed. The random seed is shared with the server, allowing the server to generate the same commitment key based on the same random seed as the client. This not only increases the randomness of the generated target signature, but also enables the client and server to collaborate on generating the target signature.
[0096] Optionally, a commitment key can be generated using a preset pseudorandom function and a random seed. Specifically, a third random matrix and a fourth random matrix are generated using the preset pseudorandom function and the random seed. The third random matrix and the identity matrix are concatenated to obtain a concatenated matrix, and the commitment key is generated using the concatenated matrix and the fourth random matrix.
[0097] After generating the commitment key, a first secret value for generating the signature is determined. In an optional embodiment, a private key corresponding to the client is obtained, the private key including a target matrix; a third random vector is generated and used as a mask vector, which is used to mask the target matrix; and the first secret value is determined based on the mask vector and the target matrix. Determining the first secret value based on the mask vector and the target matrix can be specifically implemented by obtaining a second product value of the mask vector and the target matrix; and extracting the high-order bits from the second product value as the first secret value.
[0098] Next, a first commitment value is generated based on the commitment key and the first secret value. In an optional embodiment, the specific implementation process of generating the first commitment value based on the commitment key and the first secret value may include: generating a random number, obtaining a preset commitment function, and processing the random number and the first secret value using the preset commitment function and the commitment key to generate the first commitment value.
[0099] Then, the second commitment value sent by the server is received, and the first signature value is generated based on the message to be signed, the first commitment value, and the second commitment value. The second commitment 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 server is received, and the second hash value 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 based on the message to be signed, the first commitment value, and the second commitment value.
[0100] Optionally, based on the message to be signed, the first commitment value, and the second commitment value, a specific implementation method for 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.
[0101] Then, a first sub-signature value is determined based on the first signature value and the private key corresponding to the client. Optionally, the specific implementation process for determining the first sub-signature value may include: the private key corresponding to the client includes a first random vector, 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, and determining the second sum value as the first sub-signature value.
[0102] Then, a second subsignature value sent by the server is received, and a second signature value is determined based on the first subsignature value and the second subsignature value, where the second subsignature value is determined based on the first signature value and a private key corresponding to the server. The specific implementation process of determining the second signature value based on the first subsignature value and the second subsignature value may include: receiving a second random number sent by the server, verifying the second random number, the second subsignature value, and the second commitment value using the commitment key, and if the verification passes, merging the first subsignature value and the second subsignature value to obtain the second signature value.
[0103] Finally, a target signature corresponding to the message to be signed is generated based on 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 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; determining a third signature value based on the difference; and 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.
[0104] 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. Utilizing the lattice homomorphic commitment mechanism, the two ends interact in two rounds and collaboratively generate the target signature using their respective private keys. This way, even if the client's 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 server complete the signature as agreed, so as to adapt to data transmission in cloud environment application scenarios.
[0105] Among them, the specific implementation process involved in the embodiments of the present invention can refer to the contents of the above embodiments and will not be repeated here.
[0106] Figure 4 A flowchart of another post-quantum signature method provided by an embodiment of the present invention; see the attached Figure 4 As shown, the execution subject of the method can be a post-quantum signature device, which is located on the server side. It is 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: 401. Obtain a random seed and generate a commitment key based on the random seed. The random seed is shared with the client.
[0107] 402. 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.
[0108] 403. Determine a second secret value for generating a signature, and generate a second commitment value based on the commitment key and the second secret value.
[0109] 404. Generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value.
[0110] 405. Receive the first sub-signature value sent by the client, determine the second sub-signature value based on the first signature value and the private key corresponding to the server, and determine the second signature value based on the first sub-signature value and the second sub-signature value, where the first sub-signature value is determined based on the first signature value and the private key corresponding to the client.
[0111] 406. Obtain a target signature corresponding to the message to be signed based on the first signature value and the second signature value.
[0112] When the server and the client collaborate to generate the target signature, the client selects a random seed, which is then shared with the server. When the server collaborates with the client to generate the target signature, it can first obtain the random seed and generate the commitment key based on it.
[0113] Next, a first commitment value is received from the client. The first commitment value is generated based on the commitment key and the first secret value, which is used to generate the signature. Furthermore, a second secret value is determined for generating the signature, 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 specific order for receiving the first commitment value from the client and generating the second commitment value. The second commitment value can be generated first, or both operations can be performed simultaneously.
[0114] Then, a first signature value is generated based on 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 based on the first signature value and the private key corresponding to the server, and a second signature value is determined based on 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.
[0115] 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 a target signature based on the first signature value and the second signature value. Utilizing the lattice homomorphic commitment mechanism, the two ends interact through two rounds and use their respective private keys to collaboratively generate the target signature. In this way, 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, thereby improving the security of the post-quantum signature. At the same time, it can also ensure that the client and the server have completed the signature as agreed, so as to adapt to data transmission in cloud environment application scenarios.
[0116] Among them, the specific implementation process involved in the embodiments of the present invention can refer to the contents of the above embodiments and will not be repeated here.
[0117] To facilitate understanding of the implementation process of the above-mentioned collaborative generation of post-quantum signatures by both parties, we will explain it in conjunction with a specific application scenario. In a specific application, it is assumed that client A and the server need to collaboratively generate a post-quantum signature. The server can be a cloud server, and its specific implementation process may include the following steps: Step 1: Get system parameters.
[0118] 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, respectively, 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 truncation parameter.
[0119] Step 2: Generate a signing key.
[0120] The client and server collaborate to generate their respective private keys and signature public keys. Part of the user's signature key is generated by the client, while the other part is generated independently on the server. The final key pair is generated through interaction between the two parties, improving key security. Specifically, the steps are as follows: 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, hash ,Will Sent to the server.
[0121] Step 22: Randomly generate matrix on the server , and calculate the hash , Will Sent to the client.
[0122] Step 23: The client receives , the random matrix Sent to the server, and the server receives it , the random matrix Sent to the client.
[0123] Step 24: Client Authentication , if they are not equal, terminate, otherwise, calculate the target matrix , generate a public matrix .
[0124] Step 25: The client randomly generates a child 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 .
[0125] Step 26: The server randomly generates a child private key ,calculate , and calculate the hash value , the hash value Sent to the client.
[0126] Step 27: Client Validation If it is not true, terminate the signature, otherwise, calculate .
[0127] Step 28: Output the public key , client private key , server private key .
[0128] Step 3: Both ends interact and collaborate to generate the target signature.
[0129] When generating the target signature, the lattice homomorphic commitment mechanism is used. The two parties interact in two rounds and use their corresponding private keys to collaboratively generate the target signature. This way, even if the client's 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 server complete the signature according to the agreement, which is suitable for data transmission in cloud environment application scenarios. The client and server generate the target signature through two rounds of interaction. Specifically, it can include the following steps: 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.
[0130] Step 32: The client randomly generates a mask vector , random number ,calculate .
[0131] Step 33: The client generates the first commitment value , calculate its hash , and the hash value and the first commitment value Sent to the server.
[0132] Step 34: The server randomly generates a mask vector , random number ,calculate .
[0133] 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.
[0134] Step 36: Server Verification , if it is not true, the signature is terminated.
[0135] Step 37: Client Validation If not, terminate the signature. Otherwise, continue with the following steps: ,calculate ,m is the message to be signed, calculate ,if ,or , then return to step 32, otherwise, Sent to the server. Represents a vector The infinity norm or maximum norm of .
[0136] 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. Represents a vector The infinite norm or maximum norm of . Indicates extracting the low-order bits from a number x.
[0137] 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.
[0138] Step 310: Output target signature .
[0139] In addition, in actual applications, in order to confirm the integrity and correctness of the target signature, the target signature can also be verified. Specifically, the following steps may be included: Step 41: Receive message Corresponding target signature and r, which is used to calculate the commitment value.
[0140] Step 42: Verification , is it true? If not, the verification fails.
[0141] Step 43: Utilize the Signature Public Key and messages and the corresponding commitment key to calculate the commitment key .
[0142] Step 44: Calculation , get the high bit , .
[0143] Step 45: Calculation .
[0144] Step 46: Verification ,If it is established, the signature verification passes, otherwise, the verification fails.
[0145] This embodiment of the present invention utilizes a lattice-based homomorphic commitment mechanism to effectively protect the security of the post-quantum signature algorithm's Dilithium private key. The signature key is generated in a distributed manner, with the key generated independently on the client and server. Even if the client is leaked, the target signature cannot be successfully forged, resulting in a highly secure target signature.
[0146] The following describes in detail one or more embodiments of the adapter signature generation device of the present invention. Those skilled in the art will appreciate that these devices can be constructed using commercially available hardware components and configured according to the steps taught in this solution.
[0147] Figure 5 A schematic diagram of the structure of a post-quantum signature device provided by an embodiment of the present invention is 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.
[0148] 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.
[0149] The first generating module 12 is configured to 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.
[0150] 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.
[0151] The first determining module 14 is configured to determine a first sub-signature value according to the first signature value and a private key corresponding to the client.
[0152] The second determination module 15 is used to receive the 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 the private key corresponding to the server.
[0153] The second generating module 16 is configured to generate a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0154] 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, where 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 the private key corresponding to the client based on the target matrix, the first random vector and the second random vector.
[0155] 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 based on the target matrix, the first sum value, the first random vector and the second random vector.
[0156] 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.
[0157] 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; and determine a first secret value based on the mask vector and the target matrix.
[0158] Optionally, the first generating module 12 is specifically configured 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.
[0159] 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.
[0160] Optionally, the receiving module 13 is specifically configured to: receive a second hash value sent by the server, where 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 based on the message to be signed, the first commitment value, and the second commitment value. Generating the first signature value based on 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; and performing a hash operation on the message to be signed and the merged commitment value to obtain the first signature value.
[0161] 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 the first sub-signature value.
[0162] 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; if the verification is successful, merge the first sub-signature value and the second sub-signature value to obtain a second signature value.
[0163] 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.
[0164] 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 and will not be repeated here.
[0165] 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 aforementioned embodiment.
[0166] Figure 7 A schematic diagram of the structure of another post-quantum signature device provided by an embodiment of the present invention, located on the server side, 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 .
[0167] The acquisition module 31 is used to acquire a random seed and generate a commitment key based on the random seed, wherein the random seed is shared with the client.
[0168] The receiving module 32 is configured 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.
[0169] The first determining module 33 is configured to 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.
[0170] The generating module 34 is configured to generate a first signature value according to the message to be signed, the first commitment value, and the second commitment value.
[0171] The second determination module 35 is used to receive the first sub-signature value sent by the client, determine the second sub-signature value based on the first signature value and the private key corresponding to the server, and determine the second signature value based on the first sub-signature value and the second sub-signature value, where the first sub-signature value is determined based on the first signature value and the private key corresponding to the client.
[0172] The obtaining module 36 is configured to obtain a target signature corresponding to the message to be signed according to the first signature value and the second signature value.
[0173] 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 and will not be repeated here.
[0174] 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 aforementioned embodiment.
[0175] 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.
[0176] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Those skilled in the art can understand and implement the present invention without inventive effort.
[0177] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by adding the necessary general-purpose hardware platform, or of course, by combining hardware and software. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take 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 code.
[0178] 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 various 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 generating a commitment key based on the random seed, wherein the random seed is shared with the server; 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 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; 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 1, characterized in that: The step of generating a commitment key according to the random seed comprises: Using a preset pseudo-random function, and according to the random seed, generating a third random matrix and a fourth random matrix; Performing concatenation processing on the third random matrix and the unit matrix to obtain a concatenated matrix; A commitment key is generated according to the concatenated matrix and the fourth random matrix.
5. 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.
6. The method according to claim 5, 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.
7. 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.
8. The method according to claim 1, characterized in that The method according to claim 1 is characterized in that generating a first signature value according to the message to be signed, the first commitment value and the second commitment value comprises: receiving a second hash value sent by the server, where 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, generating a first signature value according to the message to be signed, the first commitment value, and the second commitment value; The step of generating a first signature value according to the message to be signed, the first commitment value, and the second commitment value includes: Combining the first commitment value and the second commitment value to obtain a combined commitment value; A hash operation is performed on the message to be signed and the combined commitment value to obtain a first signature value.
9. The method according to claim 5, 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.
10. The method according to claim 9, 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.
11. The method according to claim 9, 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.
12. 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: Obtaining a random seed, and generating a commitment key based on the random seed, wherein the random seed is shared with the client; 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; 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; Generate a first signature value according to the message to be signed, the first commitment value, and the second commitment 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.
13. 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 11 or 12.
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
Cited By
Quantum-attack-resistant key generation and signature method, device, system and equipment
CN119834972A
Quantum decryption method and device after cooperation of two parties
CN120074816A
Two-party collaborative Aigis-sig post-quantum signature method
CN120074817A
Key generation method and system between two terminals and electronic equipment
CN120128322A
A method, system, and electronic device for key generation between two terminals.
CN120128322B
