A key distribution method, device, system, electronic equipment and storage medium

By combining lattice cryptography and Chinese national cryptographic algorithms to generate and encrypt keys, the security problem of public-key systems under quantum computing attacks is solved, and the security of key distribution is achieved.

CN118748588BActive Publication Date: 2026-05-19CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2024-07-17
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, quantum computing can break the public key of a public-key cryptosystem within hours, leading to reduced security during key distribution.

Method used

A public-private key pair is generated by combining lattice cipher and Chinese national cryptographic algorithm. The combined private key in the combined public-private key pair is encrypted using the public key of the lattice cipher, and then decrypted using the Chinese national cryptographic algorithm key to ensure the security of the key during transmission.

Benefits of technology

Even under quantum computing attacks, the confidentiality of user private keys can be guaranteed, enabling secure key distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748588B_ABST
    Figure CN118748588B_ABST
Patent Text Reader

Abstract

The application provides a key distribution method, device, system, electronic equipment and storage medium, the method comprises the following steps: generating an entity identifier of a user terminal in response to registration information of the user terminal; generating a public-private key pair of lattice cryptography and a SM algorithm key based on a security parameter; filling the private key of the lattice cryptography into the security medium of the user terminal and filling the SM algorithm key into the security medium of a combined key generation system; obtaining a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the SM algorithm key; encrypting the combined private key in the combined public-private key pair by using the public key of the lattice cryptography to obtain a private key ciphertext; and sending the private key ciphertext and the combined public key in the combined public-private key pair to the user terminal, so that the user terminal decrypts the private key ciphertext by using the private key of the lattice cryptography to obtain the combined private key. In the key transmission process, the public-private key pair of the lattice cryptography is used to encrypt and decrypt the CPK private key, and the safe distribution of the key is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of key security technology, and in particular to a key distribution method, apparatus, system, electronic device, and computer-readable storage medium. Background Technology

[0002] With the rapid development of network technology and the deepening application of internet business systems, the security of online information and business systems has become increasingly prominent. Identity authentication has become a crucial factor in determining system security. Combined Public Key (CPK) technology, based on elliptic curve cryptography and mapping techniques, uniquely identifies individuals and generates an enormous number of public and private key pairs through a certain number of combined public-private key matrix factors. This technology fundamentally solves the problems of scalable key management and the ability of keys themselves to prove identity. The CPK system does not require proof from a trusted third party, offering advantages such as system simplicity, efficiency, and feasibility. It can effectively solve the problem of centralized key management for large-scale distributed applications. Therefore, it has extremely broad development prospects.

[0003] With the development of quantum technology, quantum computing is considered a potential major threat to the future. To counter this threat, post-quantum cryptography (PQC) has developed various cryptographic techniques and algorithms. While these techniques enhance the ability to combat quantum threats, the working principle of all current public-key cryptosystems relies on the public key being publicly available. If the public key is not publicly disclosed, key encryption and signature verification are impossible. With a publicly available public key, the public-key cryptosystem can be broken within hours using quantum computing, allowing the acquisition of the private key corresponding to the published public key.

[0004] Therefore, how to improve the security of key distribution is a technical problem that needs to be solved. Summary of the Invention

[0005] This invention provides a key distribution method, apparatus, system, electronic device, and computer-readable storage medium to at least solve the problem in related technologies where quantum computing can be used to break public-key cryptosystems with publicly available public keys, leading to reduced security during key distribution. The technical solution of this invention is as follows:

[0006] According to a first aspect of the present invention, a key distribution method is provided, the method being applied to a key management system, comprising:

[0007] In response to the user's registration information, generate the entity identifier of the user;

[0008] Based on security parameters, a public-private key pair for a lattice cipher is generated, along with a national cryptographic algorithm key. The private key of the lattice cipher is injected into the secure medium of the user terminal, and the national cryptographic algorithm key is injected into the secure medium of the combined key generation system.

[0009] Based on the entity identifier of the user terminal and the national cryptographic algorithm key, a combined public-private key pair is obtained from the combined key generation system;

[0010] Using the public key of the lattice cipher, the combined private key in the combined public-private key pair is encrypted to obtain the encrypted private key ciphertext;

[0011] The private key ciphertext and the combined public key from the combined public-private key pair are sent to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

[0012] Optionally, obtaining the combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key includes:

[0013] The user terminal requests a combined public-private key pair from the combined key generation system based on its entity identifier.

[0014] Receive the combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is the combined private key ciphertext obtained by the combined key generation system using the national cryptographic algorithm key;

[0015] The combined private key ciphertext is decrypted using the national cryptographic algorithm key to obtain the combined private key, and the combined public key corresponding to the combined private key, which is publicly disclosed by the combined key generation system, is obtained.

[0016] Optionally, the public-private key pair for generating lattice ciphers based on security parameters, and the national cryptographic algorithm key, include:

[0017] Generate an n×m dimensional random matrix A based on a set modulus q, where n and m are natural numbers;

[0018] Obtain the m-dimensional error vector of the random matrix A;

[0019] Based on the m-dimensional error vector, the set modulus q and the random matrix A generate a public-private key pair for lattice cryptography.

[0020] Optionally, based on the m-dimensional error vector, the step of generating a public-private key pair for a lattice cipher using a set modulus q and a random matrix A includes:

[0021] The m-dimensional error vector is used as the private key SK for lattice cipher. PQC ;

[0022] The private key SK based on the lattice cipher PQC The set modulus q and random matrix A are used to generate the public key of the lattice cipher according to the following formula, which is:

[0023] PK PQC =A·SK PQC mod q

[0024] Wherein, the PK PQC The SK is the public key for the lattice cipher. PQC The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus.

[0025] Optionally, the step of injecting the private key from the public-private key pair of the lattice cipher into the secure medium of the user terminal, and injecting the national cryptographic algorithm key into the secure medium of the combined key generation system, includes:

[0026] Write the entity identifier of the user terminal and the private key of the lattice cipher into the secure medium of the user terminal, and write the entity identifier of the user terminal and the national cryptographic algorithm key into the secure medium of the combined key generation system;

[0027] After successful writing, the public and private key pair is registered to generate a key record.

[0028] Optionally, the step of using the public key of the lattice cipher to encrypt the combined private key in the combined public-private key pair to obtain the encrypted private key ciphertext includes:

[0029] Obtain the transpose A of the random matrix A in the public key of the lattice cipher. T ;

[0030] Select a random vector s for each bit value b in the public key of the lattice cipher;

[0031] The vector x corresponding to each bit value in the combined private key is selected based on the probability distribution;

[0032] Based on the transpose A of the random matrix A T A random vector s and a vector x determine the encrypted first private key ciphertext;

[0033] scalar selection based on probability distribution ;

[0034] Obtain the transpose of the public key of the lattice cipher;

[0035] Based on the random vector b and the scalar The transpose of the public key determines the encrypted second private key ciphertext;

[0036] Combine the first private key ciphertext and the second private key ciphertext to obtain the private key ciphertext.

[0037] Optionally, based on the transpose of the random matrix, the random vector, and the vector, the encrypted first private key ciphertext is determined according to the following formula:

[0038]

[0039] Wherein, A T Let x be the transpose of the random matrix A, and let x be the vector corresponding to each bit value in the combined private key. Where q is a set modulus, csk is a combined private key, and s is a random vector of each bit value b in the public key of the lattice cipher;

[0040] Based on the random vector and scalar, and the transpose of the public key, the encrypted second private key ciphertext is determined according to the following formula:

[0041]

[0042] Wherein, the PK PQC T PK for public key in lattice cryptography PQC The transpose of ; s is a random vector of each bit value b in the public key of the lattice cipher, the b is the scalar corresponding to each bit value in the combined private key, b is each bit value in the public key of the lattice cipher, and q is the set modulus.

[0043] According to a second aspect of the present invention, a key distribution method is provided, the method being applied to a combined key generation system, comprising:

[0044] In response to the security medium of the combined key generation system being filled with the national cryptographic algorithm key by the key management system, the private key matrix and public key matrix are initialized;

[0045] A request is received from a user client to combine public and private key pairs, the request including: the entity identifier of the user client;

[0046] Based on the entity identifier of the user terminal, and the private key matrix and public key matrix, a combined public-private key pair is generated;

[0047] The combined private key is encrypted using the national cryptographic algorithm key to obtain ciphertext;

[0048] The ciphertext is sent to the key management system, and the combined public key is made public so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key, and encrypt the combined private key obtained after decryption using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0049] Optionally, generating a combined public-private key pair based on the entity identifier of the user terminal, and the private key matrix and public key matrix, includes:

[0050] The entity identifier of the user terminal is mapped to matrix coordinates to generate a mapping key;

[0051] Obtain the row and column coordinates of the mapped sequence in the mapped key;

[0052] Based on the private key matrix and the row and column coordinates, a combined private key is determined;

[0053] The combined public key is determined based on the combined private key using a doubling-point addition method on an elliptic curve.

[0054] According to a third aspect of the present invention, a key distribution apparatus is provided, the apparatus being applied to a key management system, comprising:

[0055] The first generation module is used to generate the entity identifier of the user terminal in response to the registration information of the user terminal;

[0056] The second generation module is used to generate public and private key pairs for lattice cryptography and national cryptographic algorithm keys based on security parameters;

[0057] The filling module is used to fill the private key of the lattice cipher into the secure medium of the user terminal, and to fill the national cryptographic algorithm key into the secure medium of the combined key generation system;

[0058] The acquisition module is used to acquire a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key;

[0059] An encryption module is used to encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain the encrypted private key ciphertext.

[0060] The sending module is used to send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

[0061] Optionally, the acquisition module includes:

[0062] The application module is used to apply to the combined key generation system for a combined public-private key pair based on the entity identifier of the user terminal;

[0063] The receiving module is used to receive the combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is the combined private key ciphertext obtained by the combined key generation system using the national cryptographic algorithm key;

[0064] The decryption module is used to decrypt the combined private key ciphertext using the national cryptographic algorithm key to obtain the combined private key, and to obtain the combined public key corresponding to the combined private key published by the combined key generation system.

[0065] Optionally, the second generation module includes:

[0066] The matrix generation module is used to generate an n×m dimensional random matrix with a set modulus q based on security parameters, where n and m are natural numbers;

[0067] A vector acquisition module is used to acquire the m-dimensional error vector of the random matrix;

[0068] A key generation module is used to generate a public-private key pair for a lattice cipher based on the m-dimensional error vector, the set modulus q, and the random matrix.

[0069] Optionally, the key generation module includes:

[0070] A private key determination module is used to use the m-dimensional error vector as the private key for the lattice cipher;

[0071] A public key generation module is used to generate the public key of the lattice cipher based on the private key of the lattice cipher, wherein the set modulus q and the random matrix are used to generate the public key of the lattice cipher according to the following formula:

[0072] PK PQC =A·SK PQC mod q

[0073] Wherein, the PK PQC The SK is the public key for the lattice cipher. PQC The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus.

[0074] Optionally, the filling module includes:

[0075] The writing module is used to write the entity identifier of the user terminal and the private key of the lattice cipher into the secure medium of the user terminal, and to write the entity identifier of the user terminal and the national cryptographic algorithm key into the secure medium of the combined key generation system.

[0076] The recording module is used to register the public and private key pair and generate a key record after successful writing.

[0077] Optionally, the encryption module includes:

[0078] The first transpose acquisition module is used to acquire the transpose of the random matrix in the public key of the lattice cipher;

[0079] The selection module is used to select a random vector for each bit value in the public key of the lattice cipher;

[0080] The first selection module is used to select the vector corresponding to each bit value in the combined private key based on a probability distribution.

[0081] The first determining module is used to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector.

[0082] The second selection module is used to select the scalar corresponding to each bit value in the combined private key based on a probability distribution.

[0083] The second transpose acquisition module is used to acquire the transpose of the public key of the lattice cipher;

[0084] The second determining module is used to determine the encrypted second private key ciphertext based on the random vector and scalar, and the transpose of the public key;

[0085] The ciphertext determination module is used to combine the first private key ciphertext and the second private key ciphertext to obtain the private key ciphertext.

[0086] Optionally, the first determining module is specifically used to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector, according to the following formula:

[0087]

[0088] Wherein, A T Let x be the transpose of the random matrix A, and let x be the vector corresponding to each bit value in the combined private key. Where q is a set modulus, csk is a combined private key, and s is a random vector of each bit value b in the public key of the lattice cipher;

[0089] The second determining module is specifically used to determine the encrypted second private key ciphertext based on the random vector and scalar, and the transpose of the public key, according to the following formula:

[0090]

[0091] Wherein, the PK PQC T PK for public key in lattice cryptography PQC The transpose of ; s is a random vector of each bit value b in the public key of the lattice cipher, the b is the scalar corresponding to each bit value in the combined private key, b is each bit value in the public key of the lattice cipher, and q is the set modulus.

[0092] According to a fourth aspect of the present invention, a key distribution apparatus is provided, the apparatus being applied to a combined key generation system, comprising:

[0093] The initialization module is used to initialize the private key matrix and public key matrix in response to the national cryptographic algorithm key injected into the secure medium by the key management system.

[0094] The receiving module is used to receive a request from a user terminal to combine public and private key pairs, the request including: the entity identifier of the user terminal;

[0095] The generation module is used to generate a combined public-private key pair based on the entity identifier of the user terminal, as well as the private key matrix and the public key matrix;

[0096] The encryption module is used to encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext;

[0097] The sending module is used to send the ciphertext to the key management system and publish the combined public key so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key, and encrypt the combined private key obtained after decryption using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0098] Optionally, the generation module includes:

[0099] The mapping module is used to map the entity identifier of the user terminal into matrix coordinates and generate a mapping key;

[0100] The acquisition module is used to obtain the row and column coordinates of the mapping sequence in the mapping key;

[0101] The private key determination module is used to determine the combined private key based on the private key matrix and the row and column coordinates;

[0102] The public key determination module is used to determine the combined public key based on the combined private key by adding points on an elliptic curve.

[0103] According to a fifth aspect of the present invention, a key distribution system is provided, the system comprising: a key management system and a combined key generation system, wherein,

[0104] The key management system is configured to: generate an entity identifier for the user terminal in response to registration information from the user terminal; generate a public-private key pair for a lattice cipher and a national cryptographic algorithm key based on security parameters; inject the private key from the lattice cipher's public-private key pair into the user terminal's secure medium, and inject the national cryptographic algorithm key into the secure medium of the combined key generation system; obtain a combined public-private key pair from the combined key generation system based on the user terminal's entity identifier and the national cryptographic algorithm key; encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain encrypted private key ciphertext; and send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can decrypt the private key ciphertext using the private key of the lattice cipher to obtain the combined private key.

[0105] The combined key generation system is configured to: initialize a private key matrix and a public key matrix in response to the key management system filling the security medium of the combined key generation system with the national cryptographic algorithm key; receive a request from a user terminal to apply for a combined public-private key pair, the request including: the user terminal's entity identifier; generate a combined public-private key pair based on the user terminal's entity identifier, the private key matrix, and the public key matrix; encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext; and send the ciphertext to the key management system and publish the combined public key.

[0106] The key management system is also used to decrypt the ciphertext using the national cryptographic algorithm key, and to encrypt the decrypted combined private key using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0107] According to a sixth aspect of the present invention, an electronic device is provided, comprising:

[0108] processor;

[0109] Memory used to store the processor's executable instructions;

[0110] The processor is configured to execute the instructions to implement the key distribution method as described above.

[0111] According to a seventh aspect of the present invention, a computer-readable storage medium is provided, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the key distribution method as described above.

[0112] According to an eighth aspect of the present invention, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor of an electronic device, implement the key distribution method as described above.

[0113] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects:

[0114] In this embodiment of the invention, in response to the user's registration information, an entity identifier for the user is generated; a public-private key pair for a lattice cipher and a national cryptographic algorithm key are generated based on security parameters; the private key of the lattice cipher is injected into the secure medium of the user, and the national cryptographic algorithm key is injected into the secure medium of the combined key generation system; based on the user's entity identifier and the national cryptographic algorithm key, a combined public-private key pair is obtained from the combined key generation system; the combined private key in the combined public-private key pair is encrypted using the public key of the lattice cipher to obtain encrypted private key ciphertext; the private key ciphertext and the combined public key in the combined public-private key pair are sent to the user, so that the user can decrypt the private key ciphertext using the private key of the lattice cipher to obtain the combined private key. In other words, in this embodiment of the invention, during the transmission of the key from the key management system to the user, the public-private key pair of the lattice cipher is used to encrypt and decrypt the CPK private key, achieving secure key distribution. Even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.

[0115] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0116] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the invention. They do not constitute an undue limitation of the invention. To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0117] Figure 1 This is a flowchart of a key distribution method provided in an embodiment of the present invention.

[0118] Figure 2 This is another flowchart of a key distribution method provided in an embodiment of the present invention.

[0119] Figure 3 This is an interactive flowchart of an application example of a key distribution method provided in an embodiment of the present invention.

[0120] Figure 4 This is a block diagram of a key distribution device provided in an embodiment of the present invention.

[0121] Figure 5 This is another block diagram of a key distribution device provided in an embodiment of the present invention.

[0122] Figure 6 This is a block diagram of a key distribution system provided in an embodiment of the present invention.

[0123] Figure 7 This is an application block diagram of a key distribution system provided in an embodiment of the present invention.

[0124] Figure 8 This is a block diagram of an electronic device provided in an embodiment of the present invention.

[0125] Figure 9 This is a block diagram of a key distribution apparatus provided in an embodiment of the present invention. Detailed Implementation

[0126] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0127] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0128] Technical terms:

[0129] A Certificate Authority (CA) is an independent, trusted third party that issues digital certificates to certificate holders. These digital certificates declare the certificate holder's identity and public key. Before issuing a certificate, the CA must verify the certificate holder's identity information and issue the certificate based on the verification results.

[0130] ECC (Elliptic Curve Cryptography) Composite Theorem: Assume the elliptic curve E is: y 2 =(x 3 +ax+b)mod p, with parameters: Where a and b are coefficients, and a, b, x, y ∈ F p , As the base point of the additive group, n is... Let r be the order of the group with base point r. The sum of any number of private key pairs and the sum of their corresponding public keys constitute a new public-private key pair. Assume the sum of the private keys is: r1 + r2 + ... + r m If n = r, then the sum of the corresponding public keys is: R1 + R2 + ... + R m =R.

[0131] CPK (Combined Public Key) is an encryption algorithm in the field of information security. Developed independently in my country, it is based on the ECC (Encryption and Compatibility) system. CPK allows for the acquisition of public keys without third-party authentication, solving the challenges of identifier-based key management. It also boasts excellent characteristics such as generating large-scale keys with minimal resource consumption.

[0132] PQC (Post-Quantum Cryptography): PQC is a public-key cryptographic scheme that is resistant to quantum computing in classical computing environments. PQC schemes based on the error learning problem are widely used; their security is built upon the worst-case intractability of the lattice problem, making them resistant to quantum attacks.

[0133] A lattice is a mathematical structure, a discrete subset of a multidimensional vector space, defined as a linear combination of integer coefficients of a set of linearly independent non-zero vectors (called a lattice basis). For a sufficiently high-dimensional lattice, it is difficult to find a short lattice basis, or a set of linearly independent short lattice vectors, using a randomly selected set of lattice basis vectors. It can also be understood as lattice cipher.

[0134] Learning With Errors (LWE): Given a random matrix A and a vector b-As+e mod q, where e is the error term and q is a set modulus (usually a large prime number), it is difficult to recover a random s from them.

[0135] SM4 Algorithm: The SM4 national cryptographic algorithm is a symmetric cryptographic algorithm, also known as the SM4 block cipher algorithm, which is widely used in the national cryptographic algorithm standards issued by the State Cryptography Administration of China. The SM4 block cipher algorithm typically has 128-bit blocks and a 128-bit key. Both the encryption and cryptographic expansion algorithms employ a 32-round nonlinear iterative mathematical structure. Each iteration in the algorithm is a nonlinear transformation. Key operations include XOR, permutation, nonlinear iteration, reversal, cyclic shift, and S-box transformation. The mathematical structure, operational rules, and operations of the encryption and decryption algorithms are completely identical; decryption simply involves reversing the round keys generated in the encryption algorithm.

[0136] A U-Key (USB Key) is a secure medium with a USB interface (it can also be considered a USB interface hardware device). It has a built-in microcontroller or smart card chip and some storage space to store the user's private key and digital certificate; the public key algorithm stored in the USB Key can be used to authenticate the user's identity.

[0137] Based on the understanding of the above technical terms, please also refer to the following embodiments.

[0138] Please see Figure 1 This is a flowchart of a key distribution method provided in an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0139] Step 101: In response to the user's registration information, generate the entity identifier of the user.

[0140] Step 102: Generate a public-private key pair for the lattice cipher based on security parameters, and a national cryptographic algorithm key; inject the private key of the lattice cipher into the secure medium of the user terminal, and inject the national cryptographic algorithm key into the secure medium of the combined key generation system.

[0141] Step 103: Based on the entity identifier of the user terminal and the national cryptographic algorithm key, obtain the combined public-private key pair from the combined key generation system.

[0142] Step 104: Using the public key of the lattice cipher, encrypt the combined private key in the combined public-private key pair to obtain the encrypted private key ciphertext.

[0143] Step 105: Send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

[0144] The combined key distribution method described in this invention can be applied to terminals, servers, etc., without limitation. The terminal implementation device can be an electronic device such as a smartphone, laptop, tablet, desktop computer, personal digital assistant (PDA), and wearable device. The server can be an independent server, a server cluster, or a server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, or big data and artificial intelligence platforms, etc., without limitation.

[0145] The following is combined Figure 1 The specific implementation steps of a key distribution method provided in the embodiments of the present invention will be described in detail.

[0146] In step 101, in response to the user's registration information, an entity identifier for the user is generated.

[0147] In this step, the user registers on the key management system through the user terminal. That is, the key management system obtains the user information and generates an entity identifier (ID) for the user, which is referred to as the user terminal entity identifier (ID) in this article.

[0148] In step 102, a public-private key pair for a lattice cipher and a national cryptographic algorithm key are generated based on security parameters. The private key of the lattice cipher is injected into the secure medium of the user terminal, and the national cryptographic algorithm key is injected into the secure medium of the combined key generation system.

[0149] In this step, firstly, after generating an entity identifier for the user, the key management system sets security parameters and, based on the set security parameters, such as λ, generates an n×m dimensional random matrix A with a set modulus q, where n and m are natural numbers. Next, it obtains the m-dimensional error vector of the random matrix A. Finally, based on the m-dimensional error vector, the set modulus q and the random matrix A generate a lattice cryptographic public-private key pair.

[0150] Specifically, in this embodiment, the key management system generates public-private key pairs for lattice cryptography using {PK}. PQC SK PQC} indicates that the private key SK PQC =e, where e is an m-dimensional error vector. The public key is calculated using the following formula, which generates the SM4 key K. The formula is:

[0151] PK PQC =A·SK PQC mod q

[0152] Wherein, the PK PQC The SK is the public key for the lattice cipher. PQC The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus.

[0153] Secondly, the key management system writes the entity identifier of the user terminal and the private key SK of the cipher into the user terminal's secure medium (such as Ukey1). PQC The system writes the entity identifier of the user terminal and the national cryptographic algorithm key K into the secure medium (such as Ukey2) of the combined key generation system; after successful writing, it registers the public and private key pair and generates a key record.

[0154] Specifically, in this embodiment, the security media are Ukey1 and Ukey2, respectively.

[0155] The key management system writes the entity identifier ID and private key SK into Ukey1. PQC Write the entity identifier ID and the national cryptographic algorithm key K into Ukey2. After writing, Ukey1 will by default write the entity identifier ID and private key SK. PQC Ukey2 is written by default with the entity identifier ID and the national cryptographic algorithm key K. In this embodiment, the entity identifier ID can also be replaced with the SIM card's Personal Identification Number (PIN). The PIN is a security measure to protect the SIM card and prevent unauthorized use. Of course, other unique identifiers can also be used instead; this embodiment does not impose any restrictions.

[0156] After successful writing, the key management system registers the key and generates a key record. Then, the key management system can perform card writing operations on Ukey1 and Ukey2.

[0157] In step 103, a combined public-private key pair is obtained from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key.

[0158] In this step, the user terminal requests a public-private key pair from the combined key generation system based on the entity identifier of the user terminal; receives the combined private key ciphertext sent by the combined key generation system, the combined private key ciphertext being the combined private key ciphertext encrypted by the combined key generation system using the national cryptographic algorithm key; decrypts the combined private key ciphertext using the national cryptographic algorithm key to obtain the combined private key, and obtains the combined public key corresponding to the combined private key published by the combined key generation system.

[0159] Specifically, the key management system requests a combined public-private key pair from the combined key generation system based on the user's entity identifier (ID). In this embodiment, a request to request a combined public-private key pair can be sent to the combined public key (CPK) key production system.

[0160] The process by which a combined key generation system generates a combined public-private key pair includes:

[0161] The entity identifier (ID) is mapped to matrix coordinates, generating a mapping key hsk. In this embodiment, the mapping from entity identifier to matrix coordinates is indicated by a YS sequence, which is the output of the entity identifier (ID) after a hash transformation under the mapping key hsk.

[0162] YS = Hash hsk (ID) = w0, w1, w2, ..., w 32

[0163] In the above formula, w0 is represented by u, which represents the starting coordinate of the column, w1, ..., w 32 The row coordinates are represented sequentially. SHA1 is selected as the hash algorithm. SHA1 outputs 160 bits. The lower 5 bits of the first byte are taken to form w0, resulting in a 165-bit mapping sequence.

[0164] Assume the coordinate of the i-th row is w i Let the column coordinates be represented by (u+i-1) mod 32. Then, the combined private key csk is calculated using the following formula:

[0165]

[0166] According to the composition theorem, the combined public key cpk is calculated based on the doubling-point addition on an elliptic curve using the following formula:

[0167]

[0168] It should be noted that the specific production process is already well-known to those skilled in the art, and will not be elaborated upon here.

[0169] In step 104, the public key of the lattice cipher is used to encrypt the combined private key in the combined public-private key pair to obtain the encrypted private key ciphertext.

[0170] In this step, the transpose A of the random matrix A in the public key of the lattice cipher is first obtained. T ; and a random vector s for selecting each bit value b in the public key of the lattice cipher, where b∈{0,1}, Subsequently, based on the probability distribution, a vector x corresponding to each bit value in the combined private key is selected, where, And based on the transpose AT of the random matrix A, the random vector s, and the vector x, the encrypted first private key ciphertext is determined; finally, a scalar is selected based on the probability distribution. ; Obtain the public key PK of the lattice cipher. PQC Transpose PK PQC T Based on the random vector b and the scalar PK PQC T Determine the encrypted second private key ciphertext; combine the first private key ciphertext and the second private key ciphertext to obtain the private key ciphertext.

[0171] In this embodiment, the transpose A of the random matrix A is used. T Given a random vector s and a vector x, the encrypted first private key ciphertext is determined according to the following formula:

[0172]

[0173] Wherein, A T Let x be the transpose of the random matrix A, and let x be the vector corresponding to each bit value in the combined private key. Where q is a set modulus, csk is a combined private key, and s is a random vector of each bit value b in the public key of the lattice cipher;

[0174] The basis is the random vector b and the scalar PK PQC T The encrypted second private key ciphertext is determined according to the following formula:

[0175]

[0176] Wherein, the PK PQC T PK for public key in lattice cryptography PQC The transpose of ; s is a random vector of each bit value b in the public key of the lattice cipher, the b is the scalar corresponding to each bit value in the combined private key, b is each bit value in the public key of the lattice cipher, and q is the set modulus.

[0177] In other words, the final private key ciphertext is The encrypted csk is represented as CT csk .

[0178] In step 105, the private key ciphertext and the combined public key from the combined public-private key pair are sent to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

[0179] In this step, the key management system will use CT csk The cpk is sent to the user terminal, and the user terminal receives the CT. csk After using cpk, use SK PQC CT scan of encrypted text csk Decryption is performed to obtain the combined private key cpk. Then, the calculated combined private key cpk (i.e., the result value) is processed according to the formula... Verify each binary value in the calculated combined private key; if Compare If the value is closer to 0, output 0; otherwise, output 1.

[0180] In this embodiment of the invention, in response to the user's registration information, an entity identifier for the user is generated; a public-private key pair for a lattice cipher and a national cryptographic algorithm key are generated based on security parameters; the private key of the lattice cipher is injected into the secure medium of the user, and the national cryptographic algorithm key is injected into the secure medium of the combined key generation system; based on the user's entity identifier and the national cryptographic algorithm key, a combined public-private key pair is obtained from the combined key generation system; the combined private key in the combined public-private key pair is encrypted using the public key of the lattice cipher to obtain encrypted private key ciphertext; the private key ciphertext and the combined public key in the combined public-private key pair are sent to the user, so that the user can decrypt the private key ciphertext using the private key of the lattice cipher to obtain the combined private key. In other words, in this embodiment of the invention, during the transmission of the key from the key management system to the user, the public-private key pair of the lattice cipher is used to encrypt and decrypt the CPK private key, achieving secure key distribution. Even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.

[0181] Please also see Figure 2 This is another flowchart of a key distribution method provided in an embodiment of the present invention. The method is applied to a combined key generation system and includes:

[0182] Step 201: In response to the security medium of the combined key generation system being filled with the national cryptographic algorithm key by the key management system, initialize the private key matrix and the public key matrix;

[0183] In this step, after the key management system fills the national cryptographic (SM4) algorithm key into the security medium Ukey2 of the combined key generation system, the combined key generation system initializes the private key matrix SSK and the public key matrix PSK.

[0184] The private key matrix consists of elements less than N (where N is the base of an additive group). The order of the group with base point (where is the base point), is composed of mutually exclusive random numbers, and the elements in the matrix are denoted as . The private key matrix is ​​represented as:

[0185]

[0186] The public key matrix is ​​derived from the private key matrix. The public key matrix is ​​represented as:

[0187]

[0188] Step 202: Receive a request from the user client to combine public and private key pairs, the request including: the entity identifier of the user client.

[0189] In this step, the key management system requests the combined public and private key pair from the combined key generation system. The request includes the entity identifier of the user terminal.

[0190] Step 203: Generate a combined public-private key pair based on the entity identifier of the user terminal, the private key matrix, and the public key matrix;

[0191] In this step, the combined key generation system maps the entity identifier of the user terminal to matrix coordinates to generate a mapping key hsk; obtains the row and column coordinates of the mapping sequence in the mapping key hsk; determines the combined private key based on the private key matrix SSK and the row and column coordinates; and determines the combined public key based on the combined private key using a doubling-point addition method on an elliptic curve.

[0192] Specifically, the entity identifier (ID) is mapped to matrix coordinates, generating a mapping key hsk. In this embodiment, the mapping from entity identifier to matrix coordinates is indicated by a YS sequence, which is the output of the entity identifier (ID) after a hash transformation under the mapping key hsk.

[0193] YS = Hash hsk (ID) = w0, w1, w2, ..., w 32

[0194] In the above formula, w0 is represented by u, which represents the starting coordinate of the column, w1, ..., w 32 The row coordinates are represented sequentially. SHA1 is selected as the hash algorithm. SHA1 outputs 160 bits. The lower 5 bits of the first byte are taken to form w0, resulting in a 165-bit mapping sequence.

[0195] Assuming the row coordinate of the i-th iteration is represented by w1 and the column coordinate by (u+i-1)mod 32, the combined private key csk is calculated using the following formula:

[0196]

[0197] According to the composition theorem, the combined public key cpk is calculated based on the doubling-point addition on an elliptic curve using the following formula:

[0198]

[0199] It should be noted that the specific production process is already well-known to those skilled in the art, and will not be elaborated upon here.

[0200] Step 204: Encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext;

[0201] In this step, the combined key generation system uses the SM4 key K to encrypt the combined private key csk to obtain ciphertext.

[0202] Step 205: Send the ciphertext to the key management system and publish the combined public key so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key and encrypt the decrypted combined private key using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0203] In this step, the combined key generation system sends the ciphertext to the key management system and publishes the combined public key cpk.

[0204] Upon receiving the ciphertext, the key management system obtains the corresponding combined public key cpk, decrypts the ciphertext using the national cryptographic algorithm key to obtain the combined private key csk, and then encrypts the obtained combined private key csk using the combined public key cpk to obtain the private key ciphertext CT. csk and the private key ciphertext CT esk The combined public key (cpk) is sent to the client. The client uses SK. PQC CT scan of encrypted text csk Decryption yields the combined private key csk. The specific implementation process is detailed above and will not be repeated here.

[0205] In this embodiment of the invention, a combined key generation system (such as a CPK key generation system) is used. The user's entity identifier (ID) is used to generate a public-private key pair for the user. The combined private key csk is encrypted using the national cryptographic algorithm key to obtain ciphertext. The key is distributed directly between the key management system and the user without relying on third-party proof, making it convenient and fast for users to access.

[0206] Please also see Figure 3 This is an application interaction flowchart of a key distribution method provided by an embodiment of the present invention. The application example is illustrated using three entities: a user terminal, a key management system, and a CPK key generation system. The user terminal possesses a secure medium Ukey1 (i.e., the user terminal includes a secure medium Ukey1 connected to it); the key management system is responsible for key management of the national cryptographic algorithms and CPK algorithms involved in the system, as well as direct interaction with the user; the CPK key generation system possesses a secure medium Ukey2 (i.e., the CPK key generation system includes a secure medium Ukey2 connected to it) and is responsible for generating CPK public-private key pairs. The method specifically includes:

[0207] Step 301: The user registers with the key management system through the user terminal;

[0208] Step 302: Register user information with the key management system and generate entity identifiers (IDs) for users;

[0209] Step 303: The key management system generates a public-private key pair for the lattice cryptography and a national cryptographic algorithm key (i.e., the SM4 algorithm key);

[0210] Step 304: The key management system fills the user's secure medium Ukey1 with the private key of the coded password;

[0211] Step 305: The key management system fills the Ukey2 of the combined key generation system with the SM4 algorithm key;

[0212] It should be noted that steps 304 and 305 can be understood as key initialization. In specific implementations, these two steps are not necessarily in any particular order and can be performed simultaneously; this embodiment does not impose any restrictions.

[0213] Step 306: The CPK key generation system initializes the private key matrix and public key matrix;

[0214] Step 307: The key management system requests the combined key generation system to combine public and private key pairs, the request including: the entity identifier of the user terminal;

[0215] Step 308: The CPK key generation system generates a combined public-private key pair based on the entity identifier of the user terminal, as well as the private key matrix and the public key matrix.

[0216] Step 309: The CPK key generation system uses the national cryptographic algorithm key to encrypt the combined private key to obtain ciphertext;

[0217] Step 310: The CPK key generation system sends the ciphertext to the key management system and publishes the combined public key cpk;

[0218] Step 311: The key management system uses the national cryptographic algorithm key to decrypt the ciphertext to obtain the combined private key;

[0219] Step 312: The key management system obtains the combined public key corresponding to the combined private key published by the combined key generation system;

[0220] Step 313: The key management system uses the public key of the lattice cipher to encrypt the combined private key to obtain the encrypted private key ciphertext.

[0221] Step 314: The key management system sends the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal;

[0222] Step 315: The user terminal uses the private key of the lattice cipher to decrypt the private key ciphertext to obtain the combined private key.

[0223] In this embodiment, the specific implementation process of each step is detailed in the corresponding implementation process in the above embodiments, and will not be repeated here.

[0224] In this embodiment of the invention, a key distribution method is provided. The key distributed is a quantum-resistant key based on lattice cryptography. That is, during the transmission of the key from the key management system to the user terminal, the public and private keys of lattice cryptography are used to encrypt and decrypt the combined CPK private key, thereby achieving secure key distribution. Even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.

[0225] This invention also employs a difficult problem based on fault-tolerant learning (LWE), using polynomials with added noise to provide some "approximate" stochastic linear equations about the secret vector S, making it impossible to recover the secret vector S. The CPK combined public-key system used is an improvement on the PKI system. It generates public-private key pairs for users using their entity identifier (ID). The authentication relationship is confirmed during user registration, and the public and private keys do not need to be specifically linked together or rely on third-party proofs, facilitating key generation, management, and maintenance.

[0226] The embodiments of the present invention also employ the national cryptographic SM4 algorithm to encrypt the CPK private key during transmission between the combined key generation system and the key management system, thereby protecting the confidentiality of the key transmission between internal systems.

[0227] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the present invention.

[0228] Please also see Figure 4 This is a block diagram of a key distribution device provided in an embodiment of the present invention. The device is applied to a key management system and includes: a first generation module 401, a second generation module 402, a filling module 403, an acquisition module 404, an encryption module 405, and a sending module 406, wherein...

[0229] The first generation module 401 is used to generate the entity identifier of the user terminal in response to the registration information of the user terminal;

[0230] The second generation module 402 is used to generate public and private key pairs for lattice cryptography and national cryptographic algorithm keys based on security parameters.

[0231] The filling module 403 is used to fill the private key of the lattice cipher into the security medium of the user terminal, and to fill the national cryptographic algorithm key into the security medium of the combined key generation system;

[0232] The acquisition module 404 is used to acquire a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key;

[0233] Encryption module 405 is used to encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain the encrypted private key ciphertext.

[0234] The sending module 406 is used to send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

[0235] Optionally, the acquisition module includes:

[0236] The application module is used to apply to the combined key generation system for a combined public-private key pair based on the entity identifier of the user terminal;

[0237] The receiving module is used to receive the combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is the combined private key ciphertext obtained by the combined key generation system using the national cryptographic algorithm key;

[0238] The decryption module is used to decrypt the combined private key ciphertext using the national cryptographic algorithm key to obtain the combined private key, and to obtain the combined public key corresponding to the combined private key published by the combined key generation system.

[0239] Optionally, the second generation module includes:

[0240] The matrix generation module is used to generate an n×m dimensional random matrix with a set modulus q based on security parameters, where n and m are natural numbers;

[0241] A vector acquisition module is used to acquire the m-dimensional error vector of the random matrix;

[0242] A key generation module is used to generate a public-private key pair for a lattice cipher based on the m-dimensional error vector, the set modulus q, and the random matrix.

[0243] Optionally, the key generation module includes:

[0244] A private key determination module is used to use the m-dimensional error vector as the private key for the lattice cipher;

[0245] A public key generation module is used to generate the public key of the lattice cipher based on the private key of the lattice cipher, wherein the set modulus q and the random matrix are used to generate the public key of the lattice cipher according to the following formula:

[0246] PK PQC =A·SK PQC mod q

[0247] Wherein, the PK PQC The SK is the public key for the lattice cipher. PQC The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus.

[0248] Optionally, the filling module includes:

[0249] The writing module is used to write the entity identifier of the user terminal and the private key of the lattice cipher into the secure medium of the user terminal, and to write the entity identifier of the user terminal and the national cryptographic algorithm key into the secure medium of the combined key generation system.

[0250] The recording module is used to register the public and private key pair and generate a key record after successful writing.

[0251] Optionally, the encryption module includes:

[0252] The first transpose acquisition module is used to acquire the transpose of the random matrix in the public key of the lattice cipher;

[0253] The selection module is used to select a random vector for each bit value in the public key of the lattice cipher;

[0254] The first selection module is used to select the vector corresponding to each bit value in the combined private key based on a probability distribution.

[0255] The first determining module is used to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector.

[0256] The second selection module is used to select the scalar corresponding to each bit value in the combined private key based on a probability distribution.

[0257] The second transpose acquisition module is used to acquire the transpose of the public key of the lattice cipher;

[0258] The second determining module is used to determine the encrypted second private key ciphertext based on the random vector and scalar, and the transpose of the public key;

[0259] The ciphertext determination module is used to combine the first private key ciphertext and the second private key ciphertext to obtain the private key ciphertext.

[0260] Optionally, the first determining module is specifically used to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector, according to the following formula:

[0261]

[0262] Wherein, A T Let x be the transpose of the random matrix A, and let x be the vector corresponding to each bit value in the combined private key. Where q is a set modulus, csk is a combined private key, and s is a random vector of each bit value b in the public key of the lattice cipher;

[0263] The second determining module is specifically used to determine the encrypted second private key ciphertext based on the random vector and scalar, and the transpose of the public key, according to the following formula:

[0264]

[0265] Wherein, the PK PQC T PK for public key in lattice cryptography PQC The transpose of ; s is a random vector of each bit value b in the public key of the lattice cipher, the b is the scalar corresponding to each bit value in the combined private key, b is each bit value in the public key of the lattice cipher, and q is the set modulus.

[0266] Please also see Figure 5 This is another block diagram of a key distribution device provided in an embodiment of the present invention. The device is applied to a combined key generation system and includes: an initialization module 501, a receiving module 502, a generation module 503, an encryption module 504, and a sending module 505, wherein...

[0267] Initialization module 501 is used to initialize the private key matrix and public key matrix in response to the national cryptographic algorithm key injected into the security medium Ukey2 by the key management system.

[0268] The receiving module 502 is used to receive a request from a user terminal to combine public and private key pairs, the request including: the entity identifier of the user terminal;

[0269] The generation module 503 is used to generate a combined public-private key pair based on the entity identifier of the user terminal, as well as the private key matrix and the public key matrix;

[0270] Encryption module 504 is used to encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext;

[0271] The sending module 505 is used to send the ciphertext to the key management system and publish the combined public key so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key, and encrypt the combined private key obtained after decryption using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0272] Optionally, the generation module includes:

[0273] The mapping module is used to map the entity identifier of the user terminal into matrix coordinates and generate a mapping key;

[0274] The acquisition module is used to obtain the row and column coordinates of the mapping sequence in the mapping key;

[0275] The private key determination module is used to determine the combined private key based on the private key matrix and the row and column coordinates;

[0276] The public key determination module is used to determine the combined public key based on the combined private key by adding points on an elliptic curve.

[0277] Please also see Figure 6 This is a block diagram of a key distribution system provided in an embodiment of the present invention. The system includes: a key management system 601 and a combined key generation system 602, wherein...

[0278] The key management system 601 is configured to: generate an entity identifier for the user terminal in response to registration information from the user terminal; generate a public-private key pair for a lattice cipher and a national cryptographic algorithm key based on security parameters; inject the private key from the lattice cipher's public-private key pair into the user terminal's secure medium, and inject the national cryptographic algorithm key into the secure medium of the combined key generation system; obtain a combined public-private key pair from the combined key generation system based on the user terminal's entity identifier and the national cryptographic algorithm key; encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain encrypted private key ciphertext; and send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can decrypt the private key ciphertext using the private key of the lattice cipher to obtain the combined private key.

[0279] The combined key generation system 602 is configured to: initialize a private key matrix and a public key matrix in response to the key management system filling the security medium of the combined key generation system with the national cryptographic algorithm key; receive a request from a user terminal to apply for a combined public-private key pair, the request including: the entity identifier of the user terminal; generate a combined public-private key pair based on the entity identifier of the user terminal, and the private key matrix and public key matrix; encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext; send the ciphertext to the key management system and publish the combined public key;

[0280] The key management system 601 is also used to decrypt the ciphertext using the national cryptographic algorithm key, and to encrypt the decrypted combined private key using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

[0281] Please also see Figure 7 This is an application block diagram of a key distribution system provided in an embodiment of the present invention. As shown in the figure, it includes: a key management system, a CPK key generation system, and users (or user terminals), wherein the key management system is connected to both the CPK key generation system (including Ukey2) and the users (including Ukey1), as specifically shown in the figure:

[0282] 1. The key management system registers user information, generates user identifier IDs (i.e., the entity identifier of the user terminal), and generates public and private key pairs (PK_PQC, SK_PQC) for ciphertext (i.e., PK...). PQC SK PQC );

[0283] 2. The key management system feeds the private key SK_PQC into Ukey1;

[0284] 3. The key management system feeds the private key Guomo algorithm key K (i.e., SK4 algorithm key K) into Ukey2;

[0285] 4. The key management system requests a CPK key pair from the CPK key generation system based on the user ID registered by the user;

[0286] 5. The CPK key generation system initializes the private key matrix SSK and the public key matrix PSK, generates a CPK public-private key pair based on the user ID, and uses the SM4 key K to encrypt and combine the private key CSK to obtain ciphertext. The ciphertext is then sent to the key management system to publicly combine the public key CPK.

[0287] 6. The key management system uses the SM4 key K to decrypt the ciphertext, obtaining the combined private key CSK, and then uses PK_PQC to encrypt CSK, obtaining the key ciphertext CT. csk and the key ciphertext CT esk And CPK are sent to the user;

[0288] 7. Users use SK_PQC to process encrypted CT. csk Decryption yields the combined private key CSK.

[0289] This invention employs a lattice cryptography based on the LWE (Low-Weighted Evidence) problem for the encrypted distribution of CPK (Concurrent Key-Based Key) combination private keys. Leveraging the difficulty of the LWE problem, it resists quantum computing attacks, making it technically impossible to recover the encrypted private key via quantum computing, thus ensuring the confidentiality of the user's private key. Furthermore, due to the linear structure of lattices, most operations on lattices are linear, resulting in a novel public-key cryptosystem built using lattice theory with faster computation speed.

[0290] The embodiments of the present invention employ the national cryptographic SM4 algorithm, utilize a secure medium to store the symmetric key, and encrypt the CPK private key during transmission from the CPK key generation system and the key management system, thereby protecting the confidentiality of the key transmission between internal systems.

[0291] The CPK combined public key system adopted in this invention, compared with the existing PKI system where the generation of public keys relies on a third-party CA authentication chain, uses the user's entity identifier (ID). The key management system uniformly generates public and private key pairs for users. The key management system and users distribute keys face-to-face, without relying on third-party proof, making it convenient and fast for users to access.

[0292] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0293] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0294] Figure 8 This is a block diagram of an electronic device 800 provided in an embodiment of the present invention. For example, the electronic device 800 can be a mobile terminal or a server; in this embodiment, a mobile terminal is used as an example for explanation. For example, the electronic device 800 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0295] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0296] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0297] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0298] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.

[0299] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0300] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0301] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0302] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0303] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0304] In an embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the key distribution method described above.

[0305] In this embodiment, a computer-readable storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device 800 to perform the key distribution method described above. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0306] In one embodiment, a computer program product is also provided, including a computer program or instructions that, when executed by the processor 820 of the electronic device 800, cause the electronic device 800 to perform the key distribution method described above.

[0307] Figure 9 This is a block diagram of a key distribution apparatus 900 provided in an embodiment of the present invention. For example, apparatus 900 can be provided as a server. (See also...) Figure 9 The apparatus 900 includes a processing component 922, which further includes one or more processors, and memory resources represented by memory 932 for storing instructions, such as application programs, that can be executed by the processing component 922. The application programs stored in memory 932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 922 is configured to execute instructions to perform the methods described above.

[0308] The device 900 may also include a power supply component 926 configured to perform power management of the device 900, a wired or wireless network interface 950 configured to connect the device 900 to a network, and an input / output (I / O) interface 958. The device 900 can operate on an operating system stored in memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0309] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0310] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A key distribution method, characterized in that, The method is applied to a key management system and includes: In response to the user's registration information, generate the entity identifier of the user; Based on preset safety parameters, generate a set modulus. A 3D random matrix, where n and m are positive integers related to the security parameters; the set modulus is a large prime number; Obtain the m-dimensional error vector of the random matrix, where the m-dimensional error vector of the random matrix is ​​the private key of the lattice cipher; pass Calculate the public key of the lattice cipher and generate the national cryptographic algorithm key; wherein, the... The public key for the lattice cipher, the The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus; the national cryptographic algorithm key is the SM4 algorithm key. Based on security parameters, a public-private key pair for a lattice cipher is generated, along with a national cryptographic algorithm key. The private key of the lattice cipher is injected into the secure medium of the user terminal, and the national cryptographic algorithm key is injected into the secure medium of the combined key generation system. Based on the entity identifier of the user terminal and the national cryptographic algorithm key, a combined public-private key pair is obtained from the combined key generation system; Using the public key of the lattice cipher, the combined private key in the combined public-private key pair is encrypted to obtain the encrypted private key ciphertext; The private key ciphertext and the combined public key from the combined public-private key pair are sent to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

2. The key distribution method according to claim 1, characterized in that, The step of obtaining a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key includes: The user terminal requests a combined public-private key pair from the combined key generation system based on its entity identifier. Receive the combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is the combined private key ciphertext obtained by the combined key generation system using the national cryptographic algorithm key; The combined private key ciphertext is decrypted using the national cryptographic algorithm key to obtain the combined private key, and the combined public key corresponding to the combined private key, which is publicly disclosed by the combined key generation system, is obtained.

3. The key distribution method according to claim 1 or 2, characterized in that, The step of injecting the private key from the public-private key pair of the lattice cipher into the secure medium of the user terminal, and injecting the national cryptographic algorithm key into the secure medium of the combined key generation system, includes: Write the entity identifier of the user terminal and the private key of the lattice cipher into the secure medium of the user terminal, and write the entity identifier of the user terminal and the national cryptographic algorithm key into the secure medium of the combined key generation system; After successful writing, the public and private key pair is registered to generate a key record.

4. The key distribution method according to claim 1 or 2, characterized in that, The step of encrypting the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain the encrypted private key ciphertext includes: Obtain the transpose of the random matrix in the public key of the lattice cipher; Select a random vector of each bit value from the public key of the lattice cipher; The vector corresponding to each bit value in the combined private key is selected based on the probability distribution; Based on the transpose of the random matrix, the random vector, and the vector, the encrypted first private key ciphertext is determined; The scalar corresponding to each bit value in the combined private key is selected based on the probability distribution. Obtain the transpose of the public key of the lattice cipher; Based on the random vector and scalar, and the transpose of the public key, the encrypted second private key ciphertext is determined; Combine the first private key ciphertext and the second private key ciphertext to obtain the private key ciphertext.

5. A key distribution method, characterized in that, The method is applied to a combined key generation system, including: In response to the security medium of the combined key generation system being filled with the national cryptographic algorithm key by the key management system, the private key matrix and public key matrix are initialized; The system receives a request from the key management system to combine public and private key pairs, the request including: the entity identifier of the user terminal; Based on the entity identifier of the user terminal, and the private key matrix and public key matrix, a combined public-private key pair is generated; The combined private key is encrypted using the national cryptographic algorithm key to obtain ciphertext; The ciphertext is sent to the key management system, and the combined public key is made public so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key, and encrypt the combined private key obtained after decryption using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

6. The key distribution method according to claim 5, characterized in that, The step of generating a combined public-private key pair based on the entity identifier of the user terminal, and the private key matrix and public key matrix, includes: The entity identifier of the user terminal is mapped to matrix coordinates to generate a mapping key; Obtain the row and column coordinates of the mapped sequence in the mapped key; Based on the private key matrix and the row and column coordinates, a combined private key is determined; The combined public key is determined based on the combined private key using a doubling-point addition method on an elliptic curve.

7. A key distribution device, characterized in that, The device is used in a key management system and includes: The first generation module is used to generate the entity identifier of the user terminal in response to the registration information of the user terminal; The second generation module is used to generate a set modulus based on preset security parameters. A 3D random matrix, where n and m are positive integers related to the security parameters; the set modulus is a large prime number; Obtain the random matrix The m-dimensional error vector of the random matrix is ​​the private key of the lattice cipher; pass Calculate the public key of the lattice cipher and generate the national cryptographic algorithm key. Among them, the The public key for the lattice cipher, the The private key for the lattice cipher is A, where A is a random matrix and q is a set modulus; the national cryptographic algorithm key is the SM4 algorithm key. The filling module is used to fill the private key of the lattice cipher into the secure medium of the user terminal, and to fill the national cryptographic algorithm key into the secure medium of the combined key generation system; The acquisition module is used to acquire a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national cryptographic algorithm key; An encryption module is used to encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain the encrypted private key ciphertext. The sending module is used to send the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can use the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key.

8. A key distribution device, characterized in that, The apparatus is used in a combined key generation system and includes: The initialization module is used to initialize the private key matrix and public key matrix in response to the national cryptographic algorithm key injected into the secure medium by the key management system. The receiving module is used to receive a request from the key management system to combine public and private key pairs, the request including: the entity identifier of the user terminal; The generation module is used to generate a combined public-private key pair based on the entity identifier of the user terminal, as well as the private key matrix and the public key matrix; The encryption module is used to encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext; The sending module is used to send the ciphertext to the key management system and publish the combined public key so that the key management system can decrypt the ciphertext using the national cryptographic algorithm key, and encrypt the combined private key obtained after decryption using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

9. A key distribution system, characterized in that, The system includes: a key management system and a combined key generation system, wherein... The key management system is used to generate an entity identifier for the user terminal in response to the user terminal's registration information; and to generate a key identifier based on preset security parameters and a set modulus. A dimensional random matrix is ​​obtained, where n and m are positive integers related to the security parameters; the set modulus is a large prime number; the random matrix is ​​then obtained. An m-dimensional error vector, wherein the m-dimensional error vector of the random matrix is ​​the private key of the lattice cipher; through Calculate the public key of the lattice cipher and generate the national cryptographic algorithm key. Among them, the The public key for the lattice cipher, the The method involves: using a lattice cipher private key, where A is a random matrix and q is a set modulus; using the national cryptographic algorithm key (SM4 algorithm key); injecting the private key from the lattice cipher public-private key pair into the secure medium of the user terminal, and injecting the national cryptographic algorithm key into the secure medium of the combined key generation system; obtaining a combined public-private key pair from the combined key generation system based on the user terminal's entity identifier and the national cryptographic algorithm key; encrypting the combined private key in the combined public-private key pair using the lattice cipher public key to obtain encrypted private key ciphertext; and sending the private key ciphertext and the combined public key from the combined public-private key pair to the user terminal, so that the user terminal can decrypt the private key ciphertext using the lattice cipher private key to obtain the combined private key. The combined key generation system is configured to: initialize a private key matrix and a public key matrix in response to the key management system filling the security medium of the combined key generation system with the national cryptographic algorithm key; receive a request from a user terminal to apply for a combined public-private key pair, the request including: the user terminal's entity identifier; generate a combined public-private key pair based on the user terminal's entity identifier, the private key matrix, and the public key matrix; encrypt the combined private key using the national cryptographic algorithm key to obtain ciphertext; and send the ciphertext to the key management system and publish the combined public key. The key management system is also used to decrypt the ciphertext using the national cryptographic algorithm key, and to encrypt the decrypted combined private key using the combined public key, and send the obtained private key ciphertext and combined public key to the user terminal.

10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the key distribution method as described in any one of claims 1 to 6.

11. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the key distribution method as described in any one of claims 1 to 6.