Collaborative key generation method and device based on hash algorithm, collaborative signature method and device based on hash algorithm, and electronic equipment
By generating collaborative keys between clients and servers, and using hash algorithms to interactively generate collaborative public keys and signature components, the problem of collaborative signature cannot be realized in the existing technology is solved, and a high-security signature solution is realized, which is suitable for mobile Internet environments .
Patent Information
- Application Number
- CN202411158775.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-08
AI Technical Summary
Existing signature schemes based on hash algorithms, such as the LM-OTS algorithm, cannot implement collaborative signatures, resulting in limited security and cannot effectively protect user keys when a single device is maliciously controlled.
By generating collaborative keys between the client and the server, using the hash algorithm to interact to generate collaborative public keys, and signing signed messages through collaborative signature components to ensure the security and adaptability of the signature.
It realizes high-security collaborative signature based on hash algorithm, which can effectively protect the signature private key in the mobile Internet environment and resist quantum computer attacks, and is suitable for various scenarios.
Smart Images

Figure CN118921169A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of digital signatures, and in particular to a method, device and electronic device for collaborative key generation and collaborative signature based on a hash algorithm. Background Art
[0002] Collaborative signature is a key security solution for digital signatures, that is, there are two or more devices that store part of the key respectively, and the digital signature is completed by the participants in collaboration. No participant can master the complete key, nor can they obtain the private key information of other communicating parties. This method effectively ensures the security of user keys when a single device is controlled by a malicious entity. At present, the LM-OTS algorithm is a hash-based signature algorithm. The LM-OTS algorithm belongs to a one-time signature scheme, that is, the signature private key can only be used once, otherwise there will be security problems. In other words, the current LM-OTS algorithm cannot achieve collaborative signatures.
[0003] Therefore, how to provide a technical solution for collaborative key generation and collaborative signature methods based on hash algorithms with higher security has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The purpose of some embodiments of the present application is to provide a method, device and electronic device for collaborative key generation and collaborative signature based on a hash algorithm. Through the technical solutions of the embodiments of the present application, collaborative signature based on a hash algorithm can be implemented, which has high security and can be widely applicable.
[0005] In a first aspect, some embodiments of the present application provide a method for collaborative key generation based on a hash algorithm, including: generating a client private key component; obtaining a first public key component based on a first private key component and a selected parameter in the client private key component; obtaining a client public key component through the first public key component; sending parameter data to a server, wherein the parameter data includes: the first public key component, a hash function, a first bit string and preset parameters, so that the server can generate a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component; the first public key component and the second public key component are used to generate a collaborative public key.
[0006] In some embodiments of the present application, through the interaction between the client and the server, the server can generate a server private key component and a server public key component through parameter data related to the client, and then the client can generate a collaborative public key through the first public key component in the client public key component and the second public key component of the server. The embodiments of the present application can realize collaborative key generation based on a hash algorithm, which has high security and can be widely applicable.
[0007] In some embodiments, generating a client private key component includes: randomly generating the first private key component and the first bit string of a preset byte length; determining the client private key component using the first private key component, the first bit string, specified parameters and an otstype parameter, wherein the otstype parameter is determined by the hash function, the preset byte length and the preset parameters.
[0008] Some embodiments of the present application determine the client private key component through a randomly generated first private key component and a first bit string, specified parameters and otstype parameters, thereby providing data support for collaborative key generation.
[0009] In some embodiments, after sending the parameter data to the server, the method further includes: receiving the second public key component sent by the server; using a key generation algorithm to calculate the first public key component, the second public key component, the first bit string and specified parameters to obtain the collaborative public key.
[0010] Some embodiments of the present application calculate relevant parameters to obtain a collaborative public key, thereby achieving collaborative key generation based on a hash-based signature algorithm and ensuring signature security.
[0011] In some embodiments, the collaborative public key is generated by the server based on the first public key component and the second public key component.
[0012] In a second aspect, some embodiments of the present application provide a method for collaborative key generation based on a hash algorithm, comprising: receiving parameter data sent by a client, wherein the parameter data comprises: a first public key component in a client private key component, a hash function, a first bit string and preset parameters; obtaining a server private key component through the parameter data; obtaining a second public key component based on a second private key component and selected parameters in the server private key component; obtaining a server public key component through the second public key component, the first bit string and other parameters; wherein the first public key component and the second public key component are used to generate a collaborative public key.
[0013] In some embodiments of the present application, through the interaction between the client and the server, the server can generate a server private key component and a server public key component through parameter data related to the client, and then generate a collaborative public key through the first public key component in the client public key component and the second public key component of the server. The embodiments of the present application can realize collaborative key generation based on a hash algorithm, which has high security and can be widely applicable.
[0014] In some embodiments, obtaining the server private key component through the parameter data includes: randomly generating the second private key component of a preset byte length, wherein the preset byte length is obtained through the output length of the hash function and the preset parameters; determining the otstype parameter using the hash function, the preset byte length and the preset parameters; determining the server private key component using the second private key component, the first bit string and the otstype parameter.
[0015] Some embodiments of the present application determine the server private key component through a randomly generated second private key component, an otstype parameter, and a first bit string, thereby providing data support for collaborative key generation.
[0016] In some embodiments, after obtaining the server public key component, the method further includes: calculating the first public key component and the second public key component to obtain the collaborative public key; or, sending the second public key component to the client so that the client can generate the collaborative public key based on the first public key component and the second public key component.
[0017] In some embodiments of the present application, a collaborative public key can be generated by the client or the server, which has high flexibility.
[0018] In the third aspect, some embodiments of the present application provide a method for collaborative signature based on a hash algorithm, including: sending signature parameters generated based on the message to be signed to the server, so that the server obtains the server collaborative signature component through the signature parameters, the second private key component in the server private key component and the preset parameters; receiving the server collaborative signature component sent by the server; obtaining the client collaborative signature component through the signature parameters, the first private key component in the client private key component and the preset parameters; using the server collaborative signature component and the client collaborative signature component to sign the message to be signed to obtain a signature result.
[0019] In some embodiments of the present application, the client sends the signature parameters of the message to be signed to the server so that the server can calculate the server collaborative signature component, and then the client can obtain the client collaborative signature component; finally, the server collaborative signature component and the client collaborative signature component are used to sign the message to be signed to obtain the signature result, thereby realizing collaborative signature based on hash signature algorithm, which has higher security and wider adaptability.
[0020] In some embodiments, obtaining the client collaborative signature component through the signature parameters, the first private key component in the client private key component and the preset parameters includes: using a one-time signature algorithm to calculate the signature parameters, the first private key component and the preset parameters to obtain the client collaborative signature component.
[0021] Some embodiments of the present application sign relevant parameters through relevant signature algorithms to obtain client collaborative signature components, providing data support for subsequent collaborative signatures.
[0022] In some embodiments, the client collaborative signature component is sent to the server, so that the server signs the message to be signed using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
[0023] In a fourth aspect, some embodiments of the present application provide a device for collaborative key generation based on a hash algorithm, comprising: a private key generation module, configured to generate a client private key component; an acquisition module, configured to obtain a first public key component based on a first private key component and a selected parameter in the client private key component; a public key generation module, configured to obtain a client public key component through the first public key component; a sending module, configured to send parameter data to a server, wherein the parameter data comprises: the first public key component, a hash function, a first bit string and preset parameters, so that the server generates a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component; the first public key component and the second public key component are used to generate a collaborative public key.
[0024] In a fifth aspect, some embodiments of the present application provide a device for collaborative key generation based on a hash algorithm, comprising: a data receiving module, configured to receive parameter data sent by a client, wherein the parameter data includes: a first public key component in a client private key component, a hash function, a first bit string and preset parameters; a data acquisition module, configured to obtain a server private key component through the parameter data; a component acquisition module, configured to obtain a second public key component based on a second private key component in the server private key component and selected parameters; a public key acquisition module, configured to obtain a server public key component through the second public key component, the first bit string and other parameters; wherein the first public key component and the second public key component are used to generate a collaborative public key.
[0025] In the sixth aspect, some embodiments of the present application provide a device for collaborative key generation based on a hash algorithm, including: a parameter sending module, configured to send signature parameters generated based on the message to be signed to a server, so that the server obtains the server collaborative signature component through the signature parameters, the second private key component in the server private key component and preset parameters; a component receiving module, configured to receive the server collaborative signature component sent by the server; an acquisition module, configured to obtain the client collaborative signature component through the signature parameters, the first private key component in the client private key component and the preset parameters; a signing module, configured to use the server collaborative signature component and the client collaborative signature component to sign the message to be signed to obtain a signature result.
[0026] In a seventh aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.
[0027] In an eighth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement a method as described in any embodiment of the first aspect when executing the program.
[0028] In a ninth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A system diagram of a collaborative signature based on a hash algorithm provided for some embodiments of the present application;
[0031] Figure 2 One of the flow charts of the method for collaborative key generation based on the hash algorithm provided in some embodiments of the present application;
[0032] Figure 3 A second flow chart of a method for collaborative key generation based on a hash algorithm provided for some embodiments of the present application;
[0033] Figure 4 One of the flow charts of the method for collaborative signature based on hash algorithm provided in some embodiments of the present application;
[0034] Figure 5 A flowchart of a method for collaborative key generation based on a hash algorithm provided in some embodiments of the present application;
[0035] Figure 6 A second flowchart of a method for collaborative signature based on a hash algorithm provided for some embodiments of the present application;
[0036] Figure 7 One of the block diagrams of the apparatus for collaborative key generation based on a hash algorithm provided in some embodiments of the present application;
[0037] Figure 8 The second block diagram of the apparatus for collaborative key generation based on a hash algorithm provided in some embodiments of the present application;
[0038] Fig. 9 A block diagram of a collaborative signature device based on a hash algorithm provided in some embodiments of the present application;
[0039] Fig.10 A schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION
[0040] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.
[0041] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0042] In the related technologies, mobile devices in the mobile Internet environment, such as smartphones, tablet computers and other terminal devices, have some security risks. For example, mobile devices are easy to be lost or stolen, which makes the keys contained inside easy to be lost or stolen; the operating system and third-party programs on the mobile device may have vulnerabilities, which can be easily exploited by attackers to implement cold start and other attacks, resulting in user key information leakage; mobile devices may contain malware, resulting in the data being intercepted by attackers when users execute digital signatures. Therefore, in the mobile Internet environment, it is necessary to use collaborative signature technology to protect the security of signature private keys.
[0043] At present, signature algorithms based on discrete logarithm problems and large integer decomposition problems, such as SM2 and RSA collaborative signature schemes, have been widely studied and applied. However, the development of quantum computers poses a serious threat to the security of public key cryptographic algorithms based on discrete logarithm problems and large integer decomposition problems, so collaborative signature schemes that can resist quantum computer attacks are needed. The technical routes based on public key cryptographic algorithms (anti-quantum cryptographic algorithms) that can resist quantum computer attacks currently include five main categories, namely lattice-based, coding-based, multivariable-based, homology-based, and hash-based algorithms. Among them, the security of cryptographic algorithms based on hash algorithms does not depend on specific mathematical difficulties or specific hash functions. They are algorithms with relatively mature technical routes, more conservative security, and more flexible in anti-quantum cryptography. Therefore, hash-based anti-quantum collaborative signature schemes have broad application prospects.
[0044] For example, the LM-OTS algorithm is a hash-based signature algorithm. RFC 8554 and NIST 800-208 have standardized the algorithm, and ISO and the National Cryptography Standards Committee are also following up on the standardization of the algorithm. However, LM-OTS is a one-time signature scheme based on hash, that is, the signature private key can only be used once, otherwise it may cause security problems. From the above related technologies, it can be seen that the current hash-based signature algorithm is limited in the number of times it can be used, and collaborative signature cannot be achieved.
[0045] In view of this, some embodiments of the present application provide a method for collaborative key generation and collaborative signature based on a hash algorithm, which can first generate collaborative keys of a client and a server based on a hash signature algorithm, and then collaboratively sign a message to be signed using the collaborative key to obtain a collaborative signature scheme. The collaborative signature based on a hash algorithm provided by some embodiments of the present application has high security and can be widely used in various scenarios.
[0046] The following is combined with Figure 1 The overall composition structure of a collaborative signature system based on a hash algorithm provided by some embodiments of the present application is exemplified.
[0047] like Figure 1 As shown, some embodiments of the present application provide a collaborative signature system based on a hash algorithm, and the collaborative signature system based on a hash algorithm may include: a client 100 and a server 200. The client 100 and the server 200 may first generate a client private key component, a server private key component, and a collaborative public key through an interactive method and a hash algorithm. After obtaining the collaborative key, the client 100 and the server 200 may perform calculations and data exchanges on the message to be signed to obtain the client collaborative signature component and the server collaborative signature component to complete the collaborative signature of the message to be signed.
[0048] In some embodiments of the present application, the client 100 may be a mobile terminal or a non-portable computer terminal, which is not specifically limited in the embodiments of the present application.
[0049] In order to facilitate the understanding and implementation of the specific process of the collaborative signature based on the hash algorithm of the present application, the key generation stage and the signature stage of the LM-OTS algorithm are first introduced in detail below.
[0050] In the following steps, H represents the hash function used by the algorithm; n is the number of output bytes of the hash function H; w is the Winternitz parameter, which can be 1, 2, 4, or 8; otstype represents a four-byte string whose value can be uniquely determined by H, n, and w.
[0051] Specifically, the key generation process of the LM-OTS algorithm includes:
[0052] (1) A 16-byte string I is randomly generated. The private key of the LM-OTS algorithm is sk = (otstype, I, q, x). Among them, q is 0, and x = (x[0], ..., x[p-1]) is the LM-OTS secret original image array, which is a bit string of length np bytes. The value of p can be uniquely determined by n and w. x[i] is a random bit of n bytes. In sk, (otstype, I, q) can be public, while x must be kept confidential. Among them, each x[i], (i = 0, ..., p-1) can be generated randomly and independently, or it can be generated using a pseudo-random function that meets sufficient security strength, which is not limited to the embodiments of the present application.
[0053] (2) Based on the private key sk = (otstype, I, q, x), K is calculated as follows:
[0054]
[0055] The above calculation method is a for loop; the brackets after for contain the results of initializing parameters i and j and the loop condition; u32str(q) represents the 32-bit representation of integer q, u16str(i) represents the 16-bit representation of integer i, and u8str(j) represents the 8-bit representation of integer j. The public key of the LM-OTS algorithm is finally calculated as pk=(otstype, I, q, K).
[0056] Specifically, the signature algorithm of the LM-OTS algorithm involves the verification algorithm Cksm. In the Cksm algorithm, for a string S of length n bytes, Cksm(S) is a 16-bit string, and its calculation method is as follows:
[0057] sum=0
[0058] for(i=0;i<8*n / w;i=i+1){
[0059] sum=sum+(2^w-1)-coef(S,i,w)
[0060] }
[0061] Cksm(S)=u16str(sum<<γ)
[0062] Among them, coef(S, i, w) represents the integer corresponding to the i-th w-bit string of the byte string S, sum<<γ means that sum is shifted to the left by γ bits, and γ is uniquely determined by n and w.
[0063] In the signature algorithm, the signer performs the following steps to calculate the signature of a message M of any length:
[0064] (1) Randomly generate a byte string C of length n, and calculate Q = H(I||u32str(q)||0x8181||C||M) based on M, I, q, C and hash function H;
[0065] (2) Based on Q and w, S = Q||Cksm(Q) is calculated based on the verification algorithm Cksm;
[0066] (3) Based on the following process, S calculates the signature lmots_sig of the message M:
[0067] (a) for (i = 0; i <p;i=i+1){
[0068] a=coef(S,i,w)
[0069] tmp=x[i]
[0070] for(j=0; j <a;j=j+1){
[0071] tmp=H(I||u32str(q)||u16str(i)||u8str(j)||tmp)
[0072] }
[0073] z[i]=tmp
[0074] }
[0075] (b)lmots_sig=otstype||C||z[0]||...||z[p-1]
[0076] In the verification algorithm, the verifier performs the following steps:
[0077] (1) Based on the message M and its signature lmots_sig, calculate Q'=H(I||u32str(q)||0x8181||C||M);
[0078] (2) Calculate S' = Q'||Cksm(Q');
[0079] (3) K' is calculated from S' based on the following process:
[0080] for(i=0;i <p;i=i+1){
[0081] a=coef(S',i,w)
[0082] tmp=z[i]
[0083] for(j=a;j<2^w-1,j+1){
[0084] tmp=H(I||u32str(q)||u16str(i)||u8str(j)||tmp)
[0085] }
[0086] z'[i]=tmp
[0087] }
[0088] K'=H(I||q||0x8080||z'[0]||...||z'[p-1])
[0089] 4) If K'=K, the verification succeeds; otherwise, the verification fails.
[0090] In order to facilitate the explanation of the specific implementation process of the present application, the collaborative key generation phase and the collaborative signature phase are explained in sequence below.
[0091] The following is combined with Figure 2 The implementation process of collaborative key generation based on a hash algorithm performed by the client 100 provided in some embodiments of the present application is exemplified.
[0092] Please see attached Figure 2 , Figure 2 A flowchart of a method for collaborative key generation based on a hash algorithm is provided for some embodiments of the present application. The method for collaborative key generation based on a hash algorithm may include:
[0093] S210, generating a client private key component.
[0094] For example, in some embodiments of the present application, in the collaborative key generation phase, the client 100 first needs to generate the corresponding client private key component sk c .
[0095] In some embodiments of the present application, S210 may include: randomly generating the first private key component and the first bit string of a preset byte length; determining the client private key component using the first private key component, the first bit string, specified parameters and an otstype parameter, wherein the otstype parameter is determined by the hash function, the preset byte length and the preset parameters.
[0096] For example, in some embodiments of the present application, the randomly generated length is byte (as a specific example of a preset byte length) (as a specific example of the first private key component) and the first bit string I, whose client private key component is sk c =(otstype, I, q, x c ). Wherein, q is a specified parameter, and its acquisition method can refer to the method in the above LM-OTS algorithm.
[0097] S220: Obtain a first public key component based on a first private key component and selected parameters in the client private key component.
[0098] For example, in some embodiments of the present application, using x c and other selected parameters (as a specific example of selected parameters), according to the calculation process (a) of step (2) of the above LM-OTS key generation algorithm, the client 100 calculates the length of Byte bit string (As a specific example of the first public key component).
[0099] S230: Obtain a client public key component through the first public key component.
[0100] For example, in some embodiments of the present application, by c , get the client public key component pk c =(otstype, I, q, y c ).
[0101] S240, sending parameter data to the server, wherein the parameter data includes: the first public key component, a hash function, a first bit string and preset parameters, so that the server generates a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component.
[0102] For example, in some embodiments of the present application, the client 100 converts the hash function H, the preset parameter w, the first bit string I and the first public key component y into cThe server 200 can generate a corresponding server private key component and a server public key component based on these parameters.
[0103] In some embodiments of the present application, the collaborative public key may be generated by the client 100 or by the server 200, and the present application does not make any specific limitation thereto. The two situations are respectively described below.
[0104] S250: Receive the second public key component sent by the server.
[0105] For example, in some embodiments of the present application, the client 100 may receive the y sent by the server 200. s (As a specific example of the second public key component).
[0106] S260: Generate a collaborative public key based on the first public key component and the second public key component.
[0107] In some embodiments of the present application, S260 may include: using a key generation algorithm to calculate the first public key component, the second public key component, the first bit string and a specified parameter to obtain the collaborative public key.
[0108] For example, in some embodiments of the present application, the client 100 is based on I, q, y c and s , the calculation process of step (2) in the above LM-OTS key generation algorithm can be used to perform the calculation: K = H (I | | u32str (q) | | 0x8080 | | y) = H (I | | u32str (q) | | 0x8080 | | y c ||y s ), thereby obtaining the LM-OTS collaborative public key pk, that is, pk = (otstype, I, q, K).
[0109] In some embodiments of the present application, the collaborative public key is generated by the server based on the first public key component and the second public key component.
[0110] It should be noted that the server 200 can also obtain the collaborative public key pk according to the calculation process of step (2) in the LM-OTS key generation algorithm.
[0111] The following is combined with Figure 3 The implementation process of collaborative key generation based on a hash algorithm performed by the server 200 provided in some embodiments of the present application is exemplified.
[0112] Please see attached Figure 3 , Figure 3A flowchart of a method for collaborative key generation based on a hash algorithm is provided for some embodiments of the present application. The method for collaborative key generation based on a hash algorithm may include:
[0113] S310, receiving parameter data sent by a client, wherein the parameter data includes: a first public key component in a private key component of the client, a hash function, a first bit string, and a preset parameter.
[0114] For example, in some embodiments of the present application, the server 200 may receive the hash function H, the preset parameter w, the first bit string I and the first public key component y sent by the client 100. c .
[0115] S320, obtaining a server private key component through the parameter data.
[0116] For example, in some embodiments of the present application, the server 200 can obtain the output length n of H from the hash algorithm H, and obtain the corresponding specified parameter p in combination with the preset parameter w. Then, the server private key component sk is obtained by performing corresponding calculations. s .
[0117] In some embodiments of the present application, S320 may include: randomly generating the second private key component of a preset byte length, wherein the preset byte length is obtained through the hash function; determining the otstype parameter using the hash function, the preset byte length and the preset parameters; determining the server private key component using the second private key component, the first bit string and the otstype parameter.
[0118] For example, in some embodiments of the present application, the randomly generated length is Byte bit string (As a specific example of the second private key component). Determine the unique otstype parameter through H, n and w. Then we can get sk s =(otstype, I, q, x s ).
[0119] S330: Obtain a second public key component based on the second private key component in the server private key component and the selected parameter.
[0120] For example, in some embodiments of the present application, using x s and other known selected parameters, according to the calculation process of step (2) in the LM-OTS key generation algorithm, the length is calculated to be Byte bit string (As a specific example of the second public key component).
[0121] S340: Obtain a server public key component through the second public key component, the first bit string and other parameters.
[0122] For example, in some embodiments of the present application, by s , get the server public key component pk s =(otstype, I, q, y s ).
[0123] S350: Send the second public key component to the client, so that the server and the client generate a collaborative public key based on the first public key component and the second public key component.
[0124] Alternatively, in some other embodiments, the server 200 may calculate the first public key component and the second public key component to obtain the collaborative public key.
[0125] For example, in some embodiments of the present application, the server 200 sends y to the client 100. s , so that the client 100 can calculate the collaborative public key pk. Similarly, the server 200 can directly c and s Calculate and obtain the collaborative public key pk. The present application embodiment is not specifically limited here.
[0126] It can be seen from the above embodiments that the present application realizes the splitting of the LM-OTS algorithm private key by splitting the LM-OTS secret pre-image array, and realizes the calculation of the public key of the collaborative signature scheme by exchanging the LM-OTS public key components of the client 100 and the server 200. In the collaborative key generation stage, the client 100 and the server 200 can perform a variety of different splitting methods on the LM-OTS secret pre-image array.
[0127] For example, in addition to the splitting methods provided in the above embodiments, the following methods may also be included:
[0128] For example, x c =(x[0],x[2],x[4],...,x[p-2] / x[p-1])(p is an even number / odd number),
[0129] x s =(x[1],x[3],x[5],...,x[p-1] / x[p-2])(p is even / odd); or,
[0130]
[0131] In practical applications, the splitting method of the LM-OTS secret pre-image array can be selected according to actual conditions, and the embodiments of the present application are not specifically limited here.
[0132] After completing the collaborative key generation phase of LM-OTS, the collaborative signing phase can be entered. In this phase, the client 100 and the server 200 respectively generate their own private key components sk c and sk s Combined with other parameters to calculate the collaborative signature component z c and z s , and the final signature result is formed through message passing between the two parties.
[0133] The following is combined with Figure 4 The specific process of collaborative signature based on hash algorithm performed by the client 100 provided in some embodiments of the present application is exemplified.
[0134] Please see attached Figure 4 , Figure 4 A flowchart of a method for collaborative signature based on a hash algorithm is provided for some embodiments of the present application. The method for collaborative signature based on a hash algorithm may include:
[0135] S410, sending signature parameters generated based on the message to be signed to the server, so that the server obtains the server collaborative signature component through the signature parameters, the second private key component in the server private key component and preset parameters.
[0136] For example, in some embodiments of the present application, the client 100 can obtain the signature parameter S according to the signature steps (1-2) of the LM-OTS signature algorithm provided above for the signature message M, and send it to the server 200. The server 200 uses the calculation process of step (3) of the LM-OTS signature algorithm in the above signature phase to calculate S, x in the server private key component, and s And the preset parameter w is calculated to obtain the server-side collaborative signature component z s , And send it to the client 100.
[0137] S420: Receive the server collaborative signature component sent by the server.
[0138] For example, in some embodiments of the present application, the client 100 receives the server-side collaborative signature component z sent by the server 200. s .
[0139] S430: Obtain the client collaborative signature component through the signature parameter, the first private key component in the client private key component and the preset parameter.
[0140] For example, in some embodiments of the present application, the client 100 may perform the following operations on S, x in the client private key component: sAnd w are calculated to obtain the client collaborative signature component z c .
[0141] In some embodiments of the present application, S430 may include: using a one-time signature algorithm to calculate the signature parameter, the first private key component and the preset parameter to obtain the client collaborative signature component.
[0142] For example, in some embodiments of the present application, the client 100 uses the calculation process of step (3) of the LM-OTS signature algorithm (as a specific example of a one-time signature algorithm) in the above-mentioned signature phase to calculate S, x s And w are calculated to obtain the client collaborative signature component z c ,
[0143] S440: Sign the message to be signed using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
[0144] For example, in some embodiments of the present application, the client 100 cooperates with the server to sign component z s Collaborate with the client to sign component z c , sign M and get the signature result: lmots_sig = otstype||C||z[0]||...||z[p-1]. This method can realize the LM-OTS collaborative signature scheme.
[0145] In some other embodiments of the present application, the method of collaborative signature based on a hash algorithm may also include: sending the client collaborative signature component to the server, so that the server uses the server collaborative signature component and the client collaborative signature component to sign the message to be signed to obtain a signature result.
[0146] For example, in some embodiments of the present application, in the collaborative signing stage, the client 100 and the server 200 mainly use their own collaborative signature private key component sk c and sk s Combined with other parameters, the collaborative signature component z is calculated c and z s The final signature result is formed through the message transmission between the two parties. Based on this core operation, there can be many specific collaborative signature protocol processes. For example: the client 100 first executes steps (1-2) of the LM-OTS signature algorithm to obtain S, and then S, w and sk c , z is calculated according to the calculation process of step (3) of the LM-OTS signature algorithm c , then (S,z c) is sent to the server 200; the server receives the data according to S, w and the server private key component sk s Calculate z s , and according to the z sent by client 100 c Synthesize the final signature result lmots_sig.
[0147] It should be noted that which end generates the signature result can be flexibly selected according to the actual application scenario, and this application does not make specific restrictions here. Moreover, the collaborative key generation and collaborative signature embodiments of LM-OTS provided above in this application can be applied to multi-party collaborative signatures, and this application does not limit the number of clients and servers.
[0148] The following is combined with Figure 5 The specific process of collaborative key generation based on a hash algorithm interactively performed by the client 100 and the server 200 provided in some embodiments of the present application is exemplified.
[0149] Please see attached Figure 5 , Figure 5 A flow chart of a method for collaborative key generation based on a hash algorithm is provided for some embodiments of the present application.
[0150] The above implementation process is described below by way of example.
[0151] S510, the client 100 randomly generates the x c And the first bit string I.
[0152] S520, the client 100 uses x c , I, q and otstype parameters, determine the client private key component sk c .
[0153] S530, client 100 is based on sk c x in c and selected parameters, get y c ; through y c , get the client public key component pk c .
[0154] S540, the client 100 sends y to the server 200 c , H, I and w.
[0155] S550, the server 200 randomly generates a value x of a preset byte length s ; Using x s , I and otstype parameters to determine the server private key component sk s .
[0156] S560, based on xs and selected parameters, get y s ; through y s , I and other parameters to obtain the server public key component pk s .
[0157] S570, the server 200 sends y to the client 100 s .
[0158] S580, client 100 based on y c and s , generate collaborative public key pk.
[0159] In another implementation, the generation of the collaborative public key pk may also be completed by the server 200. It should be noted that the specific implementation process of S510 to S580 may refer to the method embodiment provided above, and the detailed description is appropriately omitted here to avoid repetition.
[0160] The following is combined with Figure 6 The specific process of collaborative signature based on hash algorithm interactively performed by the client 100 and the server 200 provided in some embodiments of the present application is exemplified.
[0161] Please see attached Figure 6 , Figure 6 A flow chart of a method for collaborative signing based on a hash algorithm is provided for some embodiments of the present application.
[0162] The above implementation process is described below by way of example.
[0163] S610, the client 100 obtains a signature parameter S based on the message M to be signed.
[0164] S620, the client 100 sends a signature parameter S to the server 200.
[0165] S630, server 200 through S, x s and w, determine the server-side collaborative signature component z s .
[0166] S640, the server 200 sends z to the client 100 s .
[0167] S650, client 100 passes S, x c and w, determine the server-side collaborative signature component z c .
[0168] S660, the client 100 uses z s and z c Sign the signature message M and get the signature result.
[0169] In another embodiment, the acquisition of the signature result may also be completed by the server 200. That is, the client may first obtain z c , and sent to the server 200, the server 200 calculates z s Then, combine z c , sign M, and obtain the signature result. It should be noted that the specific implementation process of S610 to S660 can refer to the method embodiment provided above, and in order to avoid repetition, the detailed description is appropriately omitted here.
[0170] Through some of the embodiments of the present application described above, it can be seen that the present application implements the LM-OTS collaborative signature scheme, including collaborative key generation and collaborative signature. The construction of this scheme does not change the structure of the LM-OTS algorithm. The private key-related messages transmitted between the client and the server are the results of multiple hash iterations of the private key. The one-way nature of the hash function ensures that it will not destroy the security of the private key; the LM-OTS collaborative signature scheme reduces the algorithm security threats caused by client key security issues.
[0171] Please refer to Figure 7 , Figure 7 The block diagram of the composition of the apparatus for collaborative key generation based on a hash algorithm provided by some embodiments of the present application is shown. It should be understood that the apparatus for collaborative key generation based on a hash algorithm corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the apparatus for collaborative key generation based on a hash algorithm can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.
[0172] Figure 7 The device for collaborative key generation based on a hash algorithm includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for collaborative key generation based on a hash algorithm. The device for collaborative key generation based on a hash algorithm includes: a private key generation module 710, configured to generate a client private key component; an acquisition module 720, configured to acquire a first public key component based on the first private key component and selected parameters in the client private key component; a public key generation module 730, configured to acquire a client public key component through the first public key component; a sending module 740, configured to send parameter data to a server, wherein the parameter data includes: the first public key component, a hash function, a first bit string and preset parameters, so that the server generates a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component; the first public key component and the second public key component are used to generate a collaborative public key.
[0173] Please refer to Figure 8 , Figure 8 The block diagram of the composition of the apparatus for collaborative key generation based on a hash algorithm provided by some embodiments of the present application is shown. It should be understood that the apparatus for collaborative key generation based on a hash algorithm corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the apparatus for collaborative key generation based on a hash algorithm can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.
[0174] Figure 8 The device for collaborative key generation based on a hash algorithm includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for collaborative key generation based on a hash algorithm. The device for collaborative key generation based on a hash algorithm includes: a data receiving module 810, configured to receive parameter data sent by a client, wherein the parameter data includes: a first public key component in a client private key component, a hash function, a first bit string and preset parameters; a data acquisition module 820, configured to obtain a server private key component through the parameter data; a component acquisition module 830, configured to obtain a second public key component based on a second private key component in the server private key component and selected parameters; a public key acquisition module 840, configured to obtain a server public key component through the second public key component, the first bit string and other parameters; wherein the first public key component and the second public key component are used to generate a collaborative public key.
[0175] Please refer to Fig. 9 , Fig. 9 The block diagram of the composition of the device for collaborative signature based on the hash algorithm provided by some embodiments of the present application is shown. It should be understood that the device for collaborative signature based on the hash algorithm corresponds to the above method embodiment and can execute each step involved in the above method embodiment. The specific functions of the device for collaborative signature based on the hash algorithm can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.
[0176] Fig. 9The collaborative signature device based on the hash algorithm includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the collaborative signature device based on the hash algorithm. The collaborative signature device based on the hash algorithm includes: a parameter sending module 910, configured to send signature parameters generated based on the message to be signed to the server, so that the server obtains the server collaborative signature component through the signature parameters, the second private key component in the server private key component and the preset parameters; a component receiving module 920, configured to receive the server collaborative signature component sent by the server; an acquisition module 930, configured to obtain the client collaborative signature component through the signature parameters, the first private key component in the client private key component and the preset parameters; a signature module 940, configured to sign the message to be signed using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0178] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the operations of the method corresponding to any of the above methods provided in the above embodiments.
[0179] Some embodiments of the present application further provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations corresponding to any of the above methods provided in the above embodiments.
[0180] like Fig.10 As shown, some embodiments of the present application provide an electronic device 1000, which includes: a memory 1010, a processor 1020, and a computer program stored in the memory 1010 and executable on the processor 1020, wherein the processor 1020 can implement a method as described in any of the above embodiments when reading the program from the memory 1010 through a bus 1030 and executing the program.
[0181] Processor 1020 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 1020 can be a microprocessor.
[0182] The memory 1010 may be used to store instructions executed by the processor 1020 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 1020 of the disclosed embodiment may be used to execute instructions in the memory 1010 to implement the method shown above. The memory 1010 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.
[0183] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0184] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0185] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for collaborative key generation based on a hash algorithm, characterized in that: include: Generate client private key component; Obtaining a first public key component based on a first private key component and a selected parameter in the client private key component; Obtaining a client public key component through the first public key component; Send parameter data to the server, wherein the parameter data includes: the first public key component, a hash function, a first bit string and preset parameters, so that the server generates a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component; the first public key component and the second public key component are used to generate a collaborative public key.
2. The method according to claim 1, characterized in that The generating of the client private key component comprises: Randomly generate the first private key component and the first bit string of a preset byte length; The client private key component is determined using the first private key component, the first bit string, a specified parameter and an otstype parameter, wherein the otstype parameter is determined by the hash function, the preset byte length and the preset parameter.
3. The method according to claim 1 or 2, characterized in that After sending the parameter data to the server, the method further includes: Receiving the second public key component sent by the server; The first public key component, the second public key component, the first bit string and a specified parameter are calculated using a key generation algorithm to obtain the collaborative public key.
4. The method according to claim 1 or 2, characterized in that: The collaborative public key is generated by the server based on the first public key component and the second public key component.
5. A method for collaborative key generation based on a hash algorithm, characterized in that: include: Receiving parameter data sent by the client, wherein the parameter data includes: a first public key component in a private key component of the client, a hash function, a first bit string, and a preset parameter; Obtain the server private key component through the parameter data; Based on the second private key component and the selected parameter in the server private key component, obtaining a second public key component; The server public key component is obtained through the second public key component, the first bit string and other parameters; wherein the first public key component and the second public key component are used to generate a collaborative public key.
6. The method according to claim 5, characterized in that The obtaining of the server private key component through the parameter data includes: Randomly generating the second private key component of a preset byte length, wherein the preset byte length is obtained by the output length of the hash function and the preset parameter; Determine an otstype parameter using the hash function, the preset byte length and the preset parameters; The server private key component is determined using the second private key component, the first bit string and the otstype parameter.
7. The method according to claim 5 or 6, characterized in that After obtaining the server public key component, the method further includes: Calculating the first public key component and the second public key component to obtain the collaborative public key; Alternatively, the second public key component is sent to the client, so that the client generates the collaborative public key based on the first public key component and the second public key component.
8. A collaborative signature method based on a hash algorithm, characterized in that: include: Sending a signature parameter generated based on the message to be signed to the server, so that the server can obtain the server collaborative signature component through the signature parameter, the second private key component in the server private key component and the preset parameter; Receiving the server collaborative signature component sent by the server; Obtaining the client collaborative signature component through the signature parameter, the first private key component in the client private key component and the preset parameter; The message to be signed is signed using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
9. The method according to claim 8, characterized in that The acquiring the client collaborative signature component by using the signature parameter, the first private key component in the client private key component and the preset parameter includes: The signature parameter, the first private key component and the preset parameter are calculated using a one-time signature algorithm to obtain the client collaborative signature component.
10. The method according to claim 8 or 9, characterized in that The method further comprises: The client collaborative signature component is sent to the server, so that the server signs the message to be signed by using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
11. A device for collaborative key generation based on a hash algorithm, characterized in that: The device is used to perform the method according to claim 1, and the device comprises: A private key generation module configured to generate a client private key component; An acquisition module, configured to acquire a first public key component based on a first private key component and a selected parameter in the client private key component; A public key generation module, configured to obtain a client public key component through the first public key component; A sending module is configured to send parameter data to a server, wherein the parameter data includes: the first public key component, a hash function, a first bit string and preset parameters, so that the server generates a server private key component and a server public key component according to the parameter data, wherein the server public key component contains a second public key component; the first public key component and the second public key component are used to generate a collaborative public key.
12. A device for collaborative key generation based on a hash algorithm, characterized in that: The device is used to perform the method according to claim 5, and the device comprises: A data receiving module is configured to receive parameter data sent by a client, wherein the parameter data includes: a first public key component in a private key component of the client, a hash function, a first bit string, and a preset parameter; A data acquisition module is configured to acquire a server private key component through the parameter data; A component acquisition module, configured to acquire a second public key component based on a second private key component and a selected parameter in the server private key component; The public key acquisition module is configured to acquire the server public key component through the second public key component, the first bit string and other parameters; wherein the first public key component and the second public key component are used to generate a collaborative public key.
13. A collaborative signature device based on a hash algorithm, characterized in that: The device is used to perform the method according to claim 8, and the device comprises: A parameter sending module is configured to send a signature parameter generated based on the message to be signed to the server, so that the server obtains the server collaborative signature component through the signature parameter, the second private key component in the server private key component and the preset parameter; A component receiving module, configured to receive the server-side collaborative signature component sent by the server; An acquisition module is configured to acquire the client collaborative signature component through the signature parameter, the first private key component in the client private key component and the preset parameter; The signature module is configured to sign the message to be signed using the server collaborative signature component and the client collaborative signature component to obtain a signature result.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program executes the method according to any one of claims 1 to 10 when executed by a processor.
15. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program executes the method according to any one of claims 1 to 10 when being run by the processor.
16. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program executes the method according to any one of claims 1 to 10 when executed by a processor.
Citation Information
Cited By
Anti-quantum collaborative signature method and anti-quantum collaborative signature system
CN120710685A
Anti-quantum cooperative signature method and anti-quantum cooperative signature system
CN120710685B
Two-party collaborative signature method and device, equipment and storage medium
CN120811619A
Anti-quantum collaborative signature method based on hash function
CN121530584A
