Key negotiation method, device and system based on certificateless public key cryptosystem

By receiving user identification, declaring public keys and random results in a certificate-free public key cryptography system, calculating the actual public key and generating a negotiation key, the problem that key negotiation solutions in the prior art are difficult to adapt to the latest cryptographic industry standards, and a secure and compatible key negotiation is achieved.

CN119544196APending Publication Date: 2025-02-28BEIJING HAITAI FANGYUAN HIGH TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411450685.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The key negotiation solutions in the prior art are difficult to adapt to the latest cryptographic industry standards, resulting in compatibility issues and security risks.

Method used

The key negotiation method based on the certificate-free public key cryptography system is adopted, and the actual public key is calculated by receiving the other party's user ID, declaring the public key and random results, and the negotiation key is generated using the key derivation function.

Benefits of technology

Key negotiation based on user identity is realized in a certificate-free public key cryptographic system, ensuring the security and compatibility of key negotiation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544196A_ABST
    Figure CN119544196A_ABST
Patent Text Reader

Abstract

The invention provides a key negotiation method, device and system based on a certificateless public key cryptography system, and relates to the technical field of encrypted communication, and the method comprises the steps: receiving a second user identifier, a second declaration public key and a second random result sent by a second user in the certificateless public key cryptography system; the first user calculates a second actual public key of the second user based on the second user identifier, the second declaration public key and the certificateless public key cryptosystem parameter; and the first user performs calculation based on the second actual public key, the second random result, the negotiation key length, the first user random number and the user private key of the first user by using a key derivation function to obtain a first negotiation key of which the length is the negotiation key length. The key negotiation method, device and system provided by the invention are used for realizing key negotiation in a certificateless public key cryptosystem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of encrypted communication technology, and in particular to a key negotiation method, device and system based on a certificateless public key cryptography system. Background Art

[0002] Key negotiation is a mechanism for establishing a session key between two communicating parties. During the key negotiation process, the two parties can negotiate a key that only they know and use to encrypt application layer data, also known as a "session key."

[0003] In the related art, for security reasons, it is necessary to continuously adjust the cryptographic industry standards to improve the security factor. However, the key negotiation schemes in the related art often lag behind the cryptographic industry standards, making it difficult to adapt to the latest cryptographic industry standards, and are prone to compatibility issues, which in turn creates security risks. Summary of the invention

[0004] The purpose of the present application is to provide a key negotiation method, device and system based on a certificateless public key cryptography system, which are used to implement key negotiation based on user identity in a certificateless public key cryptography system.

[0005] In a first aspect, the present application provides a key agreement method based on a certificateless public key cryptography system applied to a first user, comprising: Receive a second user identifier, a second declared public key and a second random result sent by a second user in the certificateless public key cryptographic system; the second random result is obtained based on the product of the second user's random number and the base point of the elliptic curve; calculate the second actual public key of the second user based on the second user identifier, the second declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; use a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user to obtain a first negotiated key with a length of the negotiated key; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user, the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is obtained by multiplying the first user's random number and the base point of the elliptic curve.

[0006] In this way, the second user identifier, the second declared public key and the second random result received from the second user can be used to generate the first negotiated key of the first user to achieve key negotiation between the two users. The first negotiated key is the same as the second negotiated key generated by the second user.

[0007] Optionally, the calculation of the second actual public key of the second user based on the second user identifier, the second declared public key and the certificateless public key cryptographic system parameters includes: using a cryptographic hash algorithm to calculate the second identification parameter, the second user identifier, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve and the coordinate value of the system master public key to obtain a first calculation result; the second identification parameter is obtained by converting the bit length of the second user identifier; using a cryptographic hash algorithm to calculate the first calculation result and the coordinate value of the second declared public key to obtain a second calculation result, and performing a modulo operation on the second calculation result and the order of the base point of the elliptic curve to obtain a third calculation result; adding a first target product obtained by multiplying the third calculation result and the system master public key to the second declared public key to obtain the second actual public key.

[0008] In this way, the second user identifier, the second declared public key and the certificateless public key cryptographic system parameters sent by the second user can be used to calculate the second actual public key of the second user, and in subsequent steps, the first negotiated key of the first user can be calculated based on the actual public key.

[0009] Optionally, the use of a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the user private key of the first user, and the first user random number to obtain a first negotiated key having a length of the negotiated key includes: adding the second random result to the second actual public key to obtain a first target sum; multiplying the sum obtained by adding the user private key of the first user to the first user random number by the first target sum to obtain a first intermediate result; and inputting the first intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the first negotiated key.

[0010] In this way, after obtaining the second actual public key of the second user, the second random result, the negotiated key length, the user private key of the first user and the first user random number, the key derivation function can be used to calculate them, and then the first negotiated key can be obtained. Since the negotiated key uses data from both the first user and the second user, it is difficult to crack it even if only the data of one user is obtained.

[0011] In a second aspect, the present application provides a key agreement method based on a certificateless public key cryptography system applied to a second user, comprising: Optionally, a first user identifier, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system are received; the first random result is obtained by multiplying a random number of the first user by a base point of an elliptic curve; a first actual public key of the first user is calculated based on the first user identifier, the first declared public key and certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; a key derivation function is used to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user random number, and a length of the negotiated key is obtained. A second negotiated key of a key length; wherein, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0012] In this way, the first user identifier, the first declared public key and the first random result received from the first user can be used to generate a second negotiation key of the second user to achieve key negotiation between the two users. The second negotiation key is the same as the first negotiation key generated by the first user.

[0013] Optionally, the calculation of the first actual public key of the first user based on the first user identifier, the first declared public key and the certificateless public key cryptographic system parameters includes: using a cryptographic hash algorithm to calculate the first identification parameter, the first user identifier, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve and the coordinate value of the master key of the certificateless public key cryptographic system to obtain a fourth calculation result; the first identification parameter is obtained by converting the bit length of the first user identifier; using a cryptographic hash algorithm to calculate the fourth calculation result and the coordinate value of the first declared public key to obtain a fifth calculation result, and performing a modulo operation on the fifth calculation result and the order of the base point of the elliptic curve to obtain a sixth calculation result; adding a second target product obtained by multiplying the sixth calculation result and the system master public key to the first declared public key to obtain the first actual public key.

[0014] In this way, the first user identifier, the first declared public key and the certificateless public key cryptographic system parameters sent by the first user can be used to calculate the first actual public key of the first user, and in subsequent steps, the second negotiated key of the second user can be calculated based on the actual public key.

[0015] Optionally, the use of a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user, and the second user random number to obtain a second negotiated key having a length of the negotiated key includes: adding the first random result to the first actual public key to obtain a second target sum; adding the user private key of the second user to the second user random number and multiplying the obtained sum by the second target sum to obtain a second intermediate result; inputting the second intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the second negotiated key.

[0016] In this way, after obtaining the first actual public key of the first user, the first random result, the negotiated key length, the user private key of the second user, and the second user random number, the key derivation function can be used to calculate them to obtain the second negotiated key. Since the negotiated key uses data from both the first user and the second user, it is difficult to crack it even if only the data of one user is obtained.

[0017] In a third aspect, the present application provides a key agreement device based on a certificateless public key cryptography system applied to a first user, comprising: a first receiving module, for receiving a second user identification, a second declared public key and a second random result sent by a second user in the certificateless public key cryptographic system; the second random result is obtained based on the product of the second user random number and the base point of the elliptic curve; a first calculating module, for calculating the second actual public key of the second user based on the second user identification, the second declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; the first calculating module is also used to use a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user to obtain a first negotiated key with a length of the negotiated key; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identification of the first user, the first declared public key of the first user and the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is obtained by multiplying the first user random number and the base point of the elliptic curve.

[0018] Optionally, the first calculation module is specifically used to use a cryptographic hash algorithm to calculate the second identification parameter, the second user identification, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve, and the coordinate value of the system master public key to obtain a first calculation result; the second identification parameter is obtained by converting the bit length of the second user identification; the first calculation module is also specifically used to use a cryptographic hash algorithm to calculate the first calculation result and the coordinate value of the second declared public key to obtain a second calculation result, and perform a modular operation on the second calculation result and the order of the base point of the elliptic curve to obtain a third calculation result; the first calculation module is also specifically used to add a first target product obtained by multiplying the third calculation result and the system master public key to the second declared public key to obtain the second actual public key.

[0019] Optionally, the first calculation module is specifically used to add the second random result and the second actual public key to obtain a first target sum; the first calculation module is also specifically used to add the user private key of the first user and the first user random number to obtain a first intermediate result and then multiply the first target sum; the first calculation module is also specifically used to input the first intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the first negotiated key.

[0020] In a fourth aspect, the present application provides a key agreement device based on a certificateless public key cryptographic system applied to a second user, comprising: a second receiving module, for receiving a first user identification, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system; the first random result is obtained based on the product of the first user random number and the base point of the elliptic curve; a second calculating module, for calculating the first actual public key of the first user based on the first user identification, the first declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; the second calculating module is also used to use a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user random number Calculation is performed to obtain a second negotiated key with a length of the negotiated key; wherein the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0021] Optionally, the second calculation module is specifically used to use a cryptographic hash algorithm to calculate the first identification parameter, the first user identification, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve, and the coordinate value of the master key of the certificateless public key cryptography system to obtain a fourth calculation result; the first identification parameter is obtained by converting the bit length of the first user identification; the second calculation module is also specifically used to use a cryptographic hash algorithm to calculate the fourth calculation result and the coordinate value of the first declared public key to obtain a fifth calculation result, and perform a modular operation on the fifth calculation result and the order of the base point of the elliptic curve to obtain a sixth calculation result; the second calculation module is also specifically used to add a second target product obtained by multiplying the sixth calculation result by the system master public key to the first declared public key to obtain the first actual public key.

[0022] Optionally, the second calculation module is specifically used to obtain a second target sum by adding the first random result and the first actual public key; the second calculation module is also specifically used to add the user private key of the second user and the second user random number and multiply the obtained sum by the second target sum to obtain a second intermediate result; the second calculation module is also specifically used to input the second intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the second negotiated key.

[0023] The present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of a key negotiation method based on a certificateless public key cryptography system as described in any of the first aspects or the second aspects above.

[0024] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the key negotiation method based on the certificateless public key cryptography system as described in the first aspect or any one of the second aspects are implemented.

[0025] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the key negotiation method based on the certificateless public key cryptography system as described in the first aspect or any one of the second aspects are implemented.

[0026] The present application also provides a certificateless public key cryptography system, the system comprising a first user and a second user, the first user being used to execute the steps of a key negotiation method based on a certificateless public key cryptography system as described in any one of the first aspects above; the second user being used to execute the steps of a key negotiation method based on a certificateless public key cryptography system as described in any one of the second aspects above.

[0027] The key negotiation method, device and system based on the certificateless public key cryptography system provided by the present application firstly receives the second user identification, the second declared public key and the second random result sent by the second user in the certificateless public key cryptography system; the second random result is obtained by multiplying the random number of the second user and the base point of the elliptic curve; then, the second actual public key of the second user is calculated based on the second user identification, the second declared public key and the parameters of the certificateless public key cryptography system; the parameters of the certificateless public key cryptography system include: the coefficients of the elliptic curve equation, the base point of the elliptic curve, the order of the elliptic curve, and the system master public key; finally, the second actual public key, the second random result, the negotiation key length, the first user random number and the user private key of the first user are calculated using the key derivation function to obtain the first negotiation key with the length of the negotiation key. In this way, key negotiation based on user identity can be implemented in the certificateless public key cryptography system. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art 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 any creative work.

[0029] Figure 1 This is a flowchart of a key negotiation method based on a certificateless public key cryptography system provided by the present application; Figure 2 This is a flowchart of another key negotiation method based on a certificateless public key cryptography system provided by the present application; Figure 3 It is a detailed flowchart of the key negotiation method based on the certificateless public key cryptography system provided by this application; Figure 4 It is a structural diagram of a key agreement device based on a certificateless public key cryptographic system provided by the present application; Figure 5 It is a structural schematic diagram of another key agreement device based on a certificateless public key cryptographic system provided by the present application; Figure 6 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The following is a detailed description of the professional terms involved in the embodiments of the present application: Certificateless Public Key Cryptography (CLPKC): is a new type of public key cryptography system, which is developed on the basis of identity-based public key cryptography (ID-PKC). CLPKC has the following characteristics: No certificate required: CLPKC does not need to use public key certificates to verify the legitimacy of public keys, thus avoiding the complexity of certificate management. CLPKC also solves the key escrow problem.

[0033] Certificateless public key cryptography is a new variant of identity-based public key cryptography (ID-PKC), which eliminates the certificates in traditional public key infrastructure (PKI) and simplifies the key management process.

[0034] The order of the base point of the elliptic curve (usually represented by the symbol G): refers to the largest non-negative integer that can be obtained by continuous addition. In other words, if we keep adding G until we get the infinite point O, then this largest integer is the order of the base point G. This order is usually a large prime number to enhance the security of the system.

[0035] Public key cryptography is also often called asymmetric cryptography. Its biggest feature is that keys appear in pairs, i.e. key pairs. A key pair consists of a public key and a private key. The public key and the private key are different. The public key can be derived from a known private key, but the private key cannot be derived from a known public key. Assuming the private key is d and the public key is P, then: P=[d]G, where G is the base point of the elliptic curve. When d and G are known, it is relatively easy to solve P; however, when P and G are known, it is difficult to solve d.

[0036] Here are some key features and applications of public key cryptography: Key Pair: The public key is public and can be safely sent to anyone; the private key is private and must be kept strictly confidential. Encryption and Decryption: Use the public key to encrypt data so that only those who hold the corresponding private key can decrypt it. This can be used to ensure the confidentiality of information. Use the private key to decrypt data, which is the reverse process of encryption. Digital Signature: The private key is used to create a digital signature, proving the origin and integrity of the data. The public key is used to verify the signature. Key Exchange: Used to securely exchange symmetric keys.

[0037] A cryptographic hash algorithm, also known as a cryptographic hash function, hash algorithm or digest algorithm, is a function used to generate a message digest or hash value with a fixed-length output. It has the following characteristics: One-way: It is difficult to derive the input from the output. Irreversibility: The original data cannot be deduced from the hash value. Anti-collision: The probability of different inputs producing the same hash value is extremely low. Its uses include: 1. Verify message integrity. 2. In digital signatures, the message is hashed first, and then the digest value is signed to improve computational efficiency. Common cryptographic hash algorithms include: SHA-256, SM3, etc.

[0038] Key derivation function (KDF): is a function used to derive a key or key material from one or more inputs. Its main function is to generate a stronger key from a user-provided password and some additional parameters. The selection and parameter setting of the key derivation function are critical to generating secure keys and should be selected and configured based on specific security requirements and best practices. Common key derivation functions include: Hash function: takes the source key as input and uses a hash function (such as SHA-256) to generate a fixed-length output as the target key. Pseudo-random function (PRF): PRF is a special hash function used to generate a pseudo-random number sequence. PRF usually takes the source key and some additional information as input to generate a pseudo-random number sequence that can be used for key derivation.

[0039] In response to the technical problem that the latest cryptographic industry standard GM / T 0130-2023 algorithm in the related technology does not involve a key exchange protocol, and there is no key negotiation scheme that is fully adapted to the protocol in the related technology, the embodiment of the present application provides a key negotiation method based on the certificateless public key cryptographic system of the cryptographic industry standard GM / T 0130-2023. The method can negotiate the same negotiated key based on the user identification and declared public key of both parties, and realize encrypted communication between the two parties based on the negotiated key.

[0040] The key negotiation method based on the certificateless public key cryptography system provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0041] like Figure 1 As shown, an embodiment of the present application provides a key agreement method based on a certificateless public key cryptographic system, the method is applied to a first user of the certificateless public key cryptographic system, and the method may include the following steps 101 to 103: Step 101: Receive a second user identification, a second declared public key, and a second random result sent by a second user in the certificateless public key cryptography system.

[0042] The second random result is obtained by multiplying the second user random number by a base point of an elliptic curve. The second user random number is a random number generated by the second user.

[0043] Exemplarily, the first user needs to generate a negotiated key according to the second user identification, the second declared public key and the second random result sent by the second user. Based on this, before generating the negotiated key, the above information sent by the second user needs to be received first.

[0044] For example, the second user can generate a random number v and calculate R based on the random number v. B =vG. Where G is the base point of the elliptic curve. Then, the obtained second user ID B , the second declared public key W B And the calculated R B Sent to the first user, the first user receives the second user ID B , the second declared public key W B and R B Afterwards, a negotiated key is generated through calculation.

[0045] Step 102: Calculate a second actual public key of the second user based on the second user identifier, the second declared public key, and certificateless public key cryptography system parameters.

[0046] The parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys.

[0047] Exemplarily, in the process of the first user generating a negotiated key, it is first necessary to calculate the actual public key of the second user, that is, the second actual public key mentioned above.

[0048] In a possible implementation, when calculating the second actual public key, it can be calculated based on the second identification parameter converted from the bit length of the second user identification, the second identification, the second declared public key, and parameters of the certificateless public key cryptography system.

[0049] Specifically, the step of calculating the second actual public key in the above step 102 may further include the following steps 102a, 102b and 102c: Step 102a, using a cryptographic hash algorithm to calculate the second identification parameter, the second user identification, the coefficients of the elliptic curve equation, the coordinate values ​​of the base point of the elliptic curve, and the coordinate values ​​of the system master public key to obtain a first calculation result.

[0050] The second identification parameter is obtained by converting the bit length of the second user identification.

[0051] Exemplarily, the first user may calculate the first calculation result by the following formula 1: (Formula 1)

[0052] in, is the first calculation result mentioned above; is the second identification parameter, the second user identification The bit length is entlenB, (i.e., the second identification parameter mentioned above) is two bytes converted from the integer entlenB; SM3 is a cryptographic hash algorithm; a and b are system parameters, specifically the coefficients of the elliptic curve equation; and are the base points G of the above elliptic curve. x Coordinate values ​​and y Coordinate value; and They are the master keys of the certificateless public key cryptography system. x Coordinate values ​​and y Coordinate value; the operator || indicates data concatenation.

[0053] It should be noted that the cryptographic hash algorithm used in the embodiments of the present application may be the above-mentioned SM3 algorithm or other algorithms.

[0054] Step 102b: Use a cryptographic hash algorithm to calculate the first calculation result and the coordinate value of the second declared public key to obtain a second calculation result, and perform a modular operation on the second calculation result and the order of the base point of the elliptic curve to obtain a third calculation result.

[0055] Exemplarily, the first user may calculate the third calculation result by the following formula 2: (Formula 2)

[0056] in, is the third calculation result mentioned above; and are the second declared public key x Coordinate values ​​and y Coordinate value; n is the order of the base point G.

[0057] Step 102c: Add a first target product obtained by multiplying the third calculation result by the system master public key to the second declared public key to obtain the second actual public key.

[0058] Exemplarily, the first user may calculate the second actual public key by the following formula 3: (Formula 3)

[0059] Among them, the above is the actual public key of the second user, that is, the second actual public key mentioned above.

[0060] Exemplarily, after obtaining the second actual public key, the first user can calculate a negotiated key, which is the same as the negotiated key calculated by the second user.

[0061] Step 103: Use a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number, and the user private key of the first user to obtain a first negotiated key with a length equal to the negotiated key length.

[0062] Among them, the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user and the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve.

[0063] Specifically, in the above step 103, the step of calculating the first negotiated key may further include the following steps 103a1 to 103a3: Step 103a1: Add the second random result and the second actual public key to obtain a first target sum.

[0064] Step 103a2: multiply the sum of the first user's private key and the first user's random number by the first target sum to obtain a first intermediate result.

[0065] Step 103a3: Input the first intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the first negotiated key.

[0066] Exemplarily, the first user may calculate the first negotiated key by using the following formula 4: (Formula 4)

[0067] in, is the first negotiated key mentioned above; is the private key of the first user; To negotiate the key length.

[0068] Exemplarily, the first negotiated key calculated based on the above steps is the same as the negotiated key calculated by the second user, so the first user can perform encrypted communication with the second user using the negotiated key.

[0069] like Figure 2 As shown, an embodiment of the present application provides a key agreement method based on a certificateless public key cryptographic system, the method is applied to a second user of the certificateless public key cryptographic system, and the method may include the following steps 201 to 203: Step 201: Receive a first user identification, a first declared public key, and a first random result sent by a first user in the certificateless public key cryptography system.

[0070] The first random result is obtained by multiplying a first user random number generated by the first user by a base point of an elliptic curve.

[0071] Exemplarily, the second user needs to generate a negotiated key according to the first user identification, the first declared public key and the first random result sent by the first user. Based on this, before generating the negotiated key, the above information sent by the first user needs to be received first.

[0072] For example, the second user can generate a random number u and calculate R based on the random number u. A =uG. Where G is the base point of the elliptic curve. Then, the first user ID obtained is A , the first declared public key W A And the calculated R A Send to the second user, the second user receives the first user ID A , the first declared public key W A and R A Afterwards, a negotiated key is generated through calculation.

[0073] Step 202: Calculate a first actual public key of the first user based on the first user identifier, the first declared public key, and certificateless public key cryptography system parameters.

[0074] Exemplarily, the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key. In the process of the first user generating a negotiated key, the actual public key of the second user, namely the second actual public key, needs to be calculated first.

[0075] In a possible implementation, when calculating the first actual public key, it may also be calculated based on a first identification parameter converted from a bit length of the first user identification and a parameter of a certificateless public key cryptography system.

[0076] Specifically, the step of calculating the first actual public key in the above step 202 may further include the following steps 202a, 202b and 202c: Step 202a, using a cryptographic hash algorithm to calculate the first identification parameter, the first user identification, the coefficients of the elliptic curve equation, the coordinate values ​​of the base points of the elliptic curve, and the coordinate values ​​of the master key of the certificateless public key cryptography system to obtain a fourth calculation result.

[0077] The first identification parameter is obtained by converting the bit length of the first user identification.

[0078] Exemplarily, the second user may calculate the fourth calculation result by the following formula 5: (Formula 5)

[0079] in, is the fourth calculation result above; is the first identification parameter, the first user identification The bit length is entlenA, (i.e., the first identification parameter mentioned above) is two bytes converted from the integer entlenA; SM3 is a cryptographic hash algorithm; a and b are system parameters, specifically the coefficients of the elliptic curve equation; and are the base points G of the above elliptic curve. x Coordinate values ​​and y Coordinate value; and They are the master keys of the certificateless public key cryptography system. x Coordinate values ​​and y Coordinate value; the operator || indicates data concatenation.

[0080] Step 202b: Use a cryptographic hash algorithm to calculate the fourth calculation result and the coordinate value of the first declared public key to obtain a fifth calculation result, and perform a modular operation on the fifth calculation result and the order of the base point of the elliptic curve to obtain a sixth calculation result.

[0081] Exemplarily, the first user may calculate the sixth calculation result by the following formula 6: (Formula 6)

[0082] in, is the fourth calculation result above; and The first declared public key x Coordinate values ​​and y Coordinate value; n is the order of the base point G.

[0083] Step 202c: Add a second target product obtained by multiplying the sixth calculation result by the system master public key to the first declared public key to obtain the first actual public key.

[0084] Exemplarily, the first user may calculate the first actual public key by the following formula 7: (Formula 7)

[0085] Among them, the above is the actual public key of the first user, that is, the first actual public key mentioned above.

[0086] Exemplarily, after obtaining the first actual public key, the second user can calculate a negotiated key, which is the same as the negotiated key calculated by the first user.

[0087] Step 203: Use a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user, and the second user random number to obtain a second negotiated key with a length equal to the negotiated key length.

[0088] Among them, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0089] Specifically, in the above step 203, the step of calculating the first negotiated key may further include the following steps 203a1 to 203a3: Step 203a1: Add the first random result and the first actual public key to obtain a second target sum.

[0090] Step 203a2: Add the user private key of the second user to the second user random number and multiply the obtained sum by the second target sum to obtain a second intermediate result.

[0091] Step 203a3: Input the second intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the second negotiated key.

[0092] Exemplarily, the second user may calculate the second negotiated key by using the following formula 8: (Formula 8)

[0093] in, is the second negotiated key; is the private key of the second user; To negotiate the key length.

[0094] Exemplarily, the second negotiated key calculated based on the above steps is the same as the negotiated key calculated by the first user, so the second user can perform encrypted communication with the first user using the negotiated key.

[0095] For example, Figure 3As shown, the steps of key negotiation between user A and user B based on the certificateless public key cryptography system are shown. The steps of user A (i.e., the first user) generating the negotiated key include: S1b, sending user identification B (i.e., the second user identification), declaring public key B (i.e., the second declared public key) and identification parameter B (i.e., the first identification parameter); S2a, calculating the actual public key of user B (i.e., the second actual public key) based on user identification B, declaring public key B and identification parameter B, and using the key derivation function to calculate the negotiated key A (i.e., the first negotiated key) based on the actual public key of user B. Similarly, user B can also generate the negotiated key B through steps S1a and S2b.

[0096] The key negotiation method based on the certificateless public key cryptography system provided in the embodiment of the present application first receives the second user identification, the second declared public key and the second random result sent by the second user in the certificateless public key cryptography system; the second random result is obtained based on the product of the second user random number and the base point of the elliptic curve; then, the second actual public key of the second user is calculated based on the second user identification, the second declared public key and the certificateless public key cryptography system parameters; the parameters of the certificateless public key cryptography system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; finally, the second actual public key, the second random result, the negotiation key length, the first user random number and the first user's user private key are calculated using a key derivation function to obtain a first negotiation key with a length of the negotiation key length. In this way, key negotiation based on user identity can be implemented in the certificateless public key cryptography system.

[0097] It should be noted that the key negotiation method based on the certificateless public key cryptography system provided in the embodiment of the present application can be executed by a key negotiation device based on the certificateless public key cryptography system, or a control module in the key negotiation device based on the certificateless public key cryptography system for executing the key negotiation method based on the certificateless public key cryptography system. In the embodiment of the present application, a key negotiation device based on the certificateless public key cryptography system executing the key negotiation method based on the certificateless public key cryptography system is taken as an example to illustrate the key negotiation device based on the certificateless public key cryptography system provided in the embodiment of the present application.

[0098] It should be noted that in the embodiments of the present application, the key negotiation methods based on the certificateless public key cryptographic system shown in the above-mentioned method drawings are all illustrated by combining an accompanying drawing in the embodiments of the present application as an example. In specific implementation, the key negotiation methods based on the certificateless public key cryptographic system shown in the above-mentioned method drawings can also be implemented in combination with any other drawings that can be combined as shown in the above-mentioned embodiments, which will not be repeated here.

[0099] The key negotiation device based on the certificateless public key cryptography system provided by the present application is described below. The key negotiation method based on the certificateless public key cryptography system described above and described below can correspond to each other.

[0100] Figure 4 A schematic diagram of the structure of a key agreement device based on a certificateless public key cryptographic system applied to a first user provided in an embodiment of the present application, such as Figure 4 As shown, specifically including: The first receiving module 401 is used to receive a second user identification, a second declared public key and a second random result sent by a second user in the certificateless public key cryptographic system; the second random result is obtained based on the product of the second user's random number and the base point of the elliptic curve; the first calculating module 402 is used to calculate the second actual public key of the second user based on the second user identification, the second declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; the first calculating module 402 is also used to use a key derivation function to calculate the second actual public key of the second user The actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user are calculated to obtain a first negotiated key with a length of the negotiated key; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user and the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve.

[0101] Optionally, the first calculation module 402 is specifically used to use a cryptographic hash algorithm to calculate the second identification parameter, the second user identification, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve, and the coordinate value of the system master public key to obtain a first calculation result; the second identification parameter is obtained by converting the bit length of the second user identification; the first calculation module 402 is also specifically used to use a cryptographic hash algorithm to calculate the first calculation result and the coordinate value of the second declared public key to obtain a second calculation result, and perform a modular operation on the second calculation result and the order of the base point of the elliptic curve to obtain a third calculation result; the first calculation module 402 is also specifically used to add a first target product obtained by multiplying the third calculation result and the system master public key to the second declared public key to obtain the second actual public key.

[0102] Optionally, the first calculation module 402 is specifically used to add the second random result and the second actual public key to obtain a first target sum; the first calculation module 402 is also specifically used to add the user private key of the first user and the first user random number to obtain a first intermediate result and then multiply the first target sum; the first calculation module 402 is also specifically used to input the first intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the first negotiated key.

[0103] Figure 5 A schematic diagram of the structure of a key agreement device based on a certificateless public key cryptographic system applied to a second user provided in an embodiment of the present application, such as Figure 5 As shown, specifically including: The second receiving module 501 is used to receive a first user identification, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system; the first random result is obtained based on the product of the first user's random number and the base point of the elliptic curve; the second calculating module 502 is used to calculate the first actual public key of the first user based on the first user identification, the first declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; the second calculating module 502 is also used to use a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user The second negotiated key is calculated based on a user random number to obtain a second negotiated key with a length of the negotiated key; wherein the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0104] Optionally, the second calculation module 502 is specifically used to use a cryptographic hash algorithm to calculate the first identification parameter, the first user identification, the coefficient of the elliptic curve equation, the coordinate value of the base point of the elliptic curve, and the coordinate value of the master key of the certificateless public key cryptography system to obtain a fourth calculation result; the first identification parameter is obtained by converting the bit length of the first user identification; the second calculation module 502 is also specifically used to use a cryptographic hash algorithm to calculate the fourth calculation result and the coordinate value of the first declared public key to obtain a fifth calculation result, and perform a modular operation on the fifth calculation result and the order of the base point of the elliptic curve to obtain a sixth calculation result; the second calculation module 502 is also specifically used to add a second target product obtained by multiplying the sixth calculation result by the system master public key to the first declared public key to obtain the first actual public key.

[0105] Optionally, the second calculation module 502 is specifically used to obtain a second target sum by adding the first random result to the first actual public key; the second calculation module 502 is also specifically used to add the user private key of the second user to the second user random number and multiply the obtained sum by the second target sum to obtain a second intermediate result; the second calculation module 502 is also specifically used to input the second intermediate result and the negotiated key length as input parameters into a key derivation function for calculation to obtain the second negotiated key.

[0106] The key negotiation device based on the certificateless public key cryptography system provided by the present application first receives the second user identification, the second declared public key and the second random result sent by the second user in the certificateless public key cryptography system; the second random result is obtained by multiplying the random number of the second user and the base point of the elliptic curve; then, the second actual public key of the second user is calculated based on the second user identification, the second declared public key and the parameters of the certificateless public key cryptography system; the parameters of the certificateless public key cryptography system include: the coefficients of the elliptic curve equation, the base point of the elliptic curve, the order of the elliptic curve, and the system master public key; finally, the second actual public key, the second random result, the negotiation key length, the first user random number and the user private key of the first user are calculated using a key derivation function to obtain a first negotiation key with a length of the negotiation key. In this way, key negotiation based on user identity can be implemented in the certificateless public key cryptography system.

[0107] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communications interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a key agreement method based on a certificateless public key cryptographic system, the method comprising: receiving a second user identifier, a second declared public key and a second random result sent by a second user in the certificateless public key cryptographic system; the second random result is obtained by multiplying the random number of the second user by the base point of the elliptic curve; calculating the second actual public key of the second user based on the second user identifier, the second declared public key and the parameters of the certificateless public key cryptographic system; the parameters of the certificateless public key cryptographic system include: coefficients of the elliptic curve equation, the base point of the elliptic curve, the order of the elliptic curve, and the system master public key; using a key derivation function The second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user are calculated to obtain a first negotiated key with a length of the negotiated key; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user and the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve.Alternatively, a first user identifier, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system are received; the first random result is obtained based on the product of the first user random number and the base point of the elliptic curve; the first actual public key of the first user is calculated based on the first user identifier, the first declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; a key derivation function is used to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user random number, and a length of the negotiated key length is obtained. A second negotiated key of a key length; wherein, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0108] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0109] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the key negotiation method based on the certificateless public key cryptography system provided by the above methods, and the method includes: receiving a second user identifier, a second declared public key and a second random result sent by a second user in the certificateless public key cryptography system; the second random result is: obtained based on the product of the second user's random number and the base point of the elliptic curve; calculating the second actual public key of the second user based on the second user identifier, the second declared public key and the certificateless public key cryptography system parameters; the parameters of the certificateless public key cryptography system include: the elliptic curve Curve equation coefficients, base point of elliptic curve, order of elliptic curve, system master public key; use key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user, and obtain a first negotiated key with a length of the negotiated key length; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user and the certificateless public key cryptography system parameters, the first random result of the first user, the second user random number and the second user's user private key; the first random result is: the product of the first user random number and the base point of the elliptic curve.Alternatively, a first user identifier, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system are received; the first random result is obtained based on the product of the first user random number and the base point of the elliptic curve; the first actual public key of the first user is calculated based on the first user identifier, the first declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; a key derivation function is used to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user random number, and a length of the negotiated key length is obtained. A second negotiated key of a key length; wherein, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0110] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the key negotiation method based on the certificateless public key cryptographic system provided above, the method comprising: receiving a second user identifier, a second declared public key and a second random result sent by a second user in the certificateless public key cryptographic system; the second random result is: obtained based on the product of the second user's random number and the base point of the elliptic curve; calculating the second actual public key of the second user based on the second user identifier, the second declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; use a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user, and obtain a first negotiated key with a length of the negotiated key length; wherein the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user and the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve. Alternatively, a first user identifier, a first declared public key and a first random result sent by a first user in the certificateless public key cryptographic system are received; the first random result is obtained based on the product of the first user random number and the base point of the elliptic curve; the first actual public key of the first user is calculated based on the first user identifier, the first declared public key and the certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, system master public key; a key derivation function is used to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user and the second user random number, and a length of the negotiated key length is obtained. A second negotiated key of a key length; wherein, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve orders, and system master public keys; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

[0111] 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.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A key agreement method based on a certificateless public key cryptography system, characterized in that: Applied to a first user in a certificateless public key cryptography system, the method comprises: Receiving a second user identifier, a second declared public key, and a second random result sent by a second user in the certificateless public key cryptography system; the second random result is obtained based on the product of a random number of the second user and a base point of an elliptic curve; Calculating the second actual public key of the second user based on the second user identifier, the second declared public key and certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; Using a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number, and the user private key of the first user, to obtain a first negotiated key with a length of the negotiated key; Among them, the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user, the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve.

2. The method according to claim 1, characterized in that The calculating the second actual public key of the second user based on the second user identifier, the second declared public key and certificateless public key cryptographic system parameters includes: Using a cryptographic hash algorithm, a second identification parameter, the second user identification, an elliptic curve equation coefficient, a coordinate value of a base point of the elliptic curve, and a coordinate value of the system master public key are calculated to obtain a first calculation result; the second identification parameter is obtained by converting the bit length of the second user identification; Calculate the first calculation result and the coordinate value of the second declared public key using a cryptographic hash algorithm to obtain a second calculation result, and perform a modular operation on the second calculation result and the order of the base point of the elliptic curve to obtain a third calculation result; A first target product obtained by multiplying the third calculation result by the system master public key is added to the second declared public key to obtain the second actual public key.

3. The method according to claim 1 or 2, characterized in that: The step of using a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the user private key of the first user, and the first user random number to obtain a first negotiated key having a length of the negotiated key includes: Adding the second random result and the second actual public key to obtain a first target sum; Multiplying the sum of the first user's private key and the first user's random number by the first target sum to obtain a first intermediate result; The first intermediate result and the negotiated key length are input as input parameters into a key derivation function for calculation to obtain the first negotiated key.

4. A key agreement method based on a certificateless public key cryptography system, characterized in that: Applied to a second user in a certificateless public key cryptography system, the method comprises: Receiving a first user identifier, a first declared public key, and a first random result sent by a first user in the certificateless public key cryptography system; the first random result is obtained based on the product of a random number of the first user and a base point of an elliptic curve; Calculate the first actual public key of the first user based on the first user identifier, the first declared public key and certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; Using a key derivation function, calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user, and the second user random number to obtain a second negotiated key with a length of the negotiated key; Among them, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

5. The method according to claim 4, characterized in that The calculating the first actual public key of the first user based on the first user identifier, the first declared public key and certificateless public key cryptographic system parameters includes: Using a cryptographic hash algorithm, a first identification parameter, the first user identification, an elliptic curve equation coefficient, a coordinate value of a base point of the elliptic curve, and a coordinate value of a master key of the certificateless public key cryptographic system are calculated to obtain a fourth calculation result; the first identification parameter is obtained by converting the bit length of the first user identification; Calculate the fourth calculation result and the coordinate value of the first declared public key using a cryptographic hash algorithm to obtain a fifth calculation result, and perform a modular operation on the fifth calculation result and the order of the base point of the elliptic curve to obtain a sixth calculation result; A second target product obtained by multiplying the sixth calculation result by the system master public key is added to the first declared public key to obtain the first actual public key.

6. The method according to claim 4 or 5, characterized in that: The step of using a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user, and the second user random number to obtain a second negotiated key having a length of the negotiated key includes: Adding the first random result and the first actual public key to obtain a second target sum; Adding the user private key of the second user to the second user random number and multiplying the obtained sum by the second target sum to obtain a second intermediate result; The second intermediate result and the negotiated key length are input as input parameters into a key derivation function for calculation to obtain the second negotiated key.

7. A key agreement device based on a certificateless public key cryptographic system, characterized in that: Applied to a first user in a certificateless public key cryptography system, the device comprises: A first receiving module is used to receive a second user identification, a second declared public key and a second random result sent by a second user in the certificateless public key cryptography system; the second random result is obtained based on the product of the second user's random number and the base point of the elliptic curve; A first calculation module, configured to calculate a second actual public key of the second user based on the second user identifier, the second declared public key, and certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; The first calculation module is further used to use a key derivation function to calculate the second actual public key, the second random result, the negotiated key length, the first user random number, and the user private key of the first user to obtain a first negotiated key with a length of the negotiated key; Among them, the first negotiated key is the same as the second negotiated key generated by the second user; the second negotiated key is calculated by the second user based on the first user identifier of the first user, the first declared public key of the first user, the certificateless public key cryptographic system parameters, the first random result of the first user, the second user random number and the user private key of the second user; the first random result is: the product of the first user random number and the base point of the elliptic curve.

8. A key agreement device based on a certificateless public key cryptographic system, characterized in that: Applied to a second user in a certificateless public key cryptographic system, the device comprises: A second receiving module is used to receive a first user identifier, a first declared public key and a first random result sent by a first user in the certificateless public key cryptography system; the first random result is obtained based on the product of a random number of the first user and a base point of an elliptic curve; A second calculation module is used to calculate the first actual public key of the first user based on the first user identifier, the first declared public key and certificateless public key cryptographic system parameters; the parameters of the certificateless public key cryptographic system include: elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; The second calculation module is further used to use a key derivation function to calculate the first actual public key, the first random result, the negotiated key length, the user private key of the second user, and the second user random number to obtain a second negotiated key with a length of the negotiated key; Among them, the second negotiated key is the same as the first negotiated key generated by the first user; the first negotiated key is calculated by the first user using a key derivation function based on the second actual public key, the second random result, the negotiated key length, the first user random number and the user private key of the first user; the second actual public key is: calculated based on the second user identifier, the second user declared public key and the certificateless public key cryptographic system parameters; the certificateless public key cryptographic system parameters include elliptic curve equation coefficients, elliptic curve base points, elliptic curve order, and system master public key; the second random result is: obtained by the second user based on the product of the generated random number and the base point of the elliptic curve.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the key negotiation method based on the certificateless public key cryptography system as described in any one of claims 1 to 3, or any one of claims 4 to 6 are implemented.

10. A certificateless public key cryptographic system, characterized in that: The certificateless public key cryptography system includes: a first user and a second user, the first user is used to execute the steps of the key negotiation method based on the certificateless public key cryptography system as described in any one of claims 1 to 3, and the second user is used to execute the steps of the key negotiation method based on the certificateless public key cryptography system as described in any one of claims 4 to 6.

Citation Information

Patent Citations

  • An implementation method of certificateless public key cryptosystem based on elliptic curve

    CN108989053A

  • Shared secret key generation method and device, computer equipment and storage medium

    CN109818744A

  • Certificateless key negotiation method, system, device and medium

    CN117394995A

  • Method for realizing multi-party collaborative identity authentication and key negotiation processing in cloud environment based on domestic commercial cryptographic algorithm

    CN117527229A