Key distribution method, device and system, electronic equipment and storage medium
Through the combination of lattice cryptography and the national secret algorithm, the key distribution security problem of the public key system under quantum computing attacks is solved, and the secure transmission of the key is achieved.
Patent Information
- Application Number
- CN202410962560.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-17
AI Technical Summary
When the existing public key system faces quantum computing attacks, the public public key is easily cracked, resulting in reduced security during key distribution.
Adopting the public and private key pair encryption and decryption technology of lattice cipher, by generating the public and private key pair of lattice cipher and using the national secret algorithm key, the combined public and private keys are encrypted to ensure the security of the key during transmission.
Even under quantum computing attacks, the confidentiality of users' private keys can be guaranteed and the secure distribution of keys can be achieved.
Smart Images

Figure CN118748588A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of key security technology, and in particular to a key distribution method, device, system, electronic device and computer-readable storage medium. Background Art
[0002] With the rapid development of network technology and the gradual deepening of the application of Internet business systems, people are increasingly concerned about the security of online information and business systems. Identity authentication has become an important link in determining system security. Combined public key (CPK) technology is uniquely determined by identity identification. It is based on elliptic curve cryptography and mapping technology. Through a certain number of combined public and private key matrix factors, it can generate a huge number of public and private key pairs. The technology itself solves the problem of large-scale key management and the key itself can prove the identity. The CPK system does not require certification from a trusted third party. It has the advantages of a simple, efficient and feasible system. It can effectively solve the problem of centralized management of large-scale keys for a variety of distributed applications. Therefore, it has extremely broad development prospects.
[0003] With the development of quantum technology, quantum computing is considered to be a major threat to the future. In order to resist the threat brought by quantum computing, Post Quantum Cryptography (PQC) has developed a variety of cryptographic technologies and algorithms. Although it can enhance the ability to resist quantum threats, the working principle of all public key systems is to make the public key public. If the public key is not public, key encryption and signature verification cannot be performed. If the public key is public, the public key system will be broken through quantum computing within a few hours, thereby obtaining the private key corresponding to the 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] The present invention provides a key distribution method, device, system, electronic device and computer-readable storage medium to at least solve the problem in the related art that quantum computing can be used to break the public key system through the public key, resulting in reduced security during key distribution. The technical solution of the present invention is as follows:
[0006] According to a first aspect of an embodiment 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 registration information of the user terminal, generating an entity identification of the user terminal;
[0008] Generate a public and private key pair of the lattice cipher and a national secret algorithm key based on the security parameters, inject the private key of the lattice cipher into the security medium of the user end, and inject the national secret algorithm key into the security medium of the combined key generation system;
[0009] Based on the entity identification of the user terminal and the national secret algorithm key, obtaining a combined public and private key pair from the combined key generation system;
[0010] Using the public key of the lattice cipher, encrypting the combined private key in the combined public-private key pair to obtain an encrypted private key ciphertext;
[0011] The private key ciphertext and the combined public key in the combined public-private key pair are sent to the user end, so that the user end uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
[0012] Optionally, the acquiring a combined public-private key pair from the combined key generation system based on the entity identifier of the user terminal and the national encryption algorithm key includes:
[0013] Applying for a combined public-private key pair from the combined key generation system according to the entity identification of the user terminal;
[0014] Receiving a combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is a combined private key ciphertext encrypted by the combined key generation system using the national secret algorithm key;
[0015] The combined private key ciphertext is decrypted using the national secret algorithm key to obtain the combined private key, and the combined public key corresponding to the combined private key that is published by the combined key generation system is obtained.
[0016] Optionally, the public and private key pairs of the lattice cryptography generated based on the security parameters, and the national secret algorithm key, include:
[0017] Generate an n×m-dimensional random matrix A under a set modulus q based on the security parameter, where n and m are natural numbers;
[0018] Get 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 and private key pair of the lattice cipher.
[0020] Optionally, the generating a public and private key pair of a lattice cipher based on the m-dimensional error vector, the setting modulus q and the random matrix A includes:
[0021] The m-dimensional error vector is used as the private key SK of the lattice cipher PQC ;
[0022] The private key SK based on the lattice password PQC , the set modulus q and random matrix A generate the public key of the lattice cipher according to the following formula, the formula is:
[0023] PK PQC =A·SK PQC mod q
[0024] Among them, the PK PQC is the public key of the lattice cipher, the SK PQC is the private key of the lattice cipher, A is a random matrix, and q is a set modulus.
[0025] Optionally, the step of injecting the private key of the public-private key pair of the lattice cipher into a secure medium of the user terminal, and injecting the national secret algorithm key into a secure medium of a combined key generation system, comprises:
[0026] Writing the entity identification of the user terminal and the private key of the cipher into the secure medium of the user terminal, and writing the entity identification of the user terminal and the national secret algorithm key into the secure medium of the combined key generation system;
[0027] After the writing is successful, the public-private key pair is registered to generate a key record.
[0028] Optionally, the 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] Get the transpose A of the random matrix A in the public key of the lattice cipher T ;
[0030] Selecting a random vector s for each bit value b in the public key of the lattice cipher;
[0031] Selecting a vector x corresponding to each bit value in the combined private key based on a probability distribution;
[0032] Based on the transpose A of the random matrix A T , random vector s, and vector x, determine the encrypted first private key ciphertext;
[0033] Selecting a scalar based on a probability distribution ;
[0034] Obtaining the transpose of the public key of the lattice cipher;
[0035] Based on the random vector b and the scalar , transpose of the public key to determine the encrypted second private key ciphertext;
[0036] The first private key ciphertext and the second private key ciphertext are combined to obtain a 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] Among them, the A T is the transpose of the random matrix A, and x is the vector corresponding to each bit value in the combined private key. The q is the set modulus, the csk is the combined private key; the s is the random vector of each bit value b in the public key of the lattice cipher;
[0040] Based on the random vector and the scalar, the transposition of the public key is used to determine the encrypted second private key ciphertext according to the following formula:
[0041]
[0042] Among them, the PK PQC T The public key PK of the lattice cipher PQC The transpose of ; the s is a random vector of each bit value b in the public key of the lattice cipher, the 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 an embodiment 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 charged with the national secret algorithm key by the key management system, the private key matrix and the public key matrix are initialized;
[0045] A request from a user terminal for applying for a combined public-private key pair is received, the request including: an entity identifier of the user terminal;
[0046] Generate a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix;
[0047] Encrypting the combined private key using the national secret algorithm key to obtain a 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 uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
[0049] Optionally, generating a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix includes:
[0050] Mapping the entity identifier of the user terminal into matrix coordinates to generate a mapping key;
[0051] Get the row and column coordinates of the mapping sequence in the mapping key;
[0052] Determine a combined private key based on the private key matrix and the row and column coordinates;
[0053] Based on the combined private key, a combined public key is determined according to point-doubled addition on an elliptic curve.
[0054] According to a third aspect of an embodiment of the present invention, a key distribution device is provided, the device being applied to a key management system, comprising:
[0055] A first generating module, configured to generate an entity identifier of the user terminal in response to registration information of the user terminal;
[0056] The second generation module is used to generate a public and private key pair of a lattice cipher and a national secret algorithm key based on security parameters;
[0057] A charging module, used to charge the private key of the grid cipher into the secure medium of the user terminal, and to charge the national secret algorithm key into the secure medium of the combined key generation system;
[0058] An acquisition module, used to acquire a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key;
[0059] An encryption module, used to encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain an encrypted private key ciphertext;
[0060] The sending module is used to send the private key ciphertext and the combined public key in the combined public-private key pair to the user end, so that the user end uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
[0061] Optionally, the acquisition module includes:
[0062] An application module, used for applying for a combined public-private key pair from the combined key generation system according to the entity identification of the user terminal;
[0063] A receiving module, used to receive a combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is a combined private key ciphertext encrypted by the combined key generation system using the national secret algorithm key;
[0064] The decryption module is used to decrypt the combined private key ciphertext using the national secret algorithm key to obtain the combined private key, and to obtain the combined public key corresponding to the combined private key disclosed by the combined key generation system.
[0065] Optionally, the second generating module includes:
[0066] A matrix generation module, used for generating an n×m dimensional random matrix under a set modulus q based on a security parameter, where n and m are natural numbers;
[0067] A vector acquisition module, used to obtain an m-dimensional error vector of the random matrix;
[0068] A key generation module is used to generate a public and private key pair of 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, used for using the m-dimensional error vector as a private key of a lattice cipher;
[0071] A public key generation module is used to generate a public key of the lattice cipher based on the private key of the lattice cipher, the set modulus q and the random matrix according to the following formula, wherein the formula is:
[0072] PK PQC =A·SK PQC mod q
[0073] Among them, the PK PQC is the public key of the lattice cipher, the SK PQC is the private key of the lattice cipher, A is a random matrix, and q is a set modulus.
[0074] Optionally, the charging module includes:
[0075] A writing module, used to write the entity identification of the user terminal and the private key of the cipher into the secure medium of the user terminal, and write the entity identification of the user terminal and the national secret algorithm key into the secure medium of the combined key generation system;
[0076] The recording module is used to register the public-private key pair and generate a key record after the writing is successful.
[0077] Optionally, the encryption module includes:
[0078] A first transposition acquisition module, used to obtain the transposition of the random matrix in the public key of the lattice cipher;
[0079] A selection module, used for selecting a random vector of each bit value in the public key of the lattice cipher;
[0080] A first selection module, configured to select a vector corresponding to each bit value in the combined private key based on a probability distribution;
[0081] A first determination module, configured to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector;
[0082] A second selection module, configured to select a scalar corresponding to each bit value in the combined private key based on a probability distribution;
[0083] A second transposition acquisition module, used to obtain the transposition of the public key of the lattice cipher;
[0084] A second determination module, configured to determine an encrypted second private key ciphertext based on the random vector and the 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 a private key ciphertext.
[0086] Optionally, the first determination module is specifically configured to determine the encrypted first private key ciphertext according to the following formula based on the transpose of the random matrix, the random vector, and the vector:
[0087]
[0088] Among them, the A T is the transpose of the random matrix A, and x is the vector corresponding to each bit value in the combined private key. The q is the set modulus, the csk is the combined private key; the s is the random vector of each bit value b in the public key of the lattice cipher;
[0089] The second determination module is specifically configured to determine the encrypted second private key ciphertext according to the following formula based on the random vector and the scalar and the transposition of the public key:
[0090]
[0091] Among them, the PK PQC T The public key PK of the lattice cipher PQC The transpose of ; the s is a random vector of each bit value b in the public key of the lattice cipher, the 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 an embodiment of the present invention, a key distribution device is provided, the device being applied to a combined key generation system, comprising:
[0093] An initialization module, used to initialize a private key matrix and a public key matrix in response to a national secret algorithm key injected into a secure medium by a key management system;
[0094] The receiving module is used to receive a request from a user terminal for applying for a combined public-private key pair, wherein the request includes: an entity identifier of the user terminal;
[0095] A generating module, used for generating a combined public-private key pair according to the entity identification of the user terminal, and the private key matrix and the public key matrix;
[0096] An encryption module, used to encrypt the combined private key using the national secret algorithm key to obtain a 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 uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
[0098] Optionally, the generating module includes:
[0099] A mapping module, used to map the entity identifier of the user terminal into matrix coordinates to generate a mapping key;
[0100] An acquisition module, used for acquiring row and column coordinates of a mapping sequence in a mapping key;
[0101] A private key determination module, used to determine a 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 according to the double point addition on the elliptic curve.
[0103] According to a fifth aspect of an embodiment 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 used to generate an entity identification of the user terminal in response to the registration information of the user terminal; generate a public-private key pair of the lattice cipher and a national secret algorithm key based on security parameters; inject the private key of the public-private key pair of the lattice cipher into the security medium of the user terminal, and inject the national secret algorithm key into the security medium of the combined key generation system; obtain a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key; encrypt the combined private key of the combined public-private key pair using the public key of the lattice cipher to obtain an encrypted private key ciphertext; send the private key ciphertext and the combined public key of the combined public-private key pair to the user terminal, so that the user terminal decrypts 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 used to initialize the private key matrix and the public key matrix in response to the security medium of the combined key generation system being charged with the national secret algorithm key by the key management system; receive a request from a user end for a combined public-private key pair, the request including: an entity identifier of the user end; generate a combined public-private key pair according to the entity identifier of the user end, and the private key matrix and the public key matrix; encrypt the combined private key using the national secret algorithm key to obtain a ciphertext; 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 secret algorithm key, and to encrypt the combined private key obtained after decryption using the combined public key, and to send the obtained private key ciphertext and the combined public key to the user end.
[0107] According to a sixth aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0108] processor;
[0109] a memory for storing instructions executable by the processor;
[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 an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the key distribution method as described above.
[0112] According to an eighth aspect of an embodiment of the present invention, there is provided a computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor of an electronic device, the key distribution method as described above is implemented.
[0113] The technical solution provided by the embodiments of the present invention brings at least the following beneficial effects:
[0114] In the embodiment of the present invention, in response to the registration information of the user terminal, the entity identification of the user terminal is generated; the public-private key pair of the lattice cipher and the national secret algorithm key are generated based on the security parameters; the private key of the lattice cipher is injected into the security medium of the user terminal, and the national secret algorithm key is injected into the security medium of the combined key generation system; based on the entity identification of the user terminal and the national secret algorithm key, the 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 the 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 terminal, so that the user terminal uses the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key. That is to say, in the embodiment of the present invention, in the process of transmitting 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, thereby realizing the secure distribution of the key, and even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.
[0115] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention, and are used together with the specification to explain the principles of the present invention, and do not constitute an improper limitation of the present invention. In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0117] Figure 1 It is a flow chart of a key distribution method provided by an embodiment of the present invention.
[0118] Figure 2 This is another flow chart of a key distribution method provided by an embodiment of the present invention.
[0119] Figure 3 It is an interactive flow chart of an application example of a key distribution method provided by an embodiment of the present invention.
[0120] Figure 4 It is a block diagram of a key distribution device provided by an embodiment of the present invention.
[0121] Figure 5 It is another block diagram of a key distribution device provided by an embodiment of the present invention.
[0122] Figure 6 The present invention provides a block diagram of a key distribution system.
[0123] Figure 7 It is an application block diagram of a key distribution system provided by an embodiment of the present invention.
[0124] Figure 8 It is a block diagram of an electronic device provided by an embodiment of the present invention.
[0125] Fig. 9 The invention is a block diagram of a device for key distribution provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0126] In order to enable ordinary persons 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 in conjunction with the accompanying drawings.
[0127] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0128] Technical terms:
[0129] Certificate Authority (CA): An independent, trusted third party that issues digital certificates to certificate holders. The digital certificates state the identity and public key of the certificate holder. CA should verify the identity information of the certificate holder before issuing the certificate, and issue the certificate based on the verification results.
[0130] ECC (Elliptic Curve Cryptography) Composite Theorem: Assume that the elliptic curve E is: y 2 =(x 3 +ax+b)mod p, the parameters are: Where a, b are coefficients, a, b, x, y∈F p , is the base point of the additive group, n is The order of the group with as the base point. The sum of any number of pairs of private keys and the sum of the corresponding public keys constitute a new public-private key pair. Assume that the sum of the private keys is: r1+r2+…+r m mod n=r, then the corresponding sum of public keys is: R1+R2+…+R m =R.
[0131] CPK (Combined Public Key): An encryption algorithm in the field of information security, which was independently developed and designed by my country and is built on the basis of the ECC system. CPK has the advantages of not requiring third-party certification and being able to obtain the required public key at any time. It solves the problem of identity-based key management and has excellent characteristics such as taking up very little resources to generate large-scale keys.
[0132] PQC (Post Quantum Cryptography): PQC is a cryptographic scheme that can resist quantum computing in a classical computing environment. It is a public key encryption scheme. The PQC scheme based on the error learning problem is widely used. Its security is based on the intractability of the worst-case lattice problem and can resist quantum attacks.
[0133] Lattice: 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 lattice bases). For a lattice with a sufficiently high dimension, it is difficult to find a set of short lattice bases or a set of linearly independent short lattice vectors through a set of randomly selected lattice bases. It can also be understood as a lattice code.
[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 the random s from it.
[0135] SM4 algorithm: SM4 national secret algorithm is a symmetric encryption algorithm, also known as SM4 block cipher algorithm. It is widely used in the national encryption algorithm standards issued by the State Cryptography Administration of China. The length of each block of the SM4 block cipher algorithm is generally 128 bits, and the key length is also 128 bits. Both the encryption algorithm and the password expansion algorithm use a mathematical structure of 32 rounds of nonlinear iterations. Each iterative operation in the algorithm is a round of nonlinear transformation. The main operations include XOR, synthetic permutation, nonlinear iteration, reverse transformation, circular shift, and S-box transformation. The mathematical architecture, operation rules, and operation operations of the encryption algorithm and the decryption algorithm are exactly the same. The decryption operation only needs to use the round keys generated in the encryption algorithm in reverse order.
[0136] U-Key (USB Key) is a secure medium for USB interface (it can also be a hardware device for USB interface). It has a built-in single-chip microcomputer or smart card chip and a certain storage space, which can 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] On the basis of understanding the above technical terms, please refer to the following embodiments.
[0138] See also Figure 1 , is a flow chart of a key distribution method provided by an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0139] Step 101: In response to registration information of a user terminal, an entity identifier of the user terminal is generated.
[0140] Step 102: Generate a public and private key pair of the lattice cipher and a national secret algorithm key based on security parameters, inject the private key of the lattice cipher into the secure medium of the user end, and inject the national secret algorithm key into the secure medium of the combined key generation system.
[0141] Step 103: Based on the entity identification of the user terminal and the national encryption algorithm key, obtain a 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 an encrypted private key ciphertext.
[0143] Step 105: Send the private key ciphertext and the combined public key in the combined public-private key pair to the client, so that the client uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
[0144] The combined key distribution method described in the present invention can be applied to terminals, servers, etc., without limitation herein. The terminal implementation device can be electronic devices such as smart phones, laptops, tablet computers, desktop computers, personal digital assistants (PDAs) and wearable devices. The server can be an independent server or a server cluster, or a server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, intermediate services, domain name services, security services, content distribution networks, or a big data and artificial intelligence platform, etc., without limitation herein.
[0145] Combine the following Figure 1 , the specific implementation steps of a key distribution method provided by an embodiment of the present invention are described in detail.
[0146] In step 101, in response to registration information of a user terminal, an entity identifier of the user terminal 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 identification (ID) for the user, which is referred to as the entity identification (ID) of the user terminal in this article.
[0148] In step 102, a public and private key pair of the lattice cipher and a national secret algorithm key are generated based on security parameters, the private key of the lattice cipher is injected into the secure medium of the user end, and the national secret algorithm key is injected into the secure medium of the combined key generation system.
[0149] In this step, first, after the key management system generates an entity identifier for the user, it sets security parameters and generates an n×m-dimensional random matrix A under a set modulus q based on the set security parameters, such as λ, where n and m are natural numbers. Then, the m-dimensional error vector of the random matrix A is obtained; finally, based on the m-dimensional error vector, the set modulus q and the random matrix A generate a public and private key pair of the lattice cipher.
[0150] Specifically, in this embodiment, the key management system generates a public and private key pair for the grid password {PK PQC , S.K. PQC} indicates that, among them, the private key SK PQC =e, e is the m (column) dimensional error vector, the public key is calculated by the following formula, and the national secret algorithm (SM4) key K is generated. The formula is
[0151] PK PQC =A·SK PQC mod q
[0152] Among them, the PK PQC is the public key of the lattice cipher, the SK PQC is the private key of the lattice cipher, A is a random matrix, and q is a set modulus.
[0153] Secondly, the key management system writes the entity identification of the user terminal and the private key SK of the grid password into the secure medium of the user terminal (such as Ukey1, etc.) PQC , and write the entity identification of the user terminal and the national encryption algorithm key K into the security medium of the combined key generation system (such as Ukey2, etc.); after the writing is successful, the public-private key pair is registered to generate a key record.
[0154] Specifically, the security media in this embodiment take Ukey1 and Ukey2 as examples.
[0155] The key management system writes the entity ID and private key SK to Ukey1 PQC , write the entity identification ID and national secret algorithm key K to Ukey2. After writing is completed, the entity identification ID and private key SK written by Ukey1 by default PQC ; The entity identification ID and the national secret algorithm key K written by Ukey2 by default, wherein, in this embodiment, the entity identification ID can also be replaced by the personal identification number (PIN) of the SIM card. The PIN code is a security measure to protect the SIM card to prevent others from stealing the SIM card. Of course, it can also be replaced by other unique identifiers, which is not limited in this embodiment.
[0156] After the write is successful, the key management system registers the key and generates a key record. After that, the key management system can write cards to Ukey1 and Ukey2.
[0157] In step 103, based on the entity identification of the user terminal and the national encryption algorithm key, a combined public-private key pair is obtained from the combined key generation system.
[0158] In this step, an application is made to the combined key generation system for a combined public-private key pair based on the entity identifier of the user terminal; a combined private key ciphertext sent by the combined key generation system is received, wherein the combined private key ciphertext is the combined private key ciphertext encrypted by the combined key generation system using the national secret algorithm key; the combined private key ciphertext is decrypted using the national secret algorithm key to obtain the combined private key, and the combined public key corresponding to the combined private key disclosed by the combined key generation system is obtained.
[0159] Specifically, the key management system applies for a combined public-private key pair from the combined key generation system based on the entity identification (ID) of the user terminal. In this embodiment, a request for applying for a combined public-private key pair can be sent to the combined public key (CPK) key production system.
[0160] The combined key generation system generates a combined public-private key pair, and the process includes:
[0161] The entity identifier (ID) is mapped to matrix coordinates to generate a mapping key hsk. In this embodiment, the mapping of the entity identifier to the 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, wherein:
[0162] YS=Hash hsk (ID) = w0, w1, w2, ..., w 32
[0163] In the above formula, the content of w0 is represented by u, which represents the starting coordinate of the column, w1, ..., w 32 The SHA1 is selected as the Hash algorithm. The output of SHA1 is 160 bits. The lower 5 bits of the first byte are taken to form w0, forming a 165-bit mapping sequence.
[0164] Assume that the i-th row coordinate is w i The column coordinates are represented by (u+i-1) mod 32, and the combined private key csk is calculated by the following formula:
[0165]
[0166] According to the composite theorem, the combined public key cpk is based on the doubling point addition on the elliptic curve, which is calculated by the following formula:
[0167]
[0168] It should be noted that the specific production process is already a well-known technology to those skilled in the art and will not be described in detail here.
[0169] In step 104, the combined private key in the combined public-private key pair is encrypted using the public key of the lattice cipher to obtain an encrypted private key ciphertext.
[0170] In this step, first obtain the transpose A of the random matrix A in the public key of the lattice cipher T ; and select a random vector s for each bit value b in the public key of the lattice cipher, where b∈{0,1}, Afterwards, a vector x corresponding to each bit value in the combined private key is selected based on probability distribution, where: And based on the transpose AT of the random matrix A, the random vector s, and the vector x, determine the encrypted first private key ciphertext; finally, select the scalar based on the probability distribution ; Get the public key PK of the cipher PQC Transposed 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, based on the transpose A of the random matrix A T , random vector s, and vector x, determine the encrypted first private key ciphertext according to the following formula:
[0172]
[0173] Among them, the A T is the transpose of the random matrix A, and x is the vector corresponding to each bit value in the combined private key. The q is the set modulus, the csk is the combined private key; the s is the random vector of each bit value b in the public key of the lattice cipher;
[0174] The random vector b and the scalar , PK PQC T , determine the encrypted second private key ciphertext according to the following formula:
[0175]
[0176] Among them, the PK PQC T The public key PK of the lattice cipher PQC The transpose of ; the s is a random vector of each bit value b in the public key of the lattice cipher, the 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] That is to say, the final private key ciphertext is The encrypted csk is expressed as CT csk .
[0178] In step 105, the private key ciphertext and the combined public key in the combined public-private key pair are sent to the client, so that the client decrypts the private key ciphertext using the private key of the lattice password to obtain the combined private key.
[0179] In this step, the key management system will CT csk and cpk to the user end, and the user end receives CT csk After cpk, use SK PQC Ciphertext CT csk Decrypt and get the combined private key cpx. Then, calculate the combined private key cpx (i.e. the result value) according to the formula Verify each binary value in the calculated combined private key. If Compare If it is closer to 0, then output 0; otherwise, output 1.
[0180] In the embodiment of the present invention, in response to the registration information of the user terminal, the entity identification of the user terminal is generated; the public-private key pair of the lattice cipher and the national secret algorithm key are generated based on the security parameters; the private key of the lattice cipher is injected into the security medium of the user terminal, and the national secret algorithm key is injected into the security medium of the combined key generation system; based on the entity identification of the user terminal and the national secret algorithm key, the 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 the 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 terminal, so that the user terminal uses the private key of the lattice cipher to decrypt the private key ciphertext and obtain the combined private key. That is to say, in the embodiment of the present invention, in the process of transmitting 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, thereby realizing the secure distribution of the key, and even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.
[0181] See also Figure 2 , is another flow chart of a key distribution method provided by 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 charged with the national secret algorithm key by the key management system, the private key matrix and the public key matrix are initialized;
[0183] In this step, after the key management system injects the national secret (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] Among them, the private key matrix is less than N (N is the basis point of the additive group The order of the group with as the base point), which is composed of unequal random numbers, and the elements in the matrix are recorded as , the private key matrix is expressed as:
[0185]
[0186] The public key matrix is derived from the private key matrix, The public key matrix is expressed as:
[0187]
[0188] Step 202: receiving a request from a user terminal for applying for a combined public-private key pair, wherein the request includes: an entity identifier of the user terminal.
[0189] In this step, the key management system applies to the combined key generation system for a request for a combined public-private key pair, wherein the request includes: an entity identifier of the user end.
[0190] Step 203: Generate a combined public-private key pair according to 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 according to the double point addition on the elliptic curve.
[0192] Specifically, the entity identifier (ID) is mapped to matrix coordinates to generate a mapping key hsk. In this embodiment, the mapping of the entity identifier to the 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, wherein:
[0193] YS=Hash hsk (ID) = w0, w1, w2, ..., w 32
[0194] In the above formula, the content of w0 is represented by u, which represents the starting coordinate of the column, w1, ..., w 32 The SHA1 is selected as the Hash algorithm. The output of SHA1 is 160 bits. The lower 5 bits of the first byte are taken to form w0, forming a 165-bit mapping sequence.
[0195] Assuming that the row coordinate of the i-th time is represented by w1 and the column coordinate is represented by (u+i-1) mod 32, the combined private key csk is calculated by the following formula:
[0196]
[0197] According to the composite theorem, the combined public key cpk is based on the doubling point addition on the elliptic curve, which is calculated by the following formula:
[0198]
[0199] It should be noted that the specific production process is already a well-known technology to those skilled in the art and will not be described in detail here.
[0200] Step 204: Encrypt the combined private key using the national encryption algorithm key to obtain a ciphertext;
[0201] In this step, the combined key generation system uses the SM4 key K to encrypt the combined private key csk to obtain a ciphertext.
[0202] Step 205: Send the ciphertext to the key management system and publish the combined public key so that the key management system uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
[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] After receiving the ciphertext, the key management system obtains the corresponding combined public key cpk, decrypts the ciphertext using the national secret algorithm key, and obtains the combined private key csk. Then, the combined public key cpk is used to encrypt the obtained combined private key csk to obtain the private key ciphertext CT. csk , and the private key ciphertext CT esk and the combined public key cpk to the client. The client uses SK PQC Ciphertext CT csk Decryption is performed to obtain the combined private key csk. The specific implementation process is described above and will not be repeated here.
[0205] In an embodiment of the present invention, a combined key generation system (such as a CPK key generation system, etc.) is adopted, and the entity identification (ID) of the user end is used. The combined key generation system uniformly generates a public-private key pair for the user, and the combined private key csk is encrypted using the national secret algorithm key to obtain a ciphertext. The keys are distributed face-to-face with the key management system and the user, without relying on third-party certification, making user access convenient and fast.
[0206] See also Figure 3 , is an application interaction flow chart of a key distribution method provided by an embodiment of the present invention, wherein the application example is illustrated by taking the three entities of the user end, the key management system and the CPK key generation system as examples, wherein the user end has a secure medium Ukey1 (i.e., the user end includes the secure medium Ukey1 connected thereto); the key management system is responsible for the key management of the national secret algorithm and the CPK algorithm involved in the system, and for direct interaction with the user; the CPK key generation system has a secure medium Ukey2 (i.e., the CPK key generation system includes the secure medium Ukey2 connected thereto), and is responsible for generating a CPK public-private key pair. The method specifically includes:
[0207] Step 301: A user registers with a key management system through a user terminal;
[0208] Step 302: The key management system registers the user information and generates an entity identification (ID) for the user;
[0209] Step 303: The key management system generates a public and private key pair of the grid cipher and a national secret algorithm key (i.e., SM4 algorithm key);
[0210] Step 304: The key management system injects the private key of the cell password into the secure medium Ukey1 of the user end;
[0211] Step 305: The key management system injects the SM4 algorithm key into Ukey2 of the combined key generation system;
[0212] It should be noted that step 304 and step 305 can be understood as key initialization. In specific implementation, these two steps are not in any particular order and can also be performed simultaneously, which is not limited in this embodiment.
[0213] Step 306: The CPK key generation system initializes the private key matrix and the public key matrix;
[0214] Step 307: The key management system applies to the combined key generation system for a request for a combined public-private key pair, wherein the request includes: an entity identifier of the user end;
[0215] Step 308: The CPK key generation system generates a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix;
[0216] Step 309: The CPK key generation system uses the national secret algorithm key to encrypt the combined private key to obtain a 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 decrypts the ciphertext using the national secret algorithm key to obtain a 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 password 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 in the combined public-private key pair to the user terminal;
[0222] Step 315: The user end uses the private key of the grid password 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 embodiment, which will not be repeated here.
[0224] In an embodiment of the present invention, a key distribution method is provided, in which the distributed key is a quantum-resistant key based on a lattice cipher, that is, in the process of transmitting the key from the key management system to the user end, the public and private key pair of the lattice cipher is used to encrypt and decrypt the combined CPK private key, thereby realizing the secure distribution of the key. Even in the event of a quantum computing attack, the confidentiality of the user's private key can be guaranteed.
[0225] The embodiment of the present invention also adopts a difficult problem based on learning with error (LWE), uses polynomials plus noise, and gives some "approximate" random linear equations about the secret vector S, making it infeasible to recover the secret vector S. The CPK combined public key system adopted is an improvement on the PKI system. It uses the user's entity identification (ID) to generate a public and private key pair for the user. The user confirms the authentication relationship when registering. The public and private keys do not need to be specifically associated together, and do not need to rely on third-party certification, which facilitates the generation, management and maintenance of keys.
[0226] The embodiment of the present invention also adopts the national secret SM4 algorithm to encrypt the CPK private key during the transmission process from 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 method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that this implementation disclosure is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.
[0228] See also Figure 4 , is a block diagram of a key distribution device provided by an embodiment of the present invention. The device is applied to a key management system, including: 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] A first generating module 401, configured to generate an entity identifier of the user terminal in response to registration information of the user terminal;
[0230] The second generation module 402 is used to generate a public and private key pair of a lattice cipher and a national secret algorithm key based on security parameters;
[0231] The injection module 403 is used to inject the private key of the grid cipher into the secure medium of the user terminal, and inject the national secret algorithm key into the secure medium of the combined key generation system;
[0232] An acquisition module 404 is used to acquire a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national encryption algorithm key;
[0233] The 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 an encrypted private key ciphertext;
[0234] The sending module 406 is used to send the private key ciphertext and the combined public key in the combined public-private key pair to the user end, so that the user end uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
[0235] Optionally, the acquisition module includes:
[0236] An application module, used for applying for a combined public-private key pair from the combined key generation system according to the entity identification of the user terminal;
[0237] A receiving module, used to receive a combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is a combined private key ciphertext encrypted by the combined key generation system using the national secret algorithm key;
[0238] The decryption module is used to decrypt the combined private key ciphertext using the national secret algorithm key to obtain the combined private key, and to obtain the combined public key corresponding to the combined private key disclosed by the combined key generation system.
[0239] Optionally, the second generating module includes:
[0240] A matrix generation module, used for generating an n×m dimensional random matrix under a set modulus q based on a security parameter, where n and m are natural numbers;
[0241] A vector acquisition module, used to obtain an m-dimensional error vector of the random matrix;
[0242] A key generation module is used to generate a public and private key pair of 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, used for using the m-dimensional error vector as a private key of a lattice cipher;
[0245] A public key generation module is used to generate a public key of the lattice cipher based on the private key of the lattice cipher, the set modulus q and the random matrix according to the following formula, wherein the formula is:
[0246] PK PQC =A·SK PQC mod q
[0247] Among them, the PK PQC is the public key of the lattice cipher, the SK PQC is the private key of the lattice cipher, A is a random matrix, and q is a set modulus.
[0248] Optionally, the charging module includes:
[0249] A writing module, used to write the entity identification of the user terminal and the private key of the cipher into the secure medium of the user terminal, and write the entity identification of the user terminal and the national secret algorithm key into the secure medium of the combined key generation system;
[0250] The recording module is used to register the public-private key pair and generate a key record after the writing is successful.
[0251] Optionally, the encryption module includes:
[0252] A first transposition acquisition module, used to obtain the transposition of the random matrix in the public key of the lattice cipher;
[0253] A selection module, used for selecting a random vector of each bit value in the public key of the lattice cipher;
[0254] A first selection module, configured to select a vector corresponding to each bit value in the combined private key based on a probability distribution;
[0255] A first determination module, configured to determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector;
[0256] A second selection module, configured to select a scalar corresponding to each bit value in the combined private key based on a probability distribution;
[0257] A second transposition acquisition module, used to obtain the transposition of the public key of the lattice cipher;
[0258] A second determination module, configured to determine an encrypted second private key ciphertext based on the random vector and the 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 a private key ciphertext.
[0260] Optionally, the first determination module is specifically configured to determine the encrypted first private key ciphertext according to the following formula based on the transpose of the random matrix, the random vector, and the vector:
[0261]
[0262] Among them, the A T is the transpose of the random matrix A, and x is the vector corresponding to each bit value in the combined private key. The q is the set modulus, the csk is the combined private key; the s is the random vector of each bit value b in the public key of the lattice cipher;
[0263] The second determination module is specifically configured to determine the encrypted second private key ciphertext according to the following formula based on the random vector and the scalar and the transposition of the public key:
[0264]
[0265] Among them, the PK PQC T The public key PK of the lattice cipher PQC The transpose of ; the s is a random vector of each bit value b in the public key of the lattice cipher, the 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] See also Figure 5 , is another block diagram of a key distribution device provided by an embodiment of the present invention, the device is applied to a combined key generation system, including: 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, used to initialize the private key matrix and the public key matrix in response to the national secret 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 end for applying for a combined public-private key pair, wherein the request includes: an entity identifier of the user end;
[0269] A generating module 503, configured to generate a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix;
[0270] The encryption module 504 is used to encrypt the combined private key using the national encryption algorithm key to obtain a 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 uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
[0272] Optionally, the generating module includes:
[0273] A mapping module, used to map the entity identifier of the user terminal into matrix coordinates to generate a mapping key;
[0274] An acquisition module, used for acquiring row and column coordinates of a mapping sequence in a mapping key;
[0275] A private key determination module, used to determine a 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 according to the double point addition on the elliptic curve.
[0277] See also Figure 6 , is a block diagram of a key distribution system provided by an embodiment of the present invention, the system comprising: a key management system 601 and a combined key generation system 602, wherein:
[0278] The key management system 601 is used to generate an entity identification of the user terminal in response to the registration information of the user terminal; generate a public-private key pair of the lattice cipher and a national secret algorithm key based on security parameters; inject the private key of the public-private key pair of the lattice cipher into the security medium of the user terminal, and inject the national secret algorithm key into the security medium of the combined key generation system; obtain a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key; encrypt the combined private key of the combined public-private key pair using the public key of the lattice cipher to obtain an encrypted private key ciphertext; send the private key ciphertext and the combined public key of the combined public-private key pair to the user terminal, so that the user terminal decrypts 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 used to initialize the private key matrix and the public key matrix in response to the security medium of the combined key generation system being charged with the national secret algorithm key by the key management system; receive a request from a user end for a combined public-private key pair, the request including: an entity identifier of the user end; generate a combined public-private key pair according to the entity identifier of the user end, and the private key matrix and the public key matrix; encrypt the combined private key using the national secret algorithm key to obtain a 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 secret algorithm key, and to encrypt the combined private key obtained after decryption using the combined public key, and to send the obtained private key ciphertext and the combined public key to the user end.
[0281] See also Figure 7 , is an application block diagram of a key distribution system provided by an embodiment of the present invention. As shown in the figure, it includes: a key management system, a CPK key generation system and a user (or user terminal), wherein the key management system is connected to the CPK key generation system (including Ukey2) and the user (including Ukey1) respectively, as shown in the figure:
[0282] 1. The key management system registers user information, generates a user ID (i.e., the entity ID of the user end), and generates a public and private key pair (PK_PQC, SK_PQC) for the grid password (i.e., PK PQC , S.K. PQC );
[0283] 2. The key management system injects the private key SK_PQC into Ukey1;
[0284] 3. The key management system injects the private key national model algorithm key K (i.e. SK4 algorithm key K) into Ukey2;
[0285] 4. The key management system applies for a CPK combined public and private 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 the combined private key CSK to obtain the ciphertext, and sends the ciphertext to the key management system to publish the combined public key CPK.
[0287] 6. The key management system uses the SM4 key K to decrypt the ciphertext, obtains the combined private key CSK, and uses PK_PQC to encrypt CSK to obtain the key ciphertext CT csk , and the key ciphertext CT esk and CPK are sent to the user;
[0288] 7. The user uses SK_PQC to ciphertext CT csk Decryption is performed to obtain the combined private key CSK.
[0289] The embodiment of the present invention adopts a lattice cipher based on the LWE difficulty problem to encrypt and distribute the CPK combination private key. By utilizing the difficulty of the LWE problem, it is possible to resist the attack of quantum computing, making it technically infeasible to recover the encrypted private key through quantum computing, and also ensuring the confidentiality of the user's private key. In addition, relying on the linear structure of the lattice, most operations on the lattice are linear operations, and the new public key cryptosystem constructed using the lattice theory has a faster operation speed.
[0290] The embodiment of the present invention adopts the national secret SM4 algorithm, uses a secure medium to store symmetric keys, and encrypts 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 by the present invention uses the user's entity identification (ID) compared with the existing PKI system that relies on a third-party CA certification chain to generate public and private key pairs for the user. The key management system and the user distribute keys face to face, without relying on third-party certification, making user access convenient and fast.
[0292] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0293] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0294] Figure 8 800 is a block diagram of an electronic device 800 provided in an embodiment of the present invention. For example, the electronic device 800 may be a mobile terminal or a server, and the electronic device is a mobile terminal as an example for explanation in the embodiment of the present invention. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a 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] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0297] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The 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 memory, flash memory, magnetic disk or optical disk.
[0298] The power supply component 806 provides power to the various components of the electronic device 800. The 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 the electronic device 800.
[0299] The 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 touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0300] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the 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 button, volume button, start button, and lock button.
[0302] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0303] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can 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 execute the key distribution method shown above.
[0305] In an embodiment, a computer-readable storage medium is also provided, and when the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device 800 can perform the key distribution method shown above. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0306] In an embodiment, a computer program product is further provided, including a computer program or instructions. When the computer program or instructions are executed by the processor 820 of the electronic device 800, the electronic device 800 executes the key distribution method described above.
[0307] Fig. 9 is a block diagram of a device 900 for key distribution provided by an embodiment of the present invention. For example, the device 900 may be provided as a server. Fig. 9 , the apparatus 900 includes a processing component 922, which further includes one or more processors, and a memory resource represented by a memory 932 for storing instructions, such as an application, that can be executed by the processing component 922. The application stored in the memory 932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 922 is configured to execute the instructions to perform the above method.
[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 may operate based on an operating system stored in the memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0309] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0310] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present 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, comprising: In response to the registration information of the user terminal, generating an entity identification of the user terminal; Generate a public and private key pair of the lattice cipher and a national secret algorithm key based on the security parameters, inject the private key of the lattice cipher into the security medium of the user end, and inject the national secret algorithm key into the security medium of the combined key generation system; Based on the entity identification of the user terminal and the national secret algorithm key, obtaining a combined public and private key pair from the combined key generation system; Using the public key of the lattice cipher, encrypting the combined private key in the combined public-private key pair to obtain an 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 end, so that the user end uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
2. The key distribution method according to claim 1, characterized in that: The acquiring the combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key comprises: Applying for a combined public-private key pair from the combined key generation system according to the entity identification of the user terminal; Receiving a combined private key ciphertext sent by the combined key generation system, wherein the combined private key ciphertext is a combined private key ciphertext encrypted by the combined key generation system using the national secret algorithm key; The combined private key ciphertext is decrypted using the national secret algorithm key to obtain the combined private key, and the combined public key corresponding to the combined private key that is published by the combined key generation system is obtained.
3. The key distribution method according to claim 1 or 2, characterized in that: The public and private key pairs of the lattice password generated based on the security parameters, as well as the national secret algorithm key, include: Generate an n×m-dimensional random matrix with a set modulus based on the security parameter, where n and m are natural numbers; Obtaining an m-dimensional error vector of the random matrix; A public and private key pair of a lattice cipher is generated based on the m-dimensional error vector, the set modulus and the random matrix.
4. The key distribution method according to claim 1 or 2, characterized in that: The step of injecting the private key of the public-private key pair of the lattice cipher into the secure medium of the user terminal, and injecting the national secret algorithm key into the secure medium of the combined key generation system, comprises: Writing the entity identification of the user terminal and the private key of the cipher into the secure medium of the user terminal, and writing the entity identification of the user terminal and the national secret algorithm key into the secure medium of the combined key generation system; After the writing is successful, the public-private key pair is registered to generate a key record.
5. The key distribution method according to claim 1 or 2, characterized in that: The method 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: Obtaining the transpose of the random matrix in the public key of the lattice cipher; Selecting a random vector of each bit value in the public key of the lattice cipher; Selecting a vector corresponding to each bit value in the combined private key based on a probability distribution; Determine the encrypted first private key ciphertext based on the transpose of the random matrix, the random vector, and the vector; Selecting a scalar corresponding to each bit value in the combined private key based on a probability distribution; Obtaining the transpose of the public key of the lattice cipher; Determine an encrypted second private key ciphertext based on the random vector and scalar, and the transpose of the public key; The first private key ciphertext and the second private key ciphertext are combined to obtain a private key ciphertext.
6. A key distribution method, characterized in that: The method is applied to a combined key generation system, comprising: In response to the security medium of the combined key generation system being charged with the national secret algorithm key by the key management system, the private key matrix and the public key matrix are initialized; A request for applying for a combined public-private key pair is received from a key management system, the request including: an entity identifier of a user terminal; Generate a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix; Encrypting the combined private key using the national secret algorithm key to obtain a ciphertext; The ciphertext is sent to the key management system, and the combined public key is made public, so that the key management system uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
7. The key distribution method according to claim 6, characterized in that: The generating a combined public-private key pair according to the entity identifier of the user terminal, the private key matrix and the public key matrix comprises: Mapping the entity identifier of the user terminal into matrix coordinates to generate a mapping key; Get the row and column coordinates of the mapping sequence in the mapping key; Determine a combined private key based on the private key matrix and the row and column coordinates; Based on the combined private key, a combined public key is determined according to point-doubled addition on an elliptic curve.
8. A key distribution device, characterized in that: The device is applied to a key management system, comprising: A first generating module, configured to generate an entity identifier of the user terminal in response to registration information of the user terminal; The second generation module is used to generate a public and private key pair of a lattice cipher and a national secret algorithm key based on security parameters; A charging module, used to charge the private key of the grid cipher into the secure medium of the user terminal, and to charge the national secret algorithm key into the secure medium of the combined key generation system; An acquisition module, used to acquire a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key; An encryption module, used to encrypt the combined private key in the combined public-private key pair using the public key of the lattice cipher to obtain an encrypted private key ciphertext; The sending module is used to send the private key ciphertext and the combined public key in the combined public-private key pair to the user end, so that the user end uses the private key of the lattice password to decrypt the private key ciphertext to obtain the combined private key.
9. A key distribution device, characterized in that: The device is applied to a combined key generation system, comprising: An initialization module, used to initialize a private key matrix and a public key matrix in response to a national secret algorithm key injected into a secure medium by a key management system; A receiving module, configured to receive a request for applying for a combined public-private key pair sent by a key management system, wherein the request includes: an entity identifier of a user terminal; A generating module, used for generating a combined public-private key pair according to the entity identification of the user terminal, and the private key matrix and the public key matrix; An encryption module, used to encrypt the combined private key using the national secret algorithm key to obtain a 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 uses the national secret algorithm key to decrypt the ciphertext, and uses the combined public key to encrypt the combined private key obtained after decryption, and sends the obtained private key ciphertext and the combined public key to the user end.
10. A key distribution system, characterized in that: The system comprises: a key management system and a combined key generation system, wherein: The key management system is used to generate an entity identification of the user terminal in response to the registration information of the user terminal; generate a public-private key pair of the lattice cipher and a national secret algorithm key based on security parameters; inject the private key of the public-private key pair of the lattice cipher into the security medium of the user terminal, and inject the national secret algorithm key into the security medium of the combined key generation system; obtain a combined public-private key pair from the combined key generation system based on the entity identification of the user terminal and the national secret algorithm key; encrypt the combined private key of the combined public-private key pair using the public key of the lattice cipher to obtain an encrypted private key ciphertext; send the private key ciphertext and the combined public key of the combined public-private key pair to the user terminal, so that the user terminal decrypts the private key ciphertext using the private key of the lattice cipher to obtain the combined private key; The combined key generation system is used to initialize the private key matrix and the public key matrix in response to the security medium of the combined key generation system being charged with the national secret algorithm key by the key management system; receive a request from a user end for a combined public-private key pair, the request including: an entity identifier of the user end; generate a combined public-private key pair according to the entity identifier of the user end, and the private key matrix and the public key matrix; encrypt the combined private key using the national secret algorithm key to obtain a ciphertext; 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 secret algorithm key, and to encrypt the combined private key obtained after decryption using the combined public key, and to send the obtained private key ciphertext and the combined public key to the user end.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the key distribution method according to any one of claims 1 to 7.
12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the key distribution method according to any one of claims 1 to 7.
Citation Information
Patent Citations
private key pool-based anti-quantum calculation Elagamal encryption and decryption method and system
CN109905236A
Data transmission method and device, equipment, storage medium and program product
CN114205144A
Identity verification method based on quantum encryption technology and related hardware
CN117118609A
National key identification cryptographic algorithm-based private key distribution system
WO2022143030A1
Terminal device authentication method and system based on identification public key, and computer-readable storage medium
WO2024027070A1
Cited By
Data sequence encryption and decryption method and device, equipment and storage medium
CN119402186A
Method and device for performing security authentication with unmanned system
CN119853911A
Secret key over-the-air charging method and device, electronic equipment and computer storage medium
CN121309157A
