WO2023198036A1 - 一种密钥生成方法、装置及设备 - Google Patents

一种密钥生成方法、装置及设备 Download PDF

Info

Publication number
WO2023198036A1
WO2023198036A1 PCT/CN2023/087554 CN2023087554W WO2023198036A1 WO 2023198036 A1 WO2023198036 A1 WO 2023198036A1 CN 2023087554 W CN2023087554 W CN 2023087554W WO 2023198036 A1 WO2023198036 A1 WO 2023198036A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
plaintext
parameter
fragments
private key
Prior art date
Application number
PCT/CN2023/087554
Other languages
English (en)
French (fr)
Inventor
彭琨
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210761513.9A external-priority patent/CN116938468A/zh
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023198036A1 publication Critical patent/WO2023198036A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords

Definitions

  • the present application relates to the field of communication technology, and in particular, to a key generation method, device and equipment.
  • the RSA algorithm is a classic key algorithm that can be used to generate a key pair (the key pair includes a public key and a private key) required for data encryption, decryption or signature.
  • Threshold ciphers indicate a distributed use of key algorithms. Taking the threshold password based on the RSA algorithm as an example, when the k (k-out-of-t) threshold is selected from t used in the threshold password, the private key generated by the RSA algorithm can be decomposed into t private key fragments, and the t Private key shards can be held by t holders respectively. The private key can be recovered from any k private key fragments.
  • any private key fragment always carries some information about the private key, when obtaining some private key fragments, the parameters required for private key generation can be deduced, which makes it possible to retain the private key.
  • This application provides a key generation method, device and equipment to ensure the security of the key in the threshold password.
  • embodiments of this application provide a password generation method, which can be executed in the following two ways:
  • the first key can be decomposed into t key fragments according to the parameter G, where the parameter G is a public parameter; t is a positive integer, and t keys Some or all of the key shards are used to decrypt the ciphertext or sign the data.
  • the key distribution device can distribute the t key fragments to t holders, where one holder holds one key fragment.
  • Any holder among t holders can decompose a key fragment from the first key according to the parameter G, where the parameter G is a public parameter; t is a positive integer, and the t key fragments are respectively represented by Held by t holders, the first key is generated based on the RSA algorithm. In this way, each holder can obtain a key shard by itself.
  • the public parameter G is used when generating the key distribution. In this way, the information of the first key carried in the key fragments becomes less, and through multiple Key fragmentation makes it more difficult to calculate the first key, which can effectively ensure the security of the first key.
  • any key shard satisfy:
  • a 0 first key d
  • a 1 , a 2 ,...a k-1 are random integers in Z m
  • Z m is a set of integers not less than 0 and less than m, different The selected x is different
  • i is a positive integer not less than t.
  • k is a positive integer less than t.
  • the parameter G is used in the generation process of key fragments, and the parameters related to the first key are no longer used, and the key fragment generation method is simpler.
  • a large prime number is a prime number with a larger exponent than the threshold.
  • the threshold can be 10 to the 11th power or greater.
  • the second key is the product of two large prime numbers.
  • the product of large prime numbers is difficult to decompose, that is, two large prime numbers cannot be parsed through the second key, so p ⁇ and q ⁇ cannot be determined. This ensures the security of the first key.
  • parameter G is equal to n.
  • the parameter G is the product of two large prime numbers in the second key, which can further simplify the generation method of key fragmentation.
  • t holders hold t key shards, and some or all of the t key shards are used to decrypt ciphertext or sign data.
  • the method of decrypting the key and signing the data is similar. The difference is that the data used by the key fragments is different.
  • Some or all of the t holders use the key fragments they hold to partially decrypt the ciphertext X and obtain multiple partial decryption results, where , a holder uses a key shard he holds to partially decrypt key X to obtain a partial decryption result. Afterwards, the plaintext is obtained based on multiple partial decryption results and parameter G.
  • any key shard The partial decryption result obtained by the holder of satisfy:
  • the candidate plaintext s - when obtaining the plaintext based on multiple partial decryption results and the parameter G, the candidate plaintext s - can first be obtained based on the multiple partial decryption results, s - satisfies:
  • S is a subset of the set I.
  • S includes k elements.
  • the candidate plaintext s - is the plaintext. If the e-th power of the candidate plaintext s - and the modulo n of The condition indicates that the secondary candidate plaintext is raised to the power e, and X is congruent modulo n.
  • the candidate plaintext due to the parameter G used when generating key fragments, it is possible for the candidate plaintext to be the correct plaintext. There is an error with G as the granularity, so multiple partial decryption results and parameters G can be used to obtain the plaintext to ensure that the correct plaintext can be obtained in the end.
  • embodiments of the present application also provide a key distribution device, which has a method for generating a key in the method example of the first aspect.
  • Functions can be implemented by hardware, or by hardware executing corresponding software.
  • Hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the device includes a generation module and a distribution module. These modules can perform the corresponding functions in the above method examples of the first aspect.
  • the structure of the device includes t key generation modules. The key generation module can be deployed in a holder.
  • the key generation module in any holder is used to generate the key from the tth key generation module according to the parameter G. Decompose a key into the required key fragments.
  • These modules can perform the corresponding functions in the above method examples of the first aspect. For details, please refer to the detailed description in the method examples, which will not be described again here.
  • embodiments of the present application also provide a decryption device, which has the ability to use part or all of the t key fragments to decrypt the ciphertext or sign the data in the method example of the first aspect.
  • Functions can be implemented by hardware, or by hardware executing corresponding software.
  • Hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the device includes a plaintext acquisition module and multiple decryption modules, and one decryption module can be deployed in a holder. These modules can perform the corresponding functions in the above method examples of the first aspect.
  • beneficial effects please refer to the relevant description of the first aspect, which will not be described again here.
  • the present application also provides a computing device.
  • the computing device includes a processor and a memory, and may also include a communication interface.
  • the processor executes program instructions in the memory to perform the above first aspect or the first aspect. Methods provided for any possible implementation.
  • the memory is coupled to the processor and stores necessary program instructions and data during key generation, decryption of ciphertext, or signature of data.
  • the communication interface is used to communicate with other devices, such as sending key fragments, sending partial decryption results, etc.
  • the present application provides a computing device system, which includes at least one computing device. Every computing device includes memory and a processor. The processor of at least one computing device is configured to access the code in the memory to execute the method provided by the first aspect or any possible implementation of the first aspect.
  • the present application provides a non-transitory readable storage medium.
  • the computing device executes the aforementioned first aspect or any of the first aspects. Methods provided in Possible Implementations.
  • the storage medium stores the program.
  • the storage medium includes but is not limited to volatile memory, such as random access memory, and non-volatile memory, such as flash memory, hard disk drive (HDD), and solid state drive (SSD).
  • the present application provides a computing device program product.
  • the computing device program product includes computer instructions. When executed by the computing device, the computing device executes the foregoing first aspect or any possible implementation of the first aspect. methods provided in the method.
  • the computer program product can be a software installation package. If it is necessary to use the method provided in the first aspect or any possible implementation of the first aspect, the computer program product can be downloaded and executed on a computing device. Program Products.
  • Figure 1 is a schematic diagram of the distribution of private key shards
  • Figure 2A is a schematic architectural diagram of a system provided by this application.
  • Figure 2B is a schematic architectural diagram of a system provided by this application.
  • FIG. 3 is a schematic diagram of a key generation method provided by this application.
  • Figure 4 is a schematic diagram of a decryption method provided by this application.
  • Figure 5 is a schematic diagram of a search process provided by this application.
  • Figure 6 is a schematic diagram of private key sharding held by multiple parties in a cloud computing platform provided by this application;
  • Figure 7A is a schematic diagram of a CA issuing a certificate
  • FIG. 7B is a schematic structural diagram of a CA system provided by this application.
  • Figure 8 is a schematic structural diagram of a key distribution device provided by this application.
  • Figure 9 is a schematic structural diagram of a decryption device provided by this application.
  • 10 to 11 are schematic structural diagrams of a computing device provided by this application.
  • the RSA algorithm is a relatively common key algorithm, and the RAS algorithm is suitable for public key cryptography systems.
  • the encryption key i.e., the public key, abbreviated as the public key
  • the decryption key i.e., the secret key, abbreviated as the private key
  • Both encryption and decryption algorithms are public.
  • the principle of the RSA algorithm is that in number theory "it is extremely difficult to factorize the product of a large prime number (a large prime number refers to a very large prime number)".
  • threshold cipher indicates a distributed use of cryptographic algorithms. Threshold cryptography no longer relies on a single private key holder, which means that the private key is no longer maintained by a single subject. Instead, the private key is fragmented (the private key is divided into multiple private key fragments), which is dispersed To multiple subjects, these multiple subjects jointly maintain the private key and jointly decrypt the ciphertext or sign the data. Each subject maintains a private key shard. Such a subject can be called a private key. The holder of the shard. In this way, even if the private key fragment of one of the private key fragment holders is leaked, the entire private key will not be leaked, thereby further improving the security of the private key.
  • Threshold passwords are more suitable for distributed scenarios. For example, data encryption and decryption in the cloud, or data signature and signature verification. Another example is data encryption and decryption, or data signature and signature verification in distributed systems.
  • the most commonly used threshold password is to select k (k-out-of-t) threshold in t.
  • the k-out-of-t threshold refers to dividing a private key into t private key fragments.
  • the t private keys The shards are shared by t holders, and one holder holds one of the private key shards.
  • the private key can be recovered by obtaining any k private key fragments among the t private key fragments. If there are less than k private key fragments, the private key cannot be recovered.
  • the public key can be used to encrypt plain text s (plain text refers to unencrypted information), and can also be used to verify signature information s.
  • the public key is used as follows:
  • X represents the ciphertext obtained after encrypting the plaintext s or the signature information obtained after signing the data s.
  • the private key d is an integer, that is, the private key d belongs to the integer set Z, and the private key d satisfies:
  • the public key is public
  • t in the threshold password is a public value, which means that it is easy to know e and t.
  • the private key d is a value related to m. If m is cracked, it can be easily calculated from m. Private key d.
  • Private key d can be decomposed into t private key fragments through threshold cipher. Any private key fragment di satisfies:
  • a 0 d
  • a 1 , a 2 , ... a k-1 are random integers in Z m
  • Z m is a set of integers composed of integers not less than 0 and less than m
  • x can be equal to i, It also doesn't have to be equal to i.
  • Private key d can be recovered from k private key fragments.
  • the recovery method is as follows:
  • S is a subset of the set I.
  • S includes k elements.
  • FIG. 1 it is a schematic diagram of the distribution of private key fragments in a threshold cipher based on the RSA algorithm.
  • the key distributor can distribute private key fragments to t holders (the t holders are P 1 , P 2 ,...P t respectively) (the t private key distributions are d 1 , d respectively) 2 ,... dt ). Any k private key fragments can recover private key d.
  • v is a random number randomly selected from the set Q, and Q is cyclic subgroup of squares in ), is the set of integers that are relatively prime to n among the integers not less than 0 and not less than n-1.
  • the public investment parameter vi and the public parameter v are public information, that is to say, the holder P i of each private key shard di can know the public parameter v and t public investment parameters vi , and the t One of the public investment parameters vi is related to a private key shard.
  • any k private key fragments among t private key fragments can recover the private key d, and the recovered private key d can be used to decrypt ciphertext or sign data.
  • the private key d has been exposed and is not secure.
  • some or all of the t private key fragments di can be used to decrypt the ciphertext or sign the data.
  • the principle of using the t private key fragments to decrypt ciphertext is similar to the principle of using the t private key fragments to sign data.
  • the difference between ciphertext decryption and signature is that the information used by each private key fragment is different.
  • each private key fragment needs to act on the ciphertext, and when using the t private key fragments to perform signature verification on the data, each private key fragment needs to act on Data that needs to be signed.
  • private key fragment d i is related to m, and each private key fragment d i It will carry part of m's information.
  • the value range of m can be determined by sharding the private key d i .
  • m should be a value greater than d i .
  • this application provides a key generation method, in which a key that needs to be kept secret can be divided into multiple key fragments. Different from the private key fragments mentioned in the previous description, which are generated with the help of a relatively private parameter m, these multiple key fragments are generated using the public parameters G. Decryption of ciphertext or signature of data can be achieved by utilizing some or all of the plurality of key fragments.
  • the keys that need to be kept secret refer to keys that cannot be shared and whose exposure will cause security problems.
  • the private key is the key that needs to be kept secret.
  • the root key is used to generate different types of keys or some keys that need to be kept secret.
  • the key that needs to be kept secret is a private key as an example for explanation.
  • the public key generation method in the aforementioned RSA algorithm is still retained, and the private key is fragmented into t private key fragments, where , any private key fragment is generated using the public parameters G.
  • K holders among the t holders can use the private key fragments they hold to decrypt the ciphertext or sign the data.
  • the ciphertext is generated by encrypting the plaintext using the public key. After signing, Obtaining signature information can be verified using the public key.
  • FIG. 2A it is a schematic structural diagram of a system provided by an embodiment of the present application.
  • the system includes multiple holders 200 of multiple private key shards, wherein one holder 200 has one private key shard. usage rights, that is, a holder 200 holds a private key shard.
  • the system also includes a key distribution device 100.
  • the key distribution device 100 has a key generation function.
  • the key distribution device 100 can execute the key generation method provided in the embodiment of the present application and generate multiple private key fragments using public parameters.
  • the key distribution device 100 has a key distribution function. After the key distribution device 100 generates a public key, it can publish the public key. After generating multiple private key fragments, the key distribution device 100 can distribute the multiple private key fragments to multiple holders 200 , where one holder 200 obtains one private key fragment.
  • the embodiment of the present application does not limit the specific type and deployment method of the key distribution device 100.
  • the key distribution device 100 may be presented in the form of software or may be implemented in hardware.
  • the key distribution device 100 may be an application program or a code block running on the computing device.
  • the computing device may be at least one of a physical host, a virtual machine, a container, and other computing devices. Further, the above computing device may be one or more. That is to say, the key distribution device 100 can be deployed centrally on one computing device or distributed on multiple computing devices.
  • the key distribution device 100 may include at least one computing device, such as a server.
  • the key distribution device 100 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • the multiple holders 200 hold their own private key shards, and some or all of the multiple holders 200 can cooperate with each other to decrypt the ciphertext or complete the signature of the data.
  • the holder 200 here is not limited to "people".
  • the holder 200 can be understood as a device that can use private key sharding or an organization that has permission to use private key sharding. In some scenarios The holder 200 can be understood as all the computing devices of the user, or as a cluster composed of multiple computing devices.
  • some or all of the multiple holders 200 use the private key fragments they hold to partially decrypt the key and generate a partial decryption result.
  • a holder 200 can obtain a partial decryption result by sharding the private key he holds.
  • the plaintext corresponding to the ciphertext is obtained based on the multiple partial decryption results.
  • the process of obtaining the plaintext based on the multiple partial decryption results is a search process with parameter G as the granularity based on the multiple partial decryption results.
  • the performer who obtains the plaintext based on the multiple partial decryption results may be any one of the multiple holders 200 , or may be a device other than the multiple holders 200 , for example, by the multiple holders 200 200 A mutually trusted or jointly authorized party performs the process.
  • the application of ciphertext decryption is suitable for scenarios that require the cooperation of multiple holders 200 to obtain plaintext.
  • the multiple parties here can be understood as multiple holders 200, and the multiple holders 200 need to cooperate with each other to process certain data (the data can be understood as plaintext s in subsequent embodiments) Calculation.
  • the data Before performing calculations on the data, the data needs to be obtained first.
  • the data (the data can be understood as the ciphertext Decrypt to obtain a partial decryption result (the partial decryption result can be understood as the ), and finally obtain the data based on multiple partial decryption results from the multiple holders 200.
  • the data can be understood as the ciphertext Decrypt to obtain a partial decryption result (the partial decryption result can be understood as the )
  • the multiple parties here can be understood as multiple holders 200.
  • the multiple holders 200 all have access rights to a certain resource.
  • the multiple holders 200 The holders 200 need to cooperate with each other to obtain access credentials (such as access passwords (tokens)) for the resource.
  • the holders 200 can only pass after obtaining the access credentials (this data can be understood as plain text s in subsequent embodiments).
  • This access credential accesses the resource.
  • the access credential is encrypted by the public key, so the encrypted access credential needs to be decrypted (the encrypted access credential can be understood as plaintext X in subsequent embodiments).
  • the private key fragments held by each of the multiple holders 200 partially decrypt the encrypted access voucher to obtain a partial decryption result (the partial decryption result can be understood as in subsequent embodiments) ), and finally obtain the access certificate based on multiple partial decryption results obtained by the multiple holders 200.
  • the multiple holders 200 can jointly obtain the access credentials to obtain access rights to the resource. This can improve the security strength of access rights to the resource.
  • the multiple holders 200 When data needs to be signed, some or all of the multiple holders 200 use their private key fragments to partially sign the data and generate partial signature information.
  • a holder 200 can obtain a partial signature information by sharding the private key he holds. After that, the complete signature information is obtained based on the multiple partial signature information.
  • the process of obtaining the signature information based on the multiple partial signature information is a search process based on the multiple partial signature information with parameter G as the step size.
  • the performer who obtains complete signature information based on the multiple partial signature information may be any one of the multiple holders 200 , or may be a device other than the multiple holders 200 , for example, by the multiple holders 200 .
  • the holder 200 mutually trusts or mutually authorizes a party to perform the process.
  • Signatures are mainly aimed at some more important data. If you only rely on a single subject to sign such important data (such as certificates, or some tamper-proof data), when the identity of a single subject is stolen or the private key used for signing is leaked, , which will cause important data to be tampered with or important data to be leaked. Therefore, the application of distributed signature is proposed. Multiple holders 200 hold their own private key shards. When important data needs to be signed (the data can be understood as plaintext s in subsequent embodiments), the multiple holders 200 The parties 200 use the private key fragments they hold to implement partial signatures on important data and obtain partial signature information (partial signature information can be understood as "partial signature information" in subsequent embodiments).
  • the signature information can be understood as X in subsequent embodiments. This method not only ensures that the private key will not be exposed, but also ensures that effective signatures are achieved for this important data.
  • the key distribution device 100 is described as an independent device with the multiple holders 200 .
  • the multiple holders need to trust the key distribution device 100.
  • the multiple holders 200 trust one key distribution device 100 at the same time, allowing the key distribution device 100 to generate and distribute private key fragments. This will also lead to the situation of trusting a single subject, and private keys or private keys may occur.
  • the leakage of fragments affects the security of private keys or private key fragments.
  • FIG. 2B it is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • the system includes multiple holders 200 of multiple private key shards, where one holder 200 has one private key shard. usage rights, that is, a holder 200 holds one private key shard.
  • a key generation module 210 is deployed in each holder 200 .
  • the key generation module 210 in each holder 200 can generate key fragments that the holder 200 needs to hold. That is to say, the key generation function of the key distribution device 100 in Figure 2A can be jointly implemented by the multiple key generation modules 210, and the operation of distributing private key fragments is omitted in the system shown in Figure 2B.
  • Each key generation module 210 can generate private key fragments for its holder 200, which can avoid the distribution of private key fragments and avoid the transmission of private key fragments, thus ensuring the security of private key fragments. .
  • This method eliminates the independent key distribution device 100 and instead gives each holder 200 the ability to generate private key shards. It is a decentralized threshold password.
  • the holder 200 deployed with the key generation module 210 has the following functions:
  • Each holder 200 has parameter setting function. In order to generate private key shards, you need to enter some necessary parameters first. Each holder 200 has a parameter setting function, allowing the holder 200 to set some public parameters required in generating private key shards. For example, the holder 200 can set n, e, or G, etc., which can be made public. parameters. For another example, the holder 200 sets the parameters required to generate parameters such as n, e, or G that can be disclosed. The multiple holders 200 can interact with each other or the multiple holders 200 can share information to ensure that the parameters required in the respective RSA algorithms are consistent or to ensure the self-set generation n, The parameters required for public parameters such as e, or G can be known to each other.
  • Each holder 200 can also have a self-checking function, which can detect various parameters set by itself to ensure that the format of the parameters set by itself is correct.
  • Each holder 200 has a shard generation function, and each holder 200 can use the set parameters to generate the private key shards it needs to hold.
  • the method of generating any private key fragment can be described in the following steps 302 and 303 in the embodiment, and will not be described again here.
  • each holder 200 generates the private key shards that it needs to hold.
  • Some holders 200 among the plurality of holders 200 can jointly complete ciphertext decryption or signature.
  • ciphertext decryption or signature please refer to the relevant instructions in the system shown in Figure 2A and will not be described again here.
  • Step 301 The key distribution device 100 generates and publishes a public key.
  • the way in which the key distribution device 100 performs step 301 is similar to the way in which the public key is generated by the RAS algorithm in the foregoing description.
  • Step 302 The key distribution device 100 generates the private key d.
  • mod indicates the modulo operation
  • t modulo m indicates the remainder of t divided by m
  • m p ⁇ q ⁇
  • t is a positive integer
  • Step 303 The key distribution device 100 uses the parameter G to generate t private key fragments and publish G.
  • G is a public parameter.
  • t is a positive integer.
  • Z m is a set of integers that are not less than 0 and less than m
  • x and i can be the same or different, different The x chosen is different.
  • the key distribution device 100 may also generate a public input parameter
  • the way in which vi is generated is the same as in the previous description. Similar to, that is, Satisfy the following:
  • v is a random number randomly selected from the set Q
  • Q is cyclic square subset of .
  • Public investment parameters The generation method is similar to that of the public input parameter vi .
  • Public investment parameters And the public parameter v belongs to public information, that is, every private key fragment Holders of 200P i can all know the public parameter v and t public investment parameters. So, one of the t public input parameters vi and a private key shard related.
  • Step 304 The key distribution device 100 distributes t private key fragments to t private key fragment holders 200, and one private key fragment holder 200P i obtains one private key fragment.
  • the key distribution device 100 has distributed the private key fragments to t private key fragment holders 200P i Some or all of the t private key shard holders 200P i can cooperate to decrypt the ciphertext encrypted with the public key, and can also cooperate with the private key sharding Sign important data.
  • the generation method is different from the generation method of private key fragment di in the previous description.
  • the private key fragment is generated in step 303
  • the public parameter G is used when generating the private key fragment di
  • the non-public parameter m is used when generating the private key fragment di.
  • the public key remains unchanged and the private key fragments change, if we still use the t private key fragments di to decrypt the ciphertext Private key sharding Part of the decryption of the ciphertext X cannot be decrypted correctly.
  • the t private key fragments cannot be used in a similar way. Sign the data s.
  • FIG. 4 shows a decryption method provided by an embodiment of the present application. The method includes:
  • Step 401 The holders 200 of each private key fragment use the private key fragments they hold to partially decrypt the ciphertext X and obtain a partial decryption result.
  • the holder of any private key shard di 200P i also needs to prove To prove this Is using private key sharding Obtained by acting on the ciphertext, that is, proving that the holder 200P i used private key sharding when decrypting the ciphertext X
  • Step 402 Use some or all of the t partial decryption results provided by the holders 200 of the t private key fragments to obtain the candidate plaintext s - .
  • step 403 needs to be continued.
  • Step 403 Search based on the candidate plaintext s - with G as the step size, and obtain the plaintext s.
  • FIG. 5 it is a schematic diagram of a search process provided by the embodiment of the present application.
  • the search process when it is determined that the candidate plaintext s - does not meet the plaintext conditions, the search process can be increased or decreased based on G as the step size.
  • Candidate plaintext s - obtain the secondary candidate plaintext (the secondary candidate plaintext can be understood as the following ), verify whether the secondary candidate plaintext satisfies the plaintext condition. When the secondary candidate plaintext satisfies the plaintext condition, the secondary candidate plaintext is the plaintext. Otherwise, continue to increase or decrease the candidate plaintext s - in steps of G until the next Level candidate plaintext satisfies the plaintext condition.
  • the plaintext condition indicates that the candidate plaintext or the e-th power of the secondary candidate plaintext is congruent with the ciphertext The remainders of n are the same.
  • the search process is as follows:
  • Step 4032 Take s - as the center and expand by 1 G on both sides to search:
  • Step 4033 Take s - as the center and expand by 2 G on both sides to search:
  • Step 4034 Take s - as the center and extend to both sides by 3 G to search:
  • the subsequent search method is similar to the previous search method. Each time, the length of the expansion is increased in steps of G until it is found such that satisfy in, or
  • the computing system includes multiple computing nodes. Data interaction occurs between multiple computing nodes and they also cooperate with each other to calculate data. Both data interaction and data calculation involve data encryption and decryption.
  • the keys used for different types of data encryption or decryption are usually generated based on a root key. That is to say, multiple different keys can be derived from one root key, and the multiple different keys can be used to encrypt different types of data. For example, this root key can be derived to various types of keys such as a management key for managing keys, an encryption key for managing user data, or a decryption key.
  • TEE trusted execution environment
  • the keys used for data interaction are also generated by a root key.
  • root key is the main determinant of data security in the computing system. If the root key is leaked, various keys derived based on the root key can be easily exposed. If such a root key is only held by a single subject, the security is poor.
  • the root key (the root key can be understood as the private key in the aforementioned embodiment) is decomposed into multiple fragments (the fragments here can all be understood as the private key fragments in the aforementioned embodiment). ), the multiple shards can be held by multiple holders 200. This can effectively ensure the security of the root key.
  • a cloud computing platform can be understood as a computing system including multiple computing nodes.
  • the root key can be obtained from the hardware chip manufacturer in the computing node, the cloud computing platform manager, and the computing node.
  • the deployed basic software providers are jointly maintained, that is, the hardware chip manufacturer in the computing node, the cloud computing platform manager, and the basic software provider deployed on the computing node can each hold a shard. Only some or all of these three shards can recover the root key. To ensure the security of the root key.
  • Scenario 2 There is some data that does not need to be decrypted in the data exchanged between multiple computing nodes or the data required for data calculation. This type of data is directly transmitted or calculated after being encrypted, and no decryption is required during the entire data interaction or data calculation process.
  • Sensitive data never exists in clear text form during any data interaction or data calculation process. Any computing node participating in data interaction or data calculation is prohibited from obtaining this sensitive data in clear text form.
  • the security of sensitive data depends on the security of the decryption key used to decrypt the encrypted sensitive data. As long as the decryption key is not leaked, the security of the sensitive data can be better guaranteed.
  • the security of sensitive data depends on the root key or other underlying keys.
  • the root key or other underlying keys (the root key or other underlying keys can be understood as the private keys in the aforementioned embodiments) are decomposed into multiple fragments (the fragments here can all be understood as is the private key sharding in the aforementioned embodiment), the multiple shards may be held by multiple holders 200. This can effectively ensure the security of the root key or other underlying keys.
  • PKI Public key infrastructure
  • CA certification authority
  • the key used when signing the certificate can be divided into Multiple shards (the shards here can be understood as private key shards in the previous embodiment).
  • a CA system is constructed, which includes multiple secondary certification centers and one certification center. Each of the multiple secondary certification centers holds a shard, and the certificate issuance is jointly issued by the multiple secondary certification centers. That is to say, the multiple secondary certification centers can use the shards they hold.
  • the certificate is partially signed in fragments to generate a certificate carrying partial signature information.
  • the multiple secondary certification centers issue the certificates carrying partial signature information to the certification center.
  • the certification center generates a complete certificate based on the multiple partial signature information. Signature information, so that certificates carrying signature information can be issued to users, which can ensure the validity of certificates issued by the entire CA system.
  • the embodiment of the present application also provides a key distribution device.
  • the key distribution device can perform the method performed by the key distribution device in the method shown in Figure 3. Relevant features can be found in the above method. Examples will not be described again here.
  • the key distribution device 800 includes a generation module 801 and a distribution module 802 .
  • the generation module 801 is used to decompose the first key into t key fragments according to the parameter G, where the parameter G is a public parameter; t is a positive integer, and some or all of the t key fragments are used for To decrypt ciphertext or sign data, the first key is generated based on the RSA algorithm.
  • the distribution module 802 is used to distribute t key shards so that t holders hold t key shards respectively, wherein one holder holds one key shard.
  • any key fragment generated by the generation module 801 satisfy:
  • a 0 first key d
  • a 1 , a 2 ,...a k-1 are random integers in Z m
  • Z m is a set of integers not less than 0 and less than m, different The selected x is different
  • i is a positive integer not less than t.
  • the parameter G is equal to n, that is, the parameter G is the product of two large prime numbers.
  • the embodiment of the present application also provides a decryption device.
  • the decryption device can perform the method of decrypting ciphertext implemented by some holders in the method shown in Figure 4.
  • the decryption device can also sign important data in a manner similar to the method in which some holders implement the method of decrypting ciphertext in the method shown in Figure 4.
  • the decryption device performs the method in the method shown in Figure 4. Someone took the ciphertext decryption method as an example to illustrate.
  • the decryption device 900 includes a plaintext obtaining module 901 and multiple decryption modules 902 .
  • the number of the multiple decryption modules 902 is not greater than t.
  • Any decryption module 902 can be deployed in the holder 200 .
  • Each decryption module 902 holds a key fragment.
  • the key fragment is obtained by decomposing the first key according to the parameter G.
  • the parameter G is a public parameter.
  • the first key is generated based on the RSA algorithm. of.
  • the plaintext obtaining module 901 can be deployed on any holder 200 or on a device other than the holder 200 .
  • Any decryption module 902 is used to partially decrypt the ciphertext X using the key fragments it holds, and obtain a partial decryption result, wherein a holder obtains a partial decryption result.
  • the plaintext obtaining module 901 is used to obtain plaintext based on multiple partial decryption results obtained by multiple decryption modules 902 and the parameter G.
  • the key fragment held by any decryption module 902 Partial decryption result obtained by decryption module 902 satisfy:
  • the plaintext obtaining module 901 can first obtain the candidate plaintext s - based on multiple partial decryption results, s - satisfies:
  • the candidate plaintext s - is raised to the eth power and X is congruent modulo n, the candidate plaintext s - is the plaintext;
  • the plaintext condition indicates the e-th power of the secondary candidate plaintext, and X is congruent modulo n.
  • each functional module in the embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules.
  • the present application also provides a computing device 1000 as shown in Figure 10.
  • the computing device 1000 includes a bus 1001, a processor 1002, a communication interface 1003, and a memory 1004.
  • the processor 1002, the memory 1004 and the communication interface 1003 communicate through the bus 1001.
  • the processor 1002 may be a central processing unit (CPU).
  • Memory 1004 may include volatile memory, such as random access memory (RAM).
  • the memory 1004 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, HDD or SSD.
  • the executable code is stored in the memory, and the processor 1002 executes the method described in FIG. 3 .
  • the memory 1004 may also include an operating system and other other software modules required for running processes (such as multiple modules of the key distribution device 800, such as multiple modules of the decryption device 900).
  • the operating system can be LINUX TM , UNIX TM , WINDOWS TM , etc.
  • the present application also provides a computing device system, which includes at least one computing device 1100 as shown in FIG. 11 .
  • the computing device 1100 includes a bus 1101, a processor 1102, a communication interface 1103, and a memory 1104.
  • the processor 1102, the memory 1104 and the communication interface 1103 communicate through a bus 1101.
  • At least one computing device 1100 in the computing device system communicates with each other through a communication path.
  • the processor 1102 may be a CPU.
  • Memory 1104 may include volatile memory, such as random access memory.
  • Memory 1104 may also include non-volatile memory such as read-only memory, flash memory, HDD, or SSD.
  • the memory 1104 stores executable code, and the processor 1102 executes the executable code to perform any part or all of the method described in FIG. 3 or 4 .
  • the memory may also include operating systems and other software modules required to run processes.
  • the operating system can be LINUX TM , UNIX TM , WINDOWS TM , etc.
  • At least one computing device 1100 in the computing device system establishes communication with each other through a communication network.
  • Each computing device 1100 runs any one or any multiple modules of the key distribution device 800, or each computing device 1100 runs Run any one or any multiple modules in the decryption device 900.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer program instructions.
  • the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer program instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer program instructions may be transmitted from a website, computer, server, or
  • the data center transmits data to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or a data center that contains one or more sets of available media.
  • the usable media may be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, DVD), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

一种密钥生成方法、装置及设备,本申请中,密钥分发装置在根据RSA算法生成第一密钥之后,可以根据参数G将第一密钥分解为t个密钥分片,其中,参数G为公开的参数;t为正整数,t个密钥分片中的部分或全部用于对密文解密或对数据进行签名。密钥分发装置在获得t个密钥分片后,可以将该t个密钥分片分发给t个持有者,其中,一个持有者持有一个密钥分片。针对RSA算法生成的第一密钥的门限密码中,生成密钥分片采用公开的参数G,密钥分片中携带的第一密钥的信息变少,增加通过多个密钥分片推算出第一密钥的难度,能够有效保证第一密钥的安全性。

Description

一种密钥生成方法、装置及设备
相关申请的交叉引用
本申请要求在2022年4月11日提交中华人民共和国知识产权局、申请号为202210371654.X、发明名称为“一种秘钥处理方法、装置和安全系统”的中国专利申请的优先权,以及于2022年6月29日提交的申请号为202210761513.9、发明名称为“一种密钥生成方法、装置及设备”的中国专利申请的优先权,前述两件专利申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种密钥生成方法、装置及设备。
背景技术
RSA算法是一种经典的密钥算法,利用RSA算法可以生成数据加解密或签名所需的密钥对(该密钥对包括一个公钥和一个私钥)。门限密码则指示了一种分布式使用密钥算法的方式。以基于RSA算法的门限密码为例,门限密码采用的t中选取k(k-out-of-t)门限时,可以将RSA算法生成的私钥分解为t个私钥分片,该t个私钥分片可以分别由t个持有者持有。任意k个私钥分片可以恢复出私钥。
由于任意私钥分片中总是携带有私钥的一些信息,获取一些私钥分片的情况下,可以推算出私钥生成所需的参数,进而使得私钥存在保留的可能性。
发明内容
本申请提供一种密钥生成方法、装置及设备,用以保证门限密码中密钥的安全性。
第一方面,本申请实施例提供了一种密码生成方法,该方法可以采用如下两种方式执行:
方式一:
密钥分发装置在根据RSA算法生成第一密钥之后,可以根据参数G将第一密钥分解为t个密钥分片,其中,参数G为公开的参数;t为正整数,t个密钥分片中的部分或全部用于对密文解密或对数据进行签名。
密钥分发装置在获得t个密钥分片后,可以将该t个密钥分片分发给t个持有者,其中,一个持有者持有一个密钥分片。
方式二:
t个持有者中任一持有者可以根据参数G从第一密钥分解出一个密钥分片,其中,参数G为公开的参数;t为正整数,t个密钥分片分别由t个持有者持有,第一密钥是基于RSA算法生成的。这样,每个持有者可以自行获得一个密钥分片。
通过上述方法,针对RSA算法生成的第一密钥的门限密码中,在生成密钥分配时采用公开的参数G,这样密钥分片中携带的第一密钥的信息变少,通过多个密钥分片推算出第一密钥的难度增加,能够有效保证第一密钥的安全性。
在一种可能的实施方式中,任一密钥分片满足:
其中,a0=第一密钥d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0且小于m的整数集合,不同所选用的x不同,i为不小于t的正整数。k为小于t的正整数。
通过上述方法,密钥分片的生成过程中使用了参数G,不再采用与第一密钥相关的参数,密钥分片的生成方式更加简单。
在一种可能的实施方式中,与第一密钥对应的第二密钥为(n,e),e为一个大于1的素数,n为两个大素数p和q的乘积,p=2p`+1,q=2q`+1。大素数是指数值较大,大于阈值的质数。该阈值可以为10的11次方或更大的值。
第一密钥d满足:
ed=t mod m
其中,mod指示取模运算,m=p`q`,m=p`q`。
通过上述方法,第二密钥是有两个大素数的乘积,大素数的乘积较难分解,也即通过第二密钥无法解析出两个大素数,这样就无法确定p`、q`,进而保证了第一密钥的安全性。
在一种可能的实施方式中,参数G等于n。
通过上述方法,参数G为第二密钥中的两个大素数的乘积,能够进一步简化密钥分片的生成方式。
在一种可能的实施方式中,t个持有者持有t个密钥分片,该t个密钥分片中的部分或全部用于对密文解密或对数据进行签名。对密钥解密以及对数据进行签名的方式类似,区别在于密钥分片作用的数据不同,下面以利用t个密钥分片中的部分或全部对密文解密为例进行说明:
t个持有者中的部分或全部(如t个持有者中的k个持有者)利用所持有的密钥分片对密文X进行部分解密,获得多个部分解密结果,其中,一个持有者利用所持有的一个密钥分片对密钥X进行部分解密获得一个部分解密结果。之后,再基于多个部分解密结果以及参数G获得明文。
通过上述方法,部分或全部持有者利用所持有的密钥分片对密文进行部分解密,该多个持有者无需利用t个密钥分片恢复出第一密钥,避免了第一密钥的泄露。
在一种可能的实施方式中,任一密钥分片的持有者获得的部分解密结果满足:
通过上述方法,持有者利用参数G对密文X进行部分解密的方式较为简单,能够较快获得部分解密结果。
在一种可能的实施方式中,在基于多个部分解密结果以及参数G获得明文时,可以先基于多个部分解密结果获得候选明文s-,s-满足:
其中,S为集合I的子集,S包括k个元素,集合I包括从1到t的t个正整数,也即I={1,2,3……,t};
若候选明文s-的e次方、以及X取模n同余,候选明文s-即为明文。若候选明文s-的e次方、以及X取模n不同余,以候选明文s-为中心,以G为步长增加或减少候选明文s-,确定满足明文条件的次级候选明文,明文条件指示次级候选明文的e次方、以及X取模n同余。
通过上述方法,由于在生成密钥分片时采用了参数G,使得候选明文与正确的明文可能 存在以G为粒度的误差,故而可以利用多个部分解密结果以及参数G获得明文,以保证最终可以获得正确的明文。
第二方面,本申请实施例还提供了一种密钥分发装置,该密钥分发装置具有实现上述第一方面的方法实例中生成密钥的方法,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,装置的结构中包括生成模块、分发模块。这些模块可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。在一个可能的设计中,装置的结构中包括t个密钥生成模块,密钥生成模块可以部署在一个持有者中,任一持有者中的密钥生成模块用于根据参数G从第一密钥中分解出所需持有的密钥分片。这些模块可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
第三方面,本申请实施例还提供了一种解密装置,该解密装置具有实现上述第一方面的方法实例中利用t个密钥分片中部分或全部对密文解密或对数据进行签名的方法,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。在一个可能的设计中,设备的结构中包括明文获得模块和多个解密模块,一个解密模块中可以部署在一个持有者中。这些模块可以执行上述第一方面方法示例中的相应功能,有益效果可以参见第一方面的相关说明,此处不做赘述。
第四方面,本申请还提供了一种计算设备,所述计算设备包括处理器和存储器,还可以包括通信接口,所述处理器执行所述存储器中的程序指令执行上述第一方面或第一方面任一可能的实现方式提供的方法。所述存储器与所述处理器耦合,其保存密钥生成过程中、对密文解密过程中或对数据进行签名过程中必要的程序指令和数据。所述通信接口,用于与其他设备进行通信,如发送密钥分片、发送部分解密结果等。
第五方面,本申请提供了一种计算设备系统,该计算设备系统包括至少一个计算设备。每个计算设备包括存储器和处理器。至少一个计算设备的处理器用于访问所述存储器中的代码以执行第一方面或第一方面的任意一种可能的实现方式提供的方法。
第六方面,本申请提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实现方式中提供的方法。该存储介质中存储了程序。该存储介质包括但不限于易失性存储器,例如随机访问存储器,非易失性存储器,例如快闪存储器、硬盘(hard disk drive,HDD)、固态硬盘(solid state drive,SSD)。
第七方面,本申请提供了一种计算设备程序产品,所述计算设备程序产品包括计算机指令,在被计算设备执行时,所述计算设备执行前述第一方面或第一方面的任意可能的实现方式中提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第一方面或第一方面的任意可能的实现方式中提供的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。
附图说明
图1为一种私钥分片的分配示意图;
图2A为本申请提供的一种系统的架构示意图;
图2B为本申请提供的一种系统的架构示意图;
图3为本申请提供的一种密钥生成方法示意图;
图4为本申请提供的一种解密方法示意图;
图5为本申请提供的一种搜索过程示意图;
图6为本申请提供的一种云计算平台中多方持有私钥分片的示意图;
图7A为一种CA下发证书的示意图;
图7B为一种本申请提供的CA体系的结构示意图;
图8为本申请提供的一种密钥分发装置的结构示意图;
图9为本申请提供的一种解密装置的结构示意图;
图10~图11为本申请提供的一种计算设备的结构示意图。
具体实施方式
RSA算法是一种较为常见的密钥算法,RAS算法适用于公开密钥密码体制。在公开密钥密码体制中,要求加密密钥(即公开密钥,简称为公钥)是公开信息,解密密钥(即秘密密钥,简称为私钥)是需要保密的。加密算法和解密算法都是公开的。
RSA算法的原理是数论中“对大素数(大素数是指很大的质数)的乘积进行因式分解极其困难”。
在RAS算法中,可以将两个大素数(分别为p和q)的乘积n(即n=pq)以及另一个素数e作为公钥,而由这两个大素数可以产生两个参数p`和q`(其中,p=2p`+1,q=2q`+1),参数p`和q`的乘积m(即m=p`q`)可以作为生成私钥所需的参数。
采用上述方式生成的公钥和私钥,由于公钥较难破解,很难从公钥中解析出两个大素数,进而也就很难获得p`和q`,自然私钥也就无法获取,以此来保证私钥的安全性,在一定程度上可以达到密钥隐私保护的效果。
在密码算法的使用方法中,门限密码(threshold cipher)指示了密码算法的一种分布式使用方法。门限密码不再依赖于单一的私钥持有者,也就是说私钥不再由单一的主体维护,而是将私钥分片化(将私钥分为多个私钥分片),分散到多个主体中,由这多个主体共同维护私钥,共同实现对密文的解密或对数据的签名,其中,每个主体维护一个私钥分片,这样的主体可以称为一个私钥分片的持有者。这样即便其中一个私钥分片持有者的私钥分片泄露了,也不会导致整个私钥的泄露,以此进一步提高私钥的安全性。
门限密码更加适用于分布式场景。例如,云端的数据加解密、或数据的签名以及签名验证。又例如,分布式系统中数据加解密、或数据签名以及签名验证。
门限密码较常使用的是t中选取k(k-out-of-t)门限,k-out-of-t门限是指将一个私钥分为t个私钥分片,该t个私钥分片分别由t个持有人者分享,一个持有者持有其中一个私钥分片。获得该t个私钥分片中任意k个私钥分片可以恢复出私钥。少于k个私钥分片则无法恢复私钥。
下面对利用一种RSA算法生成密钥的方式以及基于一种RAS算法的门限密码进行说明:
(1)、利用RSA算法生成密钥的方式
选取两个素数p和q,这两个素数可以为大素数,且p=2p`+1,q=2q`+1。
令n=pq,公钥表示为(n,e),其中,e为一个大于1的素数。公钥可以用于对明文s(明文是指未经加密的信息)加密,还可以用于签名信息s进行验证。公钥使用方法如下:
X=semod n,其中,mod指示取模运算
其中,X表示明文s加密后获得的密文或对数据s签名后获得的签名信息。
私钥d为一个整数,也即私钥d属于整数集合Z,且私钥d满足:
ed=t mod m,其中,m=p`q`,t为正整数
由于公钥是公开的,门限密码中的t属于公开值,也就是说很容易获知e和t,可见,私钥d是一个与m有关的数值,若m被破解,很容易通过m推算出私钥d。
(2)、基于RAS算法的门限密码
私钥d可以通过门限密码分解t个私钥分片。任一私钥分片di满足:
di=f(x)mod m,i为正整数,1≤i≤t
其中,其中,a0=d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0、且小于m的整数构成的整数集合,x可以等于i,也可以不等于i。在计算私钥分片di时,只需要保证不同的私钥分片di选用不同的x即可。
私钥d可以由k个私钥分片恢复,恢复方式如下:
d=∑i∈Sdiui
其中,S为集合I的子集,S中包括k个元素,集合I包括从1到t的t个正整数,也即I={1,2,3……,t}。
如图1所示,为一种基于RSA算法的门限密码中私钥分片的分配示意图。密钥分发方可以向t个持有者(该t个持有者分别为P1、P2、……Pt)分别分发私钥分片(该t个私钥分配分别为d1、d2、……dt)。其中任意k个私钥分片可以恢复出私钥d。
另外,密钥分发方在向t个持有者Pi(i为不小于1,不大于t的正整数)分发私钥分片di的同时,还会公开t个公共投入参数vi(i为正整数,1≤i≤t)以及一个公共参数v,任一公共投入参数vi的计算方式如下:
其中,v是从集合Q中随机选取的随机数,Q为的循环平方子集(cyclic subgroup of squares in),是不小于0、且不小于n-1的整数中与n互质的整数集合。
公共投入参数vi以及公共参数v属于公开信息,也就是说,每任一私钥分片di的持有者Pi均能获知该公共参数v以及t个公共投入参数vi,该t个公共投入参数vi中的一个公共投入参数与一个私钥分片有关。
由上可知,t个私钥分片中的任意k个私钥分片可以恢复出私钥d,恢复出的私钥d可以用于对密文解密或者对数据进行签名。但是一旦利用该k个私钥分片恢复出私钥d,该私钥d就已暴露了,不具备安全性。为了不暴露该私钥d,可以利用该t个私钥分片di中的部分或全部私钥分片对密文解密或者对数据进行签名。
利用该t个私钥分片对密文解密的原理以及对利用该t个私钥分片对数据进行签名的原理类似,密文解密以及签名的区别在于各个私钥分片所作用的信息不同,利用该t个私钥分片对密文解密时,各个私钥分片需要作用于密文,而利用该t个私钥分片对数据进行签名验证时,各个私钥分片需要作用于需要签名的数据。
这里以利用该t个私钥分片对密文X解密为例进行说明:
对于任一私钥分片di的持有者Pi提供Xi,Xi满足:
其中,Δ=t=t(t-1)(t-2)...2·1
任一私钥分片di的持有者Pi还需要证明以此证明Xi是利用私钥分片di作用于密文获得的,即证明持有者Pi在对密文X解密的过程中使用了私钥分片di
若该t个私钥分片的持有者中的任意k个私钥分片的持有者提供了正确的Xi。那么就可以利用k个Xi获得明文s,s可以通过如下方式获得:
其中,4aΔ2+be=1,
从上述说明可知,基于私钥分片di的生成方式(也即di=f(x)mod m)可以看出,私钥分片di与m有关,每个私钥分片di会携带一部分m的信息,例如通过私钥分片di可以确定m的取值范围,至少可以明确m应当是大于di的一个数值。在获知部分私钥分片di的情况下,很容易锁定m的取值范围,这样会使得m容易被泄露。若m被泄露,利用ed=t mod m,可以破解私钥d。这样同样会影响到私钥d的安全性。
在本申请中为了保证RSA算法的私钥d的安全性,提供了一种密钥生成方法,在该密钥生成方法中,能够将一个需要保密的密钥分为多个密钥分片。不同于前述说明中提及的私钥分片在生成是借助了较为私密的参数m,该多个密钥分片是利用公开的参数G生成的。利用该多个密钥分片中的部分或全部能够实现对密文的解密或对数据的签名。
需要说明的是,这里需要保密的密钥指不能被共享的、暴露会引起安全问题的密钥。例如,公开密钥密码体制中,私钥即为需要保密的密钥。又例如,在密钥衍生中,用于生成不同类型的密钥的根密钥或一些属于需要保密的密钥。在后续说明书中以该需要保密的密钥为私钥为例进行说明。
结合前述提及的RSA算法,在本申请实施例所提供的密钥生成方法中,仍保留前述提及的RSA算法中公钥的生成方式,将私钥分片t个私钥分片,其中,任一私钥分片是利用公开的参数G生成的。将该t个私钥分片分发给t个持有者,每个持有者持有其中一个私钥分片。该t个持有者中的k个持有者可以利用所持有的私钥分片对密文进行解密或对数据进行签名,其中,密文是利用公钥对明文加密生成的,签名后获得签名信息可以利用公钥进行验证。
如图2A所示,为本申请实施例提供的一种系统结构示意图,该系统中包括多个私钥分片的多个持有者200,其中,一个持有者200具备一个私钥分片的使用权限,也就是说,一个持有者200持有一个私钥分片。
该系统中还包括密钥分发装置100。密钥分发装置100具备密钥生成功能,密钥分发装置100能够执行本申请实施例提供的密钥生成方法,利用公开的参数生成多个私钥分片。
密钥分发装置100具备密钥分发功能,密钥分发装置100在生成了公钥后,可以公布该公钥。密钥分发装置100在生成了多个私钥分片后,可以将该多个私钥分片分发给多个持有者200,其中,一个持有者200获取一个私钥分片。
本申请实施例并不限定该密钥分发装置100的具体类型以及部署方式。其中,密钥分发装置100可以通过软件的形式呈现,也可以通过硬件实现。
当密钥分发装置100通过软件的形式呈现时,密钥分发装置100可以是运行在计算设备上的应用程序或代码块。其中,计算设备可以是物理主机、虚拟机、容器等计算设备中的至少一种。进一步地,上述计算设备可以是一台或者多台。也就是说,该密钥分发装置100可以集中的部署在一台计算设备、也可以分布式的部署在多台计算设备上。
当密钥分发装置100通过硬件实现时,密钥分发装置100中可以包括至少一个计算设备,如服务器等。或者,密钥分发装置100也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。
该多个持有者200持有各自的私钥分片,多个持有者200中部分或全部能够互相配合完成密文解密或完成对数据的签名。
应需理解的是,这里的持有者200并不限定于“人”,持有者200可以理解为能够使用私钥分片的设备或具有私钥分片使用权限的组织,在一些场景中持有者200可以理解为用户的所有的计算设备,也可以理解为有多个计算设备组成的集群。
当需要完成密文解密时,该多个持有者200中的部分或全部,利用所持的私钥分片对密钥进行部分解密,生成部分解密结果。一个持有者200可以利用所持私钥分片获得一个部分解密结果。之后,基于该多个部分解密结果获得与该密文对应的明文,基于该多个部分解密结果获得的明文的过程是一个基于该多个部分解密结果以参数G为粒度的搜索过程。基于该多个部分解密结果获得明文的执行者可以是该多个持有者200中的任一个,也可以是该多个持有者200之外的装置,例如,由该多个持有者200共同信任或共同授权的一方执行该过程。
密文解密的应用适用于需要多个持有者200配合获得明文的场景中。例如,应用于多方计算场景中,这里的多方可以理解为多个持有者200,该多个持有者200需要互相配合对某一个数据(该数据可以理解为后续实施例中的明文s)进行计算。而在对该数据进行计算之前,需要先获取该数据。在该数据(该数据可以理解为后续实施例中的密文X)是由公钥加密的情况下,该多个持有者200各自持有的私钥分片对该加密的数据、完成部分解密,获得部分解密结果(部分解密结果可以理解为后续实施例中的),最后基于该多个持有者200获得多个部分解密结果获得该数据。这样只有该多个持有者200配合才能共同获得该数据,以便该多个持有者200能够对该数据共同进行计算,在一定程度上保证了该数据的安全性,避免数据被窃取。
又例如,在多方访问权限场景中,这里的多方可以理解为多个持有者200,该多个持有者200均具备对某一资源的访问权限,为了能够访问某一个资源,该多个持有者200需要互相配合获得针对于该资源的访问凭证(如访问口令(token)),持有者200只有在获得该访问凭证(该数据可以理解为后续实施例中的明文s)才能通过该访问凭证访问该资源。而该访问凭证是由公钥加密的,为此需要对加密的访问凭证进行解密(该加密的访问凭证可以理解为后续实施例中的明文X)。由该多个持有者200各自持有的私钥分片对该加密的访问凭证完成部分解密,获得部分解密结果(部分解密结果可以理解为后续实施例中的),最后基于该多个持有者200获得多个部分解密结果获得该访问凭证。这样只有该多个持有者200才能共同获得该访问凭证,以获取针对该资源的访问权限。由此可以提升该资源的访问权限的安全强度。
当需要对数据进行签名时,该多个持有者200中的部分或全部,利用所持的私钥分片对该数据进行部分签名,生成部分签名信息。一个持有者200可以利用所持私钥分片获得一个部分签名信息。之后,基于该多个部分签名信息获得完整的签名信息,基于该多个部分签名信息获得的签名信息的过程是一个基于该多个部分签名信息以参数G为步长的搜索过程。基于该多个部分签名信息获得完整的签名信息的执行者可以是该多个持有者200中的任一个,也可以是该多个持有者200之外的装置,例如,由该多个持有者200共同信任或共同授权的一方执行该过程。
签名主要针对一些较为重要的数据,如果仅仅依赖单一的主体对这类重要数据(如证书、或一些防篡改的数据)进行签名,当单一的主体的身份被盗用或签名所使用的私钥泄露,将造成重要数据被篡改或重要数据被泄露的情况。故而提出分布式签名的应用,多个持有者200持有各自的私钥分片,在需要对重要数据(该数据可以理解为后续实施例中的明文s)进行签名时,该多个持有者200使用各自所持有的私钥分片对重要数据实现部分签名,获得部分签名信息(部分签名信息可以理解为后续实施例中的),再将该多个持有者200签名后得到的 多个部分签名信息合成输出最终的签名信息(该签名信息可以理解为后续实施例中的X))。这种方式既能保证私钥不会暴露,也能保证针对该重要数据实现有效签名。
在图2A所示的系统架构中,将密钥分发装置100作为一个独立与该多个持有者200的装置进行说明,事实上,这种系统中,若该密钥分发装置100为一个独立与该多个持有者200的设备,则需要该多个持有人需要信任该密钥分发装置100。该多个持有者200同时信任了一个该密钥分发装置100,允许该密钥分发装置100产生并分发私钥分片,同样会造成信任单一主体的情况,可能会发生私钥或私钥分片泄露的情况,影响私钥或私钥分片的安全性。
如图2B所示,为本申请实施例提供的一种系统架构示意图,该系统中包括多个私钥分片的多个持有者200,其中,一个持有者200具备一个私钥分片的使用权限,也就一个持有者200持有一个私钥分片。每个持有者200中部署有密钥生成模块210。每个持有者200中的密钥生成模块210能够生成所在持有者200需持有的密钥分片。也就是说,图2A中密钥分发装置100的密钥生成功能可以由该多个密钥生成模块210共同实现,在图2B所示的系统中省略了私钥分片的分发的操作。
每个密钥生成模块210可以为所在的持有者200产生私钥分片,这样能够避免私钥分片的分发,避免了私钥分片的传输,这样能够保证私钥分片的安全性。这种方式去除了独立的密钥分发装置100,而是赋予每个持有者200生成私钥分片的能力,是一种去中心化的门限密码。
部署有密钥生成模块210的持有者200具备如下功能:
每个持有者200具备参数设定功能。为了生成私钥分片,需要先输入一些必要的参数。每个持有者200具备参数设定功能,允许持有者200自行设定在生成私钥分片中需要的一些公开参数,如持有者200可以自行设置n、e、或G等可以公开的参数。又如,持有者200设置生成n、e、或G等可以公开的参数所需要的参数。该多个持有者200可以之间通过交互或该多个持有者200可以进行信息共享,以保证各自设定的RSA算法中所需的各个参数保持一致或保证自行设定的生成n、e、或G等可以公开的参数所需要的参数是彼此可以获知的。
每个持有者200还可以具备自检功能,能够对自行设定的各个参数进行检测,以保证自行设定的参数的格式是正确的。
每个持有者200具备分片生成功能,每个持有者200可以利用所设定的参数,生成自身需持有的私钥分片。任一私钥分片的生成方式可以后续实施例中步骤302以及步骤303的相关说明,此处不再赘述。
在如图2B所示的系统中,每个持有者200自行生成各自需持有的私钥分片。该多个持有者200中的部分持有者200可以共同完成密文解密或签名。密文解密或签名的过程可以参见图2A所示的系统中的相关说明,此处不再赘述。
下面基于如图2A所示的系统,结合附图3对本申请实施例提供的密钥生成方法进行说明:
步骤301:密钥分发装置100生成并公布公钥。密钥分发装置100执行步骤301的方式与前述说明中RAS算法生成公钥的方式类似。
密钥分发装置100可以选取两个素数p和q,这两个素数可以为大素数,且p=2p`+1,q=2q`+1。令n=pq,公钥表示为(n,e),其中,e为一个大于1的素数。
步骤302:密钥分发装置100生成私钥d。密钥分发装置100生成私钥d的方式与前述说明中利用RAS算法生成私钥的方式类似。也就是说,私钥d满足如下:
ed=t mod m
其中,mod指示取模运算,t取模m表示t除以m的余数,m=p`q`,t为正整数。
步骤303:密钥分发装置100利用参数G生成t个私钥分片并公布G。G为可公开的参数。t为正整数。
任一私钥分片满足如下:
其中,a0=d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0且小于m的整数集合,x与i可以相同也可以不同,不同所选用的x不同。
随着任一私钥分片密钥分发装置100还可以生成一个公共投入参数该vi的生成方式与前述说明中的类似,也就是说,满足如下:
其中,v是从集合Q中随机选取的随机数,Q为的循环平方子集。公共投入参数生成方式以及公共投入参数vi的生成方式类似。
公共投入参数以及公共参数v属于公开信息,也就是说,每任一私钥分片的持有者200Pi都能获知该公共参数v以及t个公共投入参数以,该t个公共投入参数vi中的一个公共投入参数与一个私钥分片有关。
步骤304:密钥分发装置100向t个私钥分片持有者200分发t个私钥分片,1个私钥分片持有者200Pi获取1个私钥分片
至此,密钥分发装置100向t个私钥分片持有者200Pi分发了私钥分片该t个私钥分片持有者200Pi中的部分或全部可以配合对利用公钥加密后的密文进行解密,还可以配合利用私钥分片对重要数据进行签名。
由于公钥的生成方式与前述说明中公钥的方式类似,但私钥分片的生成方式与前述说明中私钥分片di的生成方式不同,通过私钥分片的生成方式与私钥分片di的生成方式对比可知,在步骤303中生成私钥分片时借助了公开的参数G,而生成私钥分片di时借助了非公开的参数m。那么,在公钥保持不变、私钥分片发生变化的情况下,若仍采用与前述说明中利用该t个私钥分片di中部分对密文X解密类似的方式利用该t个私钥分片中的部分对密文X解密是不能正确进行解密的。同样的,也不能够采用类似的方式利用该t个私钥分片对数据s进行签名。
利用该t个私钥分片对数据进行签名以及利用该t个私钥分片对密文X进行解密的原理类似,同样的,这里也仅是以利用该t个私钥分片对密文X进行解密为例进行说明。如图4所示为本申请实施例提供的一种解密方法,该方法包括:
步骤401:各个私钥分片的持有者200利用各自持有的私钥分片对密文X进行部分解密,获得部分解密结果。
对于任一私钥分片的持有者200Pi,该持有者200Pi可以提供部分解密结果 满足:
任一私钥分片di的持有者200Pi还需要证明以此证明是利用私钥分片作用于密文获得的,也即证明持有者200Pi在对密文X解密时使用了私钥分片
对该私钥分片对密文X进行解密的过程中任一私钥分片的持有者200Pi在进行解密时所执行的操作与前述说明中利用私钥分片di对密文X解密的过程中任一私钥分片di的持有者200Pi在进行解密时所执行操作进行对比,可发现:
(1)、对于任一私钥分片的持有者200Pi计算的计算量与计算Xi的计算量有所降低,计算方式更加简单。
(2)、私钥分片的持有者200Pi只需要证明与证明相比,证明的计算量同样也有明显降低,这样能够有效提升计算效率。
可见,对该私钥分片对密文X进行解密的过程中任一私钥分片持有者200Pi在进行解密时的计算量明显降低,能够加快解密过程,提升密文解密效率。
步骤402:利用该t个私钥分片的持有者200所提供的t个部分解密结果中的部分或全部,获得候选明文s-
若该t个私钥分片的持有者200中的任意k个私钥分片的持有者200提供了正确的那么就可以利用k个获得候选明文s-,s-可以通过如下方式获得:
其中,
这是因为在计算所使用的私钥分片以及候选明文时取了模G,导致候选明文s-可能并非是真正的明文s,候选明文s-与明文s之间可能存在以G为粒度的误差,为了能够获得明文s,需要基于候选明文s-、以G为步长执行搜索过程,以获得明文s。也即需要继续执行步骤403。
步骤403:基于候选明文s-、以G为步长进行搜索,获得明文s。
如图5所示,为本申请实施例提供的一种搜索过程示意图,在该搜索过程中,在确定候选明文s-不满足明文条件的情况下,可以基于以G为步长增大或减少候选明文s-,获得次级候选明文(该次级候选明文可以理解为下文中的),验证次级候选明文是否满足明文条件,在次级候选明文满足明文条件的情况下,次级候选明文即为明文,否则继续以G为步长增大或减少候选明文s-,直至次级候选明文满足明文条件。其中,明文条件指示候选明文或次级候选明文的e次方、与密文X取模n同余,也就是说,次级候选明文的e次方取模n的余数与密文X取模n的余数相同。
搜索过程如下:
步骤4031、确定候选明文s-的e次方、与密文X是否模n同余,也即确定s-是否满足s-e=X mod n,若满足则说明候选明文s-是真正的明文s,否则继续进行搜索,执行下一步。
步骤4032、以s-为中心,分别向两边以1个G扩展以进行搜索:
沿着降低s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s,否则沿着增加s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s,否则继续进行搜索。
步骤4033、以s-为中心,分别向两边以2个G扩展以进行搜索:
沿着降低s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s,否则沿着增加s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s,否则继续进行搜索。
步骤4034、以s-为中心,分别向两边以3个G扩展以进行搜索:
沿着降低s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s,否则沿着增加s-的方向以G为步长扩展,令确定的e次方、与密文X是否取模n同余,也即确定是否满足若满足则说明是真正的明文s, 否则继续进行搜索。
后续搜索与前述搜索方式类似,每次均是以G为步长增加扩展的长度,直至找到使得满足其中,
下面具体到实际应用,对本申请实施例提供的私钥分片的使用场景进行说明:
场景一、计算系统包括多个计算节点,多个计算节点之间会进行数据交互、也会相互配合对数据进行计算。无论是数据交互还是数据计算均涉及到数据加解密,不同类型的数据加密或解密所采用的密钥通常是基于一个根密钥生成的。也就是说,通过一个根密钥可以衍生出多个不同的密钥,该多个不同的密钥可以应用于针对于不同类型的数据加密。例如,该根密钥可以衍生出对用于管理密钥的管理密钥、管理用户数据的加密密钥或解密密钥等多种类型的密钥。又例如,在基于硬件隔离的可信执行环境(trusted execution environment,TEE)中数据交互采用的密钥也均是有一个根密钥生成的。
可见,这样的根密钥是该计算系统中数据安全的主要决定因素,若根密钥泄露,基于该根密钥衍生的各种密钥很容易被暴露。这样的根密钥若仅是由单一主体持有,安全性较差。在这种场景下,该根密钥(该根密钥可以理解为前述实施例中的私钥)分解为多个分片(这里的分片皆可以理解为前述实施例中的私钥分片),该多个分片可以由多个持有者200持有。这样能够有效保证根密钥的安全性。
参见图6,以云计算平台为例,云计算平台可以理解为包括多个计算节点的计算系统,该根密钥可以由计算节点中硬件芯片生产商、云计算平台管理方、以及计算节点上部署的基础软件提供方共同维护,也即计算节点中硬件芯片生产商、云计算平台管理方、以及计算节点上部署的基础软件提供方各自可以持有一个分片。这三个分片中的部分或全部才可以恢复出根密钥。以保证该根密钥的安全性。
场景二、多个计算节点之间所交互的数据或进行数据计算所需的数据中存在一些不需要被解密的数据。这类数据在被加密后直接进行传输或计算,在整个数据交互或数据计算过程并不需要解密。
例如,对于一些敏感数据,如涉及到用户身份或隐私的数据。敏感数据从不以明文形式存在在任何数据交互或数据计算过程中,参与数据交互或者数据计算的任一计算节点禁止以明文的形式获取该敏感数据。
敏感数据的安全性取决于对该加密后的敏感数据解密所采用的解密密钥的安全性,只要该解密密钥不被泄露,可以较好的保证该敏感数据的安全性。
当该解密密钥由根密钥或其它底层密钥产生时,则敏感数据的安全依赖于根密钥或其他底层密钥。在这种场景下,该根密钥或其他底层密钥(该根密钥或其他底层密钥可以理解为前述实施例中的私钥)分解为多个分片(这里的分片皆可以理解为前述实施例中的私钥分片),该多个分片可以由多个持有者200持有。这样能够有效保证根密钥或其他底层密钥的安全性。
场景三、公钥基础设施(public key infrastructure,PKI)采用证书的方式进行公钥管理,通过第三方的可信任机构,如认证中心(certificate authority,CA),把设备的公钥和设备的标识捆绑在一起写入到该设备的证书中。
如图7A所示,CA在所下发证书时,需要对该证书进行签名以保证该证书的权威性,CA对证书签名后,可以将签发后的证书下发用户。可见CA对证书签名时所采用的密钥决定该证书以及该证书上记录的公钥的有效性。一旦对证书签名时所采用的密钥泄露,证书会失效,相应的证书上记录的公钥也失效。
为此,对证书签名时所采用的密钥(该密钥可以理解为前述实施例中的私钥)可以分为 多个分片(这里的分片可以理解为前述实施例中的私钥分片)。如图7B所示,构建一个CA体系,在该CA体系中包括多个次级认证中心以及一个认证中心。该多个次级认证中心中每个次级中心持有一个分片,证书的签发有该多个次级认证中心共同签发,也就是说,该多个次级认证中心可以利用所持有的分片对证书进行部分签名,生成携带有部分签名信息的证书,该多个次级认证中心将携带有部分签名信息的证书下发给认证中心,认证中心基于该多个部分签名信息生成完整的签名信息,这样可以向用户下发携带有签名信息的证书,这样能保证整个CA体系下发的证书的有效性。
基于与方法实施例同一发明构思,本申请实施例还提供了一种密钥分发装置,该密钥分发装置可以执行上述如图3方法密钥分发装置所执行的方法,相关特征可参见上述方法实施例,此处不再赘述。如图8所示,密钥分发装置800包括生成模块801、分发模块802。
生成模块801,用于根据参数G将第一密钥分解为t个密钥分片,其中,参数G为公开的参数;t为正整数,t个密钥分片中的部分或全部用于对密文解密或对数据进行签名,第一密钥是基于RSA算法生成的。
分发模块802,用于分发t个密钥分片,使得t个持有者分别持有t个密钥分片,其中,一个持有者持有一个密钥分片。
在一种可能的实施方式中,生成模块801生成的任一密钥分片满足:
其中,a0=第一密钥d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0且小于m的整数集合,不同所选用的x不同,i为不小于t的正整数。
在一种可能的实施方式中,与第一密钥对应的第二密钥为(n,e),e为一个大于1的素数,n为两个大素数p和q的乘积,p=2p`+1,q=2q`+1;
第一密钥d满足:
ed=t mod m
其中,mod指示取模运算,m=p`q`。
在一种可能的实施方式中,参数G等于n,也即参数G为两个大素数的乘积。
基于与方法实施例同一发明构思,本申请实施例还提供了一种解密装置,该解密装置可以执行上述如图4方法中部分持有者实施对密文解密方法,相关特征可参见上述方法实施例,此处不再赘述。需要说明的是,该解密装置也可以采用如图4方法中部分持有者实施对密文解密方法类似的方式对重要数据进行签名,这里仅是以该解密装置执行如图4方法中部分持有者实施对密文解密方法为例进行说明。
如图9所示,解密装置900包括明文获得模块901以及多个解密模块902,该多个解密模块902的数量不大于t,任一解密模块902可以部署在持有者200中。每个所述解密模块902持有一个密钥分片,所述密钥分片是根据参数G将第一密钥分解获得的,参数G为公开的参数,第一密钥是基于RSA算法生成的。明文获得模块901可以部署在任一持有者200上,也可以部署在除持有者200之外的装置上。
任一解密模块902,用于所持有的密钥分片对密文X进行部分解密,获得一个部分解密结果,其中,一个持有者获得一个部分解密结果。
明文获得模块901,用于基于多个解密模块902获得的多个部分解密结果以及参数G获得明文。
在一种可能的实施方式中,任一解密模块902持有的密钥分片解密模块902获得的部分解密结果满足:
在一种可能的实施方式中,明文获得模块901在获得明文时,可以先基于多个部分解密结果获得候选明文s-,s-满足:
其中,S中包括k个元素,集合I包括从1到t的t个正整数,也即I={1,2,3……,t};
若候选明文s-的e次方、以及X取模n同余,候选明文s-即为明文;
若候选明文s-的e次方、以及X取模n不同余,明文获得模块901可以以候选明文s-为中心,以G为步长增加或减少候选明文s-,确定满足明文条件的次级候选明文,明文条件指示次级候选明文的e次方、以及X取模n同余。
需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
本申请还提供如图10所示的计算设备1000。所述计算设备1000包括总线1001、处理器1002、通信接口1003和存储器1004。处理器1002、存储器1004和通信接口1003之间通过总线1001通信。
其中,处理器1002可以为中央处理器(central processing unit,CPU)。存储器1004可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器1004还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,HDD或SSD。存储器中存储有可执行代码,处理器1002执行前述图3所描述的方法。存储器1004中还可以包括操作系统等其他运行进程所需的软件模块(如密钥分发装置800的多个模块、如解密装置900的多个模块)。操作系统可以为LINUXTM,UNIXTM,WINDOWSTM等。
本申请还提供一种计算设备系统,所述计算设备系统包括至少一个如图11所示的计算设备1100。所述计算设备1100包括总线1101、处理器1102、通信接口1103和存储器1104。处理器1102、存储器1104和通信接口1103之间通过总线1101通信。所述计算设备系统中的至少一个计算设备1100之间通过通信通路进行通信。
其中,处理器1102可以为CPU。存储器1104可以包括易失性存储器,例如随机存取存储器。存储器1104还可以包括非易失性存储器,例如只读存储器,快闪存储器,HDD或SSD。存储器1104中存储有可执行代码,处理器1102执行该可执行代码以执行前述图3或4描述的方法中的任意部分或全部。存储器中还可以包括操作系统等其他运行进程所需的软件模块。操作系统可以为LINUXTM,UNIXTM,WINDOWSTM等。
所述计算设备系统中的至少一个计算设备1100之间通过通信网络互相建立通信,每个计算设备1100上运行密钥分发装置800中的任意一个或者任意多个模块、或者每个计算设备1100上运行解密装置900中的任意一个或者任意多个模块。
上述各个附图对应的流程的描述各有侧重,某个流程中没有详述的部分,可以参见其他流程的相关描述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括计 算机程序指令,在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例图3所述的流程或功能。
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机程序指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (16)

  1. 一种密钥生成方法,其特征在于,所述方法包括:
    根据参数G将第一密钥分解为t个密钥分片,其中,参数G为公开的参数;t为正整数,所述t个密钥分片中的部分或全部用于对密文解密或对数据进行签名,所述第一密钥是基于RSA算法生成的;
    所述t个密钥分片分别由t个持有者持有,其中,一个所述持有者持有一个所述密钥分片。
  2. 如权利要求1所述的方法,其特征在于,所述根据参数G将第一密钥分解为多个密钥分片,包括:
    任一所述密钥分片满足:
    其中,a0=第一密钥d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0且小于m的整数集合,不同所选用的x不同,i为不小于t的正整数。
  3. 如权利要求1~2任一项所述的方法,其特征在于,与所述第一密钥对应的第二密钥为(n,e),e为一个大于1的素数,n为两个大素数p和q的乘积,p=2p`+1,q=2q`+1;
    所述第一密钥d满足:
    ed=t mod m
    其中,mod指示取模运算,m=p`q`。
  4. 如权利要求3所述的方法,其特征在于,参数G等于n。
  5. 如权利要求1~4任一项所述的方法,其特征在于,所述t个密钥分片中的部分或全部用于对密文解密,包括:
    所述t个持有者中的部分或全部利用所持有的密钥分片对密文X进行部分解密,获得多个部分解密结果,其中,一个所述持有者获得一个所述部分解密结果;
    基于所述多个部分解密结果以及参数G获得明文。
  6. 如权利要求5所述的方法,其特征在于,所述多个持有者中的部分或全部利用所持有的密钥分片对密文X进行部分解密,包括:
    任一所述密钥分片的持有者获得的部分解密结果满足:
  7. 如权利要求6所述的方法,其特征在于,基于所述多个部分解密结果以及参数G获得明文,包括:
    基于所述多个部分解密结果获得候选明文s*,s*满足:
    其中,S为集合I的子集,S中包括k个元素,集合I包括从1到t的t个正整数,即I={1,2,3……,t};
    若候选明文s*的e次方、以及X取模n同余,候选明文s*即为明文;
    若候选明文s*的e次方、以及X取模n不同余,以候选明文s*为中心,以G为步长增加或减少候选明文s*,确定满足明文条件的次级候选明文,明文条件指示次级候选明文的e次方、以及X取模n同余。
  8. 一种密钥分发装置,其特征在于,所述密钥分发装置包括:
    生成模块,用于根据参数G将第一密钥分解为t个密钥分片,其中,参数G为公开的参 数;t为正整数,所述t个密钥分片中的部分或全部用于对密文解密或对数据进行签名,所述第一密钥是基于RSA算法生成的;
    分发模块,用于分发所述t个密钥分片,使得t个持有者分别持有所述t个密钥分片,其中,一个所述持有者持有一个所述密钥分片。
  9. 如权利要求8所述的装置,其特征在于,所述生成模块,具体用于:任一所述密钥分片满足:
    其中,a0=第一密钥d,a1、a2、...ak-1为Zm中的随机整数,Zm为不小于0且小于m的整数集合,不同所选用的x不同,i为不小于t的正整数。
  10. 如权利要求8~9任一项所述的装置,其特征在于,与所述第一密钥对应的第二密钥为(n,e),e为一个大于1的素数,n为两个大素数p和q的乘积,p=2p`+1,q=2q`+1;
    第一密钥d满足:
    ed=t mod m
    其中,mod指示取模运算,m=p`q`,m=p`q`。
  11. 如权利要求10所述的装置,其特征在于,参数G等于n。
  12. 一种解密装置,其特征在于,所述解密装置包括明文获得模块和多个解密模块,每个所述解密模块持有一个密钥分片,所述密钥分片是根据参数G将第一密钥分解获得的,参数G为公开的参数,所述第一密钥是基于RSA算法生成的;
    任一所述解密模块,用于利用所持有的密钥分片对密文X进行部分解密,获得一个部分解密结果,其中,一个所述解密模块获得一个所述部分解密结果;
    所述明文获得模块,用于基于所述多个解密模块获得的多个部分解密结果以及所述参数G获得明文。
  13. 如权利要求12所述的装置,其特征在于,任一所述解密模块持有的密钥分片所述解密模块获得的部分解密结果满足:
  14. 如权利要求13所述的装置,其特征在于,所述明文获得模块,用于:基于所述多个部分解密结果获得候选明文s*,s*满足:
    其中,S为集合I的子集,S中包括k个元素,集合I包括从1到t的t个正整数,也即I={1,2,3……,t};
    若候选明文s*的e次方、以及X取模n同余,候选明文s*即为明文;
    若候选明文s*的e次方、以及X取模n不同余,以候选明文s*为中心,以G为步长增加或减少候选明文s*,确定满足明文条件的次级候选明文,明文条件指示次级候选明文的e次方、以及X取模n同余。
  15. 一种计算设备,其特征在于,所述计算设备包括处理器和存储器;
    所述存储器,用于存储计算机程序指令;
    所述处理器执行调用所述存储器中的计算机程序指令执行如权利要求1至7中任一项所述的方法。
  16. 一种非瞬态的计算机可读存储介质,其特征在于,所述非瞬态的计算机可读存储介质被计算设备执行时,所述计算设备执行上述权利要求1至7中任一项所述的方法。
PCT/CN2023/087554 2022-04-11 2023-04-11 一种密钥生成方法、装置及设备 WO2023198036A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210371654.X 2022-04-11
CN202210371654 2022-04-11
CN202210761513.9A CN116938468A (zh) 2022-04-11 2022-06-29 一种密钥生成方法、装置及设备
CN202210761513.9 2022-06-29

Publications (1)

Publication Number Publication Date
WO2023198036A1 true WO2023198036A1 (zh) 2023-10-19

Family

ID=88328926

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/087554 WO2023198036A1 (zh) 2022-04-11 2023-04-11 一种密钥生成方法、装置及设备

Country Status (1)

Country Link
WO (1) WO2023198036A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200106606A1 (en) * 2018-09-27 2020-04-02 National Chiao Tung University Post-quantum asymmetric key cryptosystem with one-to-many distributed key management based on prime modulo double encapsulation
CN111858519A (zh) * 2020-07-10 2020-10-30 北京远景视点科技有限公司 一种区块链上机密数据分享的系统及方法
CN112235260A (zh) * 2020-09-25 2021-01-15 建信金融科技有限责任公司 一种匿名数据存证方法、装置、设备和存储介质
CN114006741A (zh) * 2021-10-27 2022-02-01 杭州弦冰科技有限公司 Intel SGX可信服务集群化安全部署的实现方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200106606A1 (en) * 2018-09-27 2020-04-02 National Chiao Tung University Post-quantum asymmetric key cryptosystem with one-to-many distributed key management based on prime modulo double encapsulation
CN111858519A (zh) * 2020-07-10 2020-10-30 北京远景视点科技有限公司 一种区块链上机密数据分享的系统及方法
CN112235260A (zh) * 2020-09-25 2021-01-15 建信金融科技有限责任公司 一种匿名数据存证方法、装置、设备和存储介质
CN114006741A (zh) * 2021-10-27 2022-02-01 杭州弦冰科技有限公司 Intel SGX可信服务集群化安全部署的实现方法及系统

Similar Documents

Publication Publication Date Title
AU2016287728B2 (en) Confidential authentication and provisioning
US11533297B2 (en) Secure communication channel with token renewal mechanism
US8660266B2 (en) Method of delivering direct proof private keys to devices using an on-line service
US10880100B2 (en) Apparatus and method for certificate enrollment
US20170244687A1 (en) Techniques for confidential delivery of random data over a network
JP2019531630A (ja) 量子通信及びトラステッドコンピューティングに基づくデータセキュリティのための方法及びシステム
CN109510708A (zh) 一种基于Intel SGX机制的公钥密码计算方法和系统
US10826694B2 (en) Method for leakage-resilient distributed function evaluation with CPU-enclaves
CN109547209B (zh) 一种两方sm2数字签名生成方法
AU2003202511A1 (en) Methods for authenticating potential members invited to join a group
US20190044922A1 (en) Symmetric key identity systems and methods
CN112740615A (zh) 多方计算的密钥管理
CN114697040A (zh) 一种基于对称密钥的电子签章方法和系统
US20210111906A1 (en) Pseudonym credential configuration method and apparatus
US20230318814A1 (en) Quantum safe key exchange scheme
CN114553566B (zh) 数据加密方法、装置、设备及存储介质
WO2023198036A1 (zh) 一种密钥生成方法、装置及设备
CN114553557A (zh) 密钥调用方法、装置、计算机设备和存储介质
CN114765533A (zh) 一种基于量子密钥通信的远程证明方法、装置及系统
CN105187213A (zh) 一种计算机信息安全的方法
Surya et al. Single sign on mechanism using attribute based encryption in distributed computer networks
Abdalla et al. Anonymous Pairing-Free and Certificateless Key Exchange Protocol for DRM System.
US11743293B2 (en) Remote attestation transport layer security and split trust encryption
CN116938468A (zh) 一种密钥生成方法、装置及设备
RU2771928C2 (ru) Безопасный обмен данными, обеспечивающий прямую секретность

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23787680

Country of ref document: EP

Kind code of ref document: A1