A data transmission method, device, intelligent terminal and gateway device
Generating shared key pairs through the ECDH algorithm solves the problem that wireless communication technology comes with encryption methods cannot be used, ensures the security of data transmission, provides a replacement solution for data transmission, and ensures the security and integrity of data transmission.
Patent Information
- Application Number
- CN202111500287.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The data encryption method provided by wireless communication technology cannot be used in some cases, which affects the security of data transmission, especially when the underlying hardware driver does not support the built-in encryption algorithm.
By generating a shared key pair, the elliptic curve Diffie-Hermann key exchange algorithm (ECDH) generates public and private keys on the gateway side and terminal side to ensure the key seed encryption and realizes encrypted data transmission.
In the case where wireless communication technology cannot be used, an alternative solution for data transmission is provided to ensure the security of data transmission and ensure the security and integrity of data transmission through key negotiation and encryption algorithms.
Smart Images

Figure CN114039727B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular relates to a data transmission method, device, intelligent terminal and gateway equipment. Background Art
[0002] Most wireless communication technologies, such as Bluetooth wireless communication, have built-in data encryption transmission mechanisms. For example, the encryption of information transmission channels can ensure that the data transmitted by the communicating parties will not be tampered with or intercepted by a third party.
[0003] However, in actual applications, the data encryption method provided by wireless communication technology often cannot be used. For example, the hardware underlying driver does not support the built-in encryption algorithm. If data transmission is performed without taking any encryption measures, the security of data transmission will be seriously affected. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a data transmission method, device, intelligent terminal and gateway device, which can generate a shared key for encrypting data, so as to realize the encrypted transmission of the data to be transmitted, as a substitute method when the data encryption method provided by the wireless communication technology cannot be used, to ensure the security of data transmission. The specific scheme is as follows:
[0005] In a first aspect, the present invention provides a data transmission method, applied to a gateway device, the method comprising:
[0006] Get the key seed;
[0007] Generate a gateway-side key pair, the gateway-side key pair comprising a gateway public key and a gateway private key;
[0008] Sending the gateway public key and the key seed to the intelligent terminal;
[0009] Receiving a terminal public key and a first ciphertext of the smart terminal;
[0010] The first ciphertext is obtained by the smart terminal generating a first shared key based on the terminal private key, the gateway public key and the key seed, and encrypting the key seed with the first shared key;
[0011] Generate a second shared key according to the terminal public key, the gateway private key and the key seed;
[0012] Encrypting the key seed based on the second shared key to obtain a second ciphertext;
[0013] If the first ciphertext is consistent with the second ciphertext, response information indicating that data transmission can be performed is sent to the smart terminal.
[0014] Optionally, generating a gateway-side key pair includes:
[0015] Performing a modulo-2 operation on the key seed to obtain a first calculation result;
[0016] Determine a first target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the first calculation result;
[0017] A gateway-side key pair is generated based on the ECDH algorithm and the first target curve.
[0018] Optionally, after sending the response information, the method further includes:
[0019] Data transmission is performed based on the second shared key and a preset encryption algorithm.
[0020] In a second aspect, the present invention provides a data transmission method, applied to a smart terminal, the method comprising:
[0021] receiving a key seed and a gateway public key of the gateway device from the gateway device;
[0022] Generate a terminal-side key pair, the terminal-side key pair including a terminal public key and a terminal private key;
[0023] Generate a first shared key according to the gateway public key, the terminal private key and the key seed;
[0024] Encrypting the key seed based on the first shared key to obtain a first ciphertext;
[0025] Sending the first ciphertext and the terminal public key to the gateway device;
[0026] Receiving a response message indicating that data transmission can be performed;
[0027] Wherein, the response information is sent by the gateway device when the first ciphertext and the second ciphertext are consistent;
[0028] The second ciphertext is obtained by the gateway device generating a second shared key according to the terminal public key, its own gateway private key and the key seed, and encrypting the key seed based on the second shared key.
[0029] Optionally, generating a terminal-side key pair includes:
[0030] Performing a modulo-2 operation on the key seed to obtain a second calculation result;
[0031] Determine a second target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the second calculation result;
[0032] A terminal-side key pair is generated based on the ECDH algorithm and the second target curve.
[0033] Optionally, after obtaining the response information, the method further includes:
[0034] Data transmission is performed based on the first shared key and a preset encryption algorithm.
[0035] In a third aspect, the present invention provides a data transmission device, applied to a gateway device, the device comprising:
[0036] An acquisition unit, used for acquiring a key seed;
[0037] A first generating unit, configured to generate a gateway-side key pair, wherein the gateway-side key pair includes a gateway public key and a gateway private key;
[0038] A first sending unit, used to send the gateway public key and the key seed to the intelligent terminal;
[0039] A first receiving unit, used to obtain a terminal public key and a first ciphertext of the smart terminal;
[0040] The first ciphertext is obtained by the smart terminal generating a first shared key based on the terminal private key, the gateway public key and the key seed, and encrypting the key seed with the first shared key;
[0041] A second generating unit, configured to generate a second shared key according to the terminal public key, the gateway private key and the key seed;
[0042] A first encryption unit, configured to encrypt the key seed based on the second shared key to obtain a second ciphertext;
[0043] The second sending unit is configured to send response information indicating that data transmission can be performed to the smart terminal if the first ciphertext is consistent with the second ciphertext.
[0044] In a fourth aspect, the present invention provides a data transmission device, applied to a smart terminal, the device comprising:
[0045] A second receiving unit, configured to receive a key seed and a gateway public key of the gateway device from the gateway device;
[0046] A third generating unit, configured to generate a terminal-side key pair, wherein the terminal-side key pair includes a terminal public key and a terminal private key;
[0047] A fourth generating unit, configured to generate a first shared key according to the gateway public key, the terminal private key and the key seed;
[0048] A second encryption unit, configured to encrypt the key seed based on the first shared key to obtain a first ciphertext;
[0049] A third sending unit, configured to send the first ciphertext and the terminal public key to the gateway device;
[0050] A third receiving unit, used to receive response information indicating that data transmission can be performed;
[0051] Wherein, the response information is sent by the gateway device when the first ciphertext and the second ciphertext are consistent;
[0052] The second ciphertext is obtained by the gateway device generating a second shared key according to the terminal public key, its own gateway private key and the key seed, and encrypting the key seed based on the second shared key.
[0053] In a fifth aspect, the present invention provides a gateway device, comprising: a memory and a processor; the memory stores a program suitable for execution by the processor to implement the data transmission method described in any one of the first aspects of the present invention.
[0054] In a sixth aspect, the present invention provides an intelligent terminal, comprising: a memory and a processor; the memory stores a program suitable for execution by the processor to implement the data transmission method described in any one of the second aspects of the present invention.
[0055] Based on the above technical solution, the data transmission method provided by the present invention, after the gateway device obtains the key seed and generates the gateway side key pair including the gateway public key and the gateway private key, sends the gateway public key and the key seed to the smart terminal, the smart terminal generates the first shared key based on the terminal private key, the gateway public key and the key seed, and encrypts the key seed by the first shared key to obtain the first ciphertext, the gateway device further receives the terminal public key and the first ciphertext of the smart terminal, and generates the second shared key according to the terminal public key, the gateway private key and the key seed, encrypts the key seed based on the second shared key to obtain the second ciphertext, and finally, the gateway device compares the consistency of the first ciphertext and the second ciphertext, if the first ciphertext and the second ciphertext are consistent, then sends a response message indicating that data transmission can be performed to the terminal device. In the data transmission method provided by the present invention, both the terminal device and the gateway device can generate a shared key for encrypting data, which is used to realize the encrypted transmission of the data to be transmitted, as a substitute method when the data encryption method provided by the wireless communication technology cannot be used, to ensure the security of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flow chart of a data transmission method provided by an embodiment of the present invention;
[0058] Figure 2 is a structural block diagram of a data transmission device provided by an embodiment of the present invention;
[0059] Figure 3 is a structural block diagram of another data transmission device provided by an embodiment of the present invention;
[0060] Figure 4 is a structural block diagram of another data transmission device provided by an embodiment of the present invention;
[0061] Figure 5 is a structural block diagram of another data transmission device provided by an embodiment of the present invention;
[0062] Figure 6 is a structural block diagram of an intelligent terminal provided by an embodiment of the present invention;
[0063] Figure 7 It is a structural block diagram of a gateway device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] See also Figure 1 , Figure 1 is a flow chart of a data transmission method provided by an embodiment of the present invention. The flow of the data transmission method provided by this embodiment includes:
[0066] S100. The gateway device obtains a key seed.
[0067] In practical applications, random numbers can be used as key seeds. Of course, other information can also be selected as key seeds, which are not listed here one by one. Without exceeding the scope of the core idea of the present invention, any information or data that can be used as a key seed falls within the scope of protection of the present invention.
[0068] Optionally, when a random number is selected as the key seed, the random number can be obtained by a random number generator. Of course, it can also be obtained by other methods. The present invention does not limit the specific method for generating the random number.
[0069] S110. The gateway device generates a gateway-side key pair.
[0070] The data transmission method provided in this embodiment is implemented based on the asymmetric encryption concept. Therefore, after obtaining the key seed, a gateway side key pair is first generated. According to the implementation principle of the asymmetric encryption algorithm, the gateway side key pair described in this embodiment includes a gateway public key and a gateway private key.
[0071] Optionally, when the key seed is implemented using a random number, the gateway-side key pair can be generated based on the ECDH (Elliptic Curve Diffie-Hellman key Exchange) algorithm. First, the key seed is modulo 2 to obtain a first calculation result, and then the first target curve used by the ECDH algorithm is determined based on the first calculation result. For example, if the first calculation result is 0, the SECP256K1 curve is used as the first target curve. If the first calculation result is 1, the SECP256P1 curve is used as the first target curve. After determining the first target curve, the gateway-side key pair can be generated based on the ECDH algorithm and the first target curve.
[0072] As for the specific implementation process of generating the gateway-side key pair based on the ECDH algorithm and the first target curve, it can be implemented based on the existing technology, and the present invention does not limit this.
[0073] S120. The gateway device sends the gateway public key and key seed to the smart terminal.
[0074] S130. The intelligent terminal receives a key seed and a gateway public key from the gateway device.
[0075] S140. The intelligent terminal generates a terminal-side key pair.
[0076] Similar to the aforementioned gateway-side key pair, the terminal-side key pair mentioned in this step includes a terminal public key and a terminal private key. It should be noted that based on the basic principle of the asymmetric encryption algorithm, the smart terminal needs to use the same algorithm as the gateway device to generate the terminal-side key pair. Therefore, after obtaining the key seed provided by the gateway device, the smart terminal also needs to perform a modulo 2 operation on the key seed to obtain a second calculation result, and determine the second target curve used by the ECDH algorithm based on the second calculation result. The process of determining the second target curve is the same as the process of determining the first target curve, and will not be repeated here. After determining the second target curve, the smart terminal can generate a terminal-side key pair based on the ECDH algorithm and the second target curve.
[0077] S150. The intelligent terminal generates a first shared key according to the gateway public key, the terminal private key and the key seed.
[0078] It should be noted that the specific process of the smart terminal generating the first shared key according to the gateway public key, the terminal private key and the key seed can be obtained based on the key generation algorithm in the prior art, and the present invention does not make specific limitations on this.
[0079] S160. The intelligent terminal encrypts the key seed based on the first shared key to obtain a first ciphertext.
[0080] The process in which the intelligent terminal encrypts the key seed based on the first shared key to obtain the first ciphertext can be implemented based on a preset encryption algorithm, and the present invention does not make any specific limitation on this.
[0081] S170. The intelligent terminal sends a first ciphertext and a terminal public key to the gateway device.
[0082] S180. The gateway device receives the terminal public key and the first ciphertext of the smart terminal.
[0083] S190. The gateway device generates a second shared key according to the terminal public key, the gateway private key and the key seed.
[0084] It should be noted that when the gateway device generates the second shared key, it should use the same encryption algorithm as when the smart terminal generates the first shared key. Moreover, when the data transmission channel is secure and the transmitted data has not been tampered with, the second shared key of the gateway device and the first shared key of the smart terminal should be the same in content. Of course, this is also the premise and basis for the present invention to achieve security verification.
[0085] S200. The gateway device encrypts the key seed based on the second shared key to obtain a second ciphertext.
[0086] First of all, it should be emphasized that the gateway device should use the same encryption algorithm as the smart terminal to encrypt the key seed. As mentioned above, under the premise that the data transmission channel is secure and the transmitted data has not been tampered with, the second shared key is the same as the first shared key. The gateway device and the smart terminal use the same encryption key and the same encryption algorithm to encrypt the same key seed, and the obtained ciphertext should be the same. This is the key to key negotiation in the present invention.
[0087] Based on the above content, after the gateway device generates the second shared key, it can encrypt the key seed in combination with the second shared key and the preset encryption algorithm to obtain the second ciphertext.
[0088] S210: When the first ciphertext and the second ciphertext are consistent, the gateway device sends a response message to the smart terminal indicating that data transmission can be performed.
[0089] As mentioned above, if the data transmission channel is secure, the first ciphertext and the second ciphertext should be consistent, otherwise the two are inconsistent. Based on this, when the first ciphertext and the second ciphertext are consistent, the gateway device sends a response message indicating that data transmission can be carried out to inform the smart terminal of the final result of the key negotiation.
[0090] S220: The intelligent terminal receives response information.
[0091] After receiving the response information, the intelligent terminal can determine that the key negotiation is successful and can proceed to the subsequent data transmission steps.
[0092] To sum up, in the data transmission method provided by the present invention, both the terminal device and the gateway device can generate a shared key for encrypting data, which is used to realize encrypted transmission of the data to be transmitted. It serves as a substitute method when the data encryption method provided by the wireless communication technology cannot be used, thereby ensuring the security of data transmission.
[0093] Optionally, after successfully completing the above-mentioned key negotiation process, the gateway device can encrypt the data to be transmitted or decrypt the ciphertext fed back by the smart terminal based on the second shared key obtained in the previous steps and the corresponding preset encryption algorithm (the preset encryption algorithm used when encrypting the key seed, such as the AES256-CTR algorithm) to realize data transmission with the smart terminal; correspondingly, the smart terminal can decrypt the ciphertext of the data to be transmitted based on the same preset encryption algorithm and the first shared key, or encrypt the data to be transmitted based on the preset encryption algorithm and the first shared key.
[0094] exist Figure 1On the basis of the illustrated embodiment, the data transmission method provided in this embodiment can further realize encrypted data transmission. In the specific implementation process, after the communicating parties establish a communication connection once, they can communicate multiple times until the connection is disconnected. At the same time, a shared key is generated, and this shared key communication is always used in multiple communications of the connection. Moreover, in each data transmission process, the data is encrypted by the sender and decrypted by the receiver, which can effectively ensure data security.
[0095] It is understandable that the data transmission method provided in any of the above embodiments is implemented on the premise that the intelligent terminal and the gateway device have established a communication connection relationship. As for the intelligent terminal, it can be an electronic device such as a smart phone, a handheld computer, etc. in actual application, and of course, it can also be other devices that can communicate with the gateway device, which will not be listed here one by one.
[0096] The data transmission device provided in the embodiment of the present invention is introduced below. The data transmission device described below can be considered as a functional module architecture that needs to be set up in the central device to implement the data transmission method provided in the embodiment of the present invention; the content described below can be cross-referenced with the above.
[0097] See also Figure 2 , Figure 2 : is a structural block diagram of a data transmission device provided by an embodiment of the present invention. The data transmission device provided by this embodiment includes:
[0098] An acquisition unit 1, used for acquiring a key seed;
[0099] The first generating unit 2 is used to generate a gateway-side key pair, the gateway-side key pair including a gateway public key and a gateway private key;
[0100] The first sending unit 3 is used to send the gateway public key and the key seed to the intelligent terminal;
[0101] A first receiving unit 4, used to receive a terminal public key and a first ciphertext of the smart terminal;
[0102] The first ciphertext is obtained by generating a first shared key by the intelligent terminal based on the terminal private key, the gateway public key and the key seed, and encrypting the key seed with the first shared key;
[0103] A second generating unit 5, configured to generate a second shared key according to a terminal public key, a gateway private key and a key seed;
[0104] A first encryption unit 6, configured to encrypt the key seed based on the second shared key to obtain a second ciphertext;
[0105] The second sending unit 7 is configured to send a response message indicating that data transmission can be performed to the intelligent terminal if the first ciphertext and the second ciphertext are consistent.
[0106] Optionally, the first generating unit 2 is used to generate a gateway-side key pair, including:
[0107] Performing a modulo-2 operation on the key seed to obtain a first calculation result;
[0108] Determine a first target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the first calculation result;
[0109] Generate a gateway-side key pair based on the ECDH algorithm and the first target curve.
[0110] Optional, see Figure 3 , Figure 3 is a structural block diagram of another data transmission device provided by an embodiment of the present invention. Figure 2 Based on the embodiment shown, it also includes:
[0111] The first transmission unit 8 is used for performing data transmission based on the second shared key and a preset encryption algorithm.
[0112] Optional, see Figure 4 , Figure 4 : is a structural block diagram of another data transmission device provided by an embodiment of the present invention, the device comprising:
[0113] The second receiving unit 9 is used to receive a key seed and a gateway public key of the gateway device from the gateway device;
[0114] The third generating unit 10 is used to generate a terminal side key pair, the terminal side key pair includes a terminal public key and a terminal private key;
[0115] The fourth generating unit 11 is used to generate a first shared key according to the gateway public key, the terminal private key and the key seed;
[0116] A second encryption unit 12 is used to encrypt the key seed based on the first shared key to obtain a first ciphertext;
[0117] The third sending unit 13 is used to send the first ciphertext and the terminal public key to the gateway device;
[0118] The third receiving unit 14 is used to receive response information indicating that data transmission can be performed;
[0119] Wherein, the response information is sent by the gateway device when the first ciphertext and the second ciphertext are consistent;
[0120] The second ciphertext is obtained by the gateway device generating a second shared key according to the terminal public key, its own gateway private key and the key seed, and encrypting the key seed based on the second shared key.
[0121] Optionally, the third generating unit 10 is used to generate a terminal-side key pair, including:
[0122] Performing a modulo-2 operation on the key seed to obtain a second calculation result;
[0123] Determine a second target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the second calculation result;
[0124] Generates a terminal-side key pair based on the ECDH algorithm and the second target curve.
[0125] Optional, see Figure 5 , Figure 5 is a structural block diagram of another data transmission device provided by an embodiment of the present invention. Figure 4 Based on the embodiment shown, it also includes:
[0126] The second transmission unit 15 is used for performing data transmission based on the first shared key and a preset encryption algorithm.
[0127] Optional, see Figure 6 , Figure 6 For a structural block diagram of the intelligent terminal provided by an embodiment of the present invention, see Figure 6 As shown, it may include: at least one processor 100, at least one communication interface 200, at least one memory 300 and at least one communication bus 400;
[0128] In the embodiment of the present invention, the number of the processor 100, the communication interface 200, the memory 300, and the communication bus 400 is at least one, and the processor 100, the communication interface 200, and the memory 300 communicate with each other through the communication bus 400; obviously, Figure 6 The communication connections shown for the processor 100, the communication interface 200, the memory 300, and the communication bus 400 are merely optional;
[0129] Optionally, the communication interface 200 may be an interface of a communication module;
[0130] The processor 100 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0131] The memory 300 stores application programs and may include a high-speed RAM memory and may also include a non-volatile memory, such as at least one disk memory.
[0132] The processor 100 is specifically used to execute the application program in the memory to implement any embodiment of the method executed by the smart terminal in the above-mentioned data transmission method.
[0133] Optional, see Figure 7 , Figure 7 For a structural block diagram of a gateway device provided in an embodiment of the present invention, see Figure 7 As shown, it may include: at least one processor 500, at least one communication interface 600, at least one memory 700 and at least one communication bus 800;
[0134] In the embodiment of the present invention, the number of the processor 500, the communication interface 600, the memory 700, and the communication bus 800 is at least one, and the processor 500, the communication interface 600, and the memory 700 communicate with each other through the communication bus 800; obviously, Figure 7 The communication connections shown for the processor 500, communication interface 600, memory 700, and communication bus 800 are merely optional;
[0135] Optionally, the communication interface 600 may be an interface of a communication module;
[0136] The processor 500 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0137] The memory 700 stores application programs and may include a high-speed RAM memory and may also include a non-volatile memory, such as at least one disk memory.
[0138] The processor 500 is specifically used to execute the application program in the memory to implement any embodiment of the method executed by the gateway device in the above-mentioned data transmission method.
[0139] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0140] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0141] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0142] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the core concept or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission method, It is characterized in that Applied to a gateway device, the method comprises: Get the key seed; Generate a gateway-side key pair, the gateway-side key pair comprising a gateway public key and a gateway private key; Sending the gateway public key and the key seed to the intelligent terminal; Receiving a terminal public key and a first ciphertext of the smart terminal; The first ciphertext is obtained by the smart terminal generating a first shared key based on the terminal private key, the gateway public key and the key seed, and encrypting the key seed with the first shared key; Generate a second shared key according to the terminal public key, the gateway private key and the key seed; Encrypt the key seed based on the second shared key to obtain a second ciphertext; wherein the second ciphertext and the first ciphertext are encrypted using the same encryption algorithm respectively; If the first ciphertext and the second ciphertext are consistent, sending a response message indicating that data transmission can be performed to the smart terminal; The method of generating a gateway side key pair includes: performing a modulo 2 operation on the key seed to obtain a first calculation result; determining a first target curve used by an elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the first calculation result; and generating a gateway side key pair based on the ECDH algorithm and the first target curve.
2. The data transmission method according to claim 1, It is characterized in that After sending the response information, the method further includes: Data transmission is performed based on the second shared key and a preset encryption algorithm.
3. A data transmission method, It is characterized in that Applied to a smart terminal, the method comprises: receiving a key seed and a gateway public key of the gateway device from the gateway device; Generate a terminal-side key pair, the terminal-side key pair including a terminal public key and a terminal private key; Generate a first shared key according to the gateway public key, the terminal private key and the key seed; Encrypting the key seed based on the first shared key to obtain a first ciphertext; Sending the first ciphertext and the terminal public key to the gateway device; Receiving a response message indicating that data transmission can be performed; Wherein, the response information is sent by the gateway device when the first ciphertext and the second ciphertext are consistent; The second ciphertext is obtained by the gateway device generating a second shared key according to the terminal public key, its own gateway private key and the key seed, and encrypting the key seed based on the second shared key, wherein the second ciphertext and the first ciphertext are encrypted using the same encryption algorithm respectively; The generating of the terminal side key pair includes: performing a modulo 2 operation on the key seed to obtain a second calculation result; determining a second target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the second calculation result; and generating the terminal side key pair based on the ECDH algorithm and the second target curve.
4. The data transmission method according to claim 3, It is characterized in that After obtaining the response information, the method further includes: Data transmission is performed based on the first shared key and a preset encryption algorithm.
5. A data transmission device, It is characterized in that Applied to a gateway device, the device comprises: An acquisition unit, used for acquiring a key seed; A first generating unit, configured to generate a gateway-side key pair, wherein the gateway-side key pair includes a gateway public key and a gateway private key; A first sending unit, used to send the gateway public key and the key seed to the intelligent terminal; A first receiving unit, configured to receive a terminal public key and a first ciphertext of the smart terminal; The first ciphertext is obtained by the smart terminal generating a first shared key based on the terminal private key, the gateway public key and the key seed, and encrypting the key seed with the first shared key; A second generating unit, configured to generate a second shared key according to the terminal public key, the gateway private key and the key seed; A first encryption unit is used to encrypt the key seed based on the second shared key to obtain a second ciphertext; wherein the second ciphertext and the first ciphertext are encrypted using the same encryption algorithm; A second sending unit, configured to send response information indicating that data transmission can be performed to the smart terminal if the first ciphertext and the second ciphertext are consistent; The first generation unit is specifically used to perform a modulo 2 operation on the key seed to obtain a first calculation result; determine a first target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm based on the first calculation result; and generate a gateway-side key pair based on the ECDH algorithm and the first target curve.
6. A data transmission device, It is characterized in that Applied to a smart terminal, the device comprises: A second receiving unit, configured to receive a key seed and a gateway public key of the gateway device from the gateway device; A third generating unit, configured to generate a terminal-side key pair, wherein the terminal-side key pair includes a terminal public key and a terminal private key; A fourth generating unit, configured to generate a first shared key according to the gateway public key, the terminal private key and the key seed; A second encryption unit, configured to encrypt the key seed based on the first shared key to obtain a first ciphertext; A third sending unit, configured to send the first ciphertext and the terminal public key to the gateway device; A third receiving unit, used to receive response information indicating that data transmission can be performed; Wherein, the response information is sent by the gateway device when the first ciphertext and the second ciphertext are consistent; The second ciphertext is obtained by the gateway device generating a second shared key according to the terminal public key, its own gateway private key and the key seed, and encrypting the key seed based on the second shared key, wherein the second ciphertext and the first ciphertext are encrypted using the same encryption algorithm respectively; The third generation unit includes: performing a modulo 2 operation on the key seed to obtain a second calculation result; determining a second target curve used by the elliptic curve Diffie-Hellman key exchange ECDH algorithm according to the second calculation result; and generating a terminal-side key pair based on the ECDH algorithm and the second target curve.
7. A gateway device, It is characterized in that include: Memory and processor; The memory stores a program suitable for execution by the processor to implement the data transmission method according to any one of claims 1 to 2.
8. An intelligent terminal, It is characterized in that include: Memory and processor; The memory stores a program suitable for execution by the processor to implement the data transmission method according to any one of claims 3 to 5.
