Key generation method, bluetooth device, master device and electronic equipment

By using key negotiation and encryption algorithms between the Bluetooth device and the master control device, a high-security target key is generated, which solves the problems of data transmission security and resource consumption in Bluetooth communication and achieves efficient and secure data transmission.

CN120659049BActive Publication Date: 2025-11-18SHANGHAI IMILAB TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511021254.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-11-18
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

The lack of encryption mechanisms in existing Bluetooth communication leads to security risks in data transmission, and complex encryption algorithms cause problems such as reduced processing power and slower response speed for resource-constrained devices.

Method used

The communication is encrypted using public key based on key negotiation between two key pairs and the first encryption algorithm, generating a high-security target key, reducing additional encryption and decryption resource overhead, and reducing latency.

Benefits of technology

It improves the security of data transmission between Bluetooth devices and the host device, reduces the consumption of computing resources and memory, avoids the decline in processing power and slowdown in response speed, and ensures high security in the communication process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120659049B_ABST
    Figure CN120659049B_ABST
Patent Text Reader

Abstract

The present disclosure provides a key generation method, a Bluetooth device, a master device and an electronic device, and relates to the field of Bluetooth communication. The method comprises: the Bluetooth device sending a handshake request to the master device; wherein the handshake request comprises a first public key in a first key pair held by the Bluetooth device; the first public key is used for the master device to encrypt the first public key and a second public key in a second key pair held by the master device based on a first encryption algorithm to obtain first data; in response to receiving the first data from the master device, the first data is decrypted based on the first encryption algorithm to obtain the second public key; and a target key is obtained according to the first private key in the first key pair and the second public key; wherein the target key is the same as a key determined by the master device based on the first public key and a second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master device. The present disclosure can improve the security and efficiency of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Bluetooth communication technology, specifically to key generation methods, Bluetooth devices, master control devices, and electronic devices. Background Technology

[0002] The connection between a System-on-Chip (SoC) and a Bluetooth chip typically relies on standard hardware connectivity protocols. However, these protocols primarily focus on hardware specifications and voltage levels, and do not provide corresponding encryption procedures for upper-layer information transmission. Therefore, during data transmission, there are potential security vulnerabilities, making the data susceptible to malicious attacks or data tampering. Summary of the Invention

[0003] This disclosure provides a key generation method, a Bluetooth device, a master control device, and an electronic device to solve or alleviate one or more technical problems in the prior art.

[0004] In a first aspect, this disclosure provides a key generation method for use in a Bluetooth device, comprising:

[0005] Send a handshake request to the master device; wherein the handshake request includes the first public key in the first key pair held by the Bluetooth device; the first public key is used by the master device to encrypt the first public key and the second public key in the second key pair held by the master device based on the first encryption algorithm to obtain the first data;

[0006] In response to receiving the first data from the master control device, the first data is decrypted based on the first encryption algorithm to obtain the second public key;

[0007] The target key is obtained based on the first private key and the second public key in the first key pair; wherein the target key is the same as the key determined by the master control device based on the first public key and the second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0008] Secondly, this disclosure provides a key generation method applied to a master control device, comprising:

[0009] Receive a handshake request from a Bluetooth device; wherein the handshake request includes a first public key in a first key pair held by the Bluetooth device;

[0010] The first data is obtained by encrypting the first public key and the second public key in the second key pair held by the master control device based on the first encryption algorithm.

[0011] Send the first data to the Bluetooth device;

[0012] The target key is obtained based on the second private key in the first public key and the second key pair; wherein the target key is the same as the key determined by the Bluetooth device based on the first private key and the second public key in the first key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0013] Thirdly, a Bluetooth device is provided, comprising:

[0014] The handshake request module is used to send a handshake request to the master control device; wherein, the handshake request includes a first public key in a first key pair held by the Bluetooth device; the first public key is used by the master control device to encrypt the first public key and the second public key in a second key pair held by the master control device based on a first encryption algorithm to obtain first data;

[0015] The decryption module is used to respond to receiving first data from the main control device, decrypt the first data based on the first encryption algorithm, and obtain the second public key;

[0016] The first key determination module is used to obtain a target key based on the first private key and the second public key in the first key pair; wherein the target key is the same as the key determined by the master control device based on the first public key and the second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0017] Fourthly, a master control device is provided, comprising:

[0018] A request receiving module is configured to receive a handshake request from a Bluetooth device; wherein the handshake request includes a first public key in a first key pair held by the Bluetooth device.

[0019] An encryption module is used to encrypt the first public key and the second public key in the second key pair held by the master control device based on a first encryption algorithm to obtain the first data;

[0020] The data transmission module is used to send the first data to the Bluetooth device;

[0021] The second key determination module is used to obtain a target key based on the second private key in the first public key and the second key pair; wherein the target key is the same as the key determined by the Bluetooth device based on the first private key and the second public key in the first key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0022] Fifthly, an electronic device is provided, comprising:

[0023] At least one processor; and

[0024] The memory is communicatively connected to the at least one processor; wherein,

[0025] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0026] In a sixth aspect, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of the present disclosure.

[0027] The beneficial effects of the technical solution provided in this disclosure include at least the following: the master control device encrypts and transmits the first public key in the received first key pair and the second public key in the second key pair it holds based on the first encryption algorithm; the Bluetooth device decrypts the second public key based on the first encryption algorithm; thus, the master control device and the Bluetooth device can obtain the same target key based on the first public key and the second private key, and the Bluetooth device can obtain the same target key based on the first private key matching the first public key and the second public key matching the second private key. Based on key negotiation between the two key pairs and encrypted communication of the public key using the first encryption algorithm, hybrid encryption is achieved, which can generate a high-security target key and reduce the overhead of additional encryption and decryption resources. Therefore, the security of data transmission between the Bluetooth device and the master control device can be improved based on the high-security target key. The communication process does not require complex authentication procedures and protocol design, thereby reducing latency and computing power requirements, and avoiding the decrease in processing power and slow response speed due to the limited resources of the Bluetooth device.

[0028] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0029] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments provided according to this disclosure and should not be construed as limiting the scope of this disclosure.

[0030] Figure 1 This is a schematic diagram illustrating an exemplary application scenario of an embodiment of this disclosure;

[0031] Figure 2 This is a schematic flowchart of a key generation method according to an embodiment of the present disclosure;

[0032] Figure 3 This is a schematic diagram illustrating an application example of the key generation method according to an embodiment of this disclosure;

[0033] Figure 4This is a flowchart illustrating a key generation method according to another embodiment of the present disclosure;

[0034] Figure 5 This is a schematic block diagram of a Bluetooth device provided in an embodiment of the present disclosure;

[0035] Figure 6 This is a schematic block diagram of a Bluetooth device provided in another embodiment of this disclosure;

[0036] Figure 7 This is a schematic block diagram of a main control device provided in an embodiment of the present disclosure;

[0037] Figure 8 This is a schematic block diagram of a main control device provided in another embodiment of this disclosure;

[0038] Figure 9 This is a block diagram of a cluster used to implement the key generation method of the embodiments of this disclosure. Detailed Implementation

[0039] The present disclosure will now be described in further detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0040] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0041] To facilitate understanding of the key generation method provided in this disclosure, the relevant technologies of this disclosure are described below. First, the connection between the SoC (System on Chip) and the Bluetooth chip in the relevant technologies uses hardware connection protocols, such as I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface). These hardware connection protocols lack encryption mechanisms for data transmission, causing the transmitted data to be exposed to the network without protection, making it highly vulnerable to man-in-the-middle attacks and other malicious attacks. This security risk not only affects the confidentiality of data but may also lead to the leakage of sensitive information, causing serious consequences for users and enterprises.

[0042] Secondly, while introducing encryption mechanisms can significantly enhance data transmission security, complex encryption algorithms, such as RSA (Rivest-Shamir-Adleman), require more computing resources and memory. For resource-constrained devices (such as some embedded systems or Bluetooth Low Energy devices), this can lead to decreased processing power, slower response times, and even affect the normal operation of the device. Furthermore, increased power consumption may also shorten the device's battery life, limiting its application scenarios.

[0043] Finally, significant delays can occur during authentication and connection establishment due to complex authentication processes and a lack of efficient protocol design. This delay not only affects device response time and results in a poor user experience, but can also lead to serious consequences in certain real-time applications (such as medical monitoring and industrial automation).

[0044] This disclosure provides a key generation method applicable to Bluetooth devices and master control devices to address at least one of the aforementioned technical problems. Exemplarily, the key generation method of this disclosure achieves hybrid encryption based on key negotiation between two key pairs and encrypted communication of the public key using a first encryption algorithm. This generates a high-security target key during connection establishment, reducing the overhead of additional encryption and decryption resources and minimizing latency. Furthermore, the high-security target key can be used to protect board-level module communication, improving the security of data transmission between the Bluetooth device and the master control device. By enhancing the security of the target key, the complexity requirements of the encryption algorithm are correspondingly reduced, thereby reducing the consumption of computing resources and memory, and avoiding problems such as decreased processing power, slower response speed, and shortened device battery life.

[0045] To facilitate understanding of the technical solutions of the embodiments of this disclosure, the application scenarios of the embodiments of this disclosure are first introduced. Exemplarily, the main control device and Bluetooth device in the embodiments of this disclosure can be deployed in an electronic device, which can specifically be any product with Bluetooth communication capabilities. Exemplarily, the electronic device can be an Internet of Things (IoT) device, such as a smart camera, smart speaker, thermostat, or other smart home products, or a sensor, industrial robot, etc. The electronic device can also be a digital computer, such as a personal digital assistant, cellular phone, smartphone, wearable device, and other similar computing devices. The electronic device can also be an in-vehicle device, such as an in-vehicle central control screen, in-vehicle smart speaker, etc.

[0046] For example, the aforementioned electronic device may include a To-C (To Customer) device. That is, the main control device and Bluetooth device can be deployed in a To-C device. By applying the methods of this disclosure embodiment to To-C devices, the stringent cost and performance controls in To-C scenarios can be addressed, thereby resulting in improved product performance.

[0047] For example, the aforementioned electronic device may include an in-vehicle device. Specifically, a main control device and a Bluetooth device may be deployed in the in-vehicle device, which communicates with the vehicle's infotainment system via the Bluetooth device. Users can input data into the input unit of the in-vehicle device (e.g., via voice, touchscreen, etc.; the input data may include vehicle control data, configuration data, etc.). In this embodiment, the main control device can encrypt the input data based on a target key generated by a key generation method and send it to the Bluetooth device. The Bluetooth device can decrypt the input data based on the target key and securely transmit it to the vehicle's infotainment system via the Bluetooth protocol, thereby achieving vehicle control. Correspondingly, the Bluetooth device can receive vehicle data from the vehicle's infotainment system via Bluetooth, encrypt the vehicle data based on the target key, and send it to the main control device. The main control device can decrypt the vehicle data based on the target key, thereby synchronizing the vehicle data to the main control device. The main control device then controls the output unit of the in-vehicle device to output the vehicle data, facilitating user access to relevant data. As can be seen, in this embodiment of the present disclosure, the in-vehicle device can use a high-security target key for communication, thereby ensuring the security of the data exchanged between the in-vehicle device and the vehicle system, eliminating the possibility of driving safety problems caused by attacks on the in-vehicle device; and reducing latency and computing power requirements, avoiding the decrease in processing power and slow response speed due to the limited resources of the Bluetooth device.

[0048] Optionally, the Bluetooth device may include any element capable of Bluetooth connection and data transmission, such as a Bluetooth chip, Bluetooth module, etc.

[0049] Optionally, the main control device may include any component that can be used to drive the Bluetooth module. Optionally, the main control device may also be used to control electronic devices. For example, the main control device may include a main control chip, such as a SoC.

[0050] Figure 1 This is a schematic diagram illustrating an exemplary application scenario of this disclosure, such as... Figure 1As shown, in this embodiment of the present disclosure, the main control device can be a SoC, and the Bluetooth device can be a Bluetooth module. The SoC and the Bluetooth module can be set in a PCB (Printed Circuit Board). The two can transmit data to each other. The connection between the SoC and the Bluetooth module can rely on standard hardware connection protocols, such as I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface). Through these protocols, hardware specifications and level requirements can be monitored.

[0051] Figure 2 This is a schematic diagram of a key generation method according to an embodiment of the present disclosure. The method is applied to a Bluetooth device, and specifically, the method includes the following steps S210 to S230:

[0052] Step S210: Send a handshake request to the master control device; wherein, the handshake request includes the first public key in the first key pair held by the Bluetooth device; the first public key is used by the master control device to encrypt the first public key and the second public key in the second key pair held by the master control device based on the first encryption algorithm to obtain the first data.

[0053] After the Bluetooth device and the master control device are manufactured, they need to be paired to enable communication and data transfer between them. In this embodiment, the Bluetooth device sends a handshake request to the master control device, thereby requesting pairing. The handshake request includes the first public key from the first key pair held by the Bluetooth device, which prepares for the Bluetooth device and the master control device to generate the same target key subsequently.

[0054] In this embodiment of the disclosure, the handshake request sent by the Bluetooth device includes the first public key in the first key pair, and the master control device can encrypt the first public key and the second public key in the second key pair based on the first encryption algorithm.

[0055] Optionally, when manufacturing the main control device and the Bluetooth device in the factory, an encryption program and a decryption program of the first encryption algorithm can be written into the main control device and the Bluetooth device respectively. The first encryption algorithm of the main control device and the Bluetooth device is the same. If it is necessary to use a key-based encryption and decryption, the encryption key of the main control device and the decryption key of the Bluetooth device are the same or matched. Thus, during the handshake process between the main control device and the Bluetooth device, the Bluetooth device can decrypt the first data encrypted by the matched main control device.

[0056] Optionally, the first encryption algorithm needs to be based on a key for encryption and decryption. Optionally, the key for the first encryption algorithm may be written into the main control device and the Bluetooth device respectively during the production stage.

[0057] In practical applications, when a factory is producing a main control device, the key of the first encryption algorithm can be encrypted and then written into the main control device or written directly into the main control device; when a factory is producing a Bluetooth device, the key of the first encryption algorithm can be encrypted and then written into the Bluetooth device or written directly into the Bluetooth device.

[0058] In one implementation, when the factory is producing the main control device, the key used to implement the first encryption algorithm can be encrypted and the ciphertext can be written into the main control device. When the main control device uses the first encryption algorithm, the key used to implement the first encryption algorithm can be obtained by decrypting the ciphertext, thereby ensuring the security of the first encryption algorithm and preventing a third party from impersonating the main control device to conduct a handshake process due to the leakage of the key used to implement the first encryption algorithm.

[0059] To encrypt the key used to implement the first encryption algorithm, the complexity of the key can be increased. For example, a True Random Number Generator (TRNG) or Key Derivation Function (KDF) can be used to generate the key. Alternatively, the key can be securely stored, for example, using tools such as a Hardware Security Module (HSM) or an electronic fuse. Or, the key can be encrypted using a preset encryption algorithm. For example, the private key of an encryption algorithm such as AES (Advanced Encryption Standard) or ECC (Elliptic Curve Cryptography) can be used to encrypt the key, and when the main control device uses the first encryption algorithm, it decrypts it using the public key of the AES or ECC encryption algorithm to obtain the key used to implement the first encryption algorithm.

[0060] For example, during the production phase, the key used to implement the first encryption algorithm can be encrypted, and the encrypted ciphertext can be written into the efuse (electronic fuse) in the main control device. During use, the main control device decrypts the ciphertext in the efuse to obtain the key used to implement the first encryption algorithm (e.g., a private key used for encryption calculations based on the first encryption algorithm), thereby ensuring the security of the first encryption algorithm and further improving the security of the first data.

[0061] Optionally, upon its first power-on (or power-on), the Bluetooth device initiates and generates a first key pair, which may include a first public key and a first private key for pairing. Similarly, upon its first power-on, the master control device initiates and generates a second key pair, which may include a second public key and a second private key for pairing. The first and second key pairs may be generated independently by the Bluetooth device and the master control device based on preset algorithms.

[0062] In this embodiment of the disclosure, when the master control device receives a handshake request sent by the Bluetooth device, the master control device can encrypt the first public key in the handshake request and the second public key in the second key pair held by the master control device based on the first encryption algorithm to obtain first data. The first data can be understood as a data packet, which includes the encrypted first public key and second public key. The master control device then sends the first data to the Bluetooth device.

[0063] Step S220: In response to receiving the first data from the master control device, the first data is decrypted based on the first encryption algorithm to obtain the second public key.

[0064] In this embodiment of the disclosure, the Bluetooth device may locally store a first encryption algorithm or store a key for decryption based on the first encryption algorithm. After the Bluetooth device receives the first data replied by the master control device, it uses the first encryption algorithm to decrypt the received first data, so that the Bluetooth device can obtain the second public key held by the master control device from the decrypted first data.

[0065] In one implementation, when a factory manufactures a Bluetooth device, it can encrypt the key used to implement the first encryption algorithm (e.g., a public key used for decryption based on the first encryption algorithm) and write the ciphertext into the Bluetooth device. When the Bluetooth device uses the first encryption algorithm (e.g., for decryption based on the first encryption algorithm), it can obtain the key used to implement the first encryption algorithm by decrypting the ciphertext, thereby ensuring the security of the first encryption algorithm and preventing third parties from decrypting the data exchanged in the handshake process and cracking the target key due to the leakage of the key used to implement the first encryption algorithm.

[0066] In one implementation, when manufacturing Bluetooth devices, the key used to implement the first encryption algorithm can be directly written into the Bluetooth device, for example, written in plaintext. Since the first encryption algorithm in the Bluetooth device is used to decrypt the first data, its security requirements are lower compared to the first encryption algorithm in the main control device. Therefore, by directly writing the key to implement the first encryption algorithm into the Bluetooth device during manufacturing, the latency in the handshake process and the computing power requirements of the Bluetooth device can be reduced, avoiding a decrease in processing power and a slower response speed due to resource constraints in the Bluetooth device. For example, when manufacturing Bluetooth devices, the key stored in the cloud (i.e., the key used to implement the first encryption algorithm) can be directly written into efuse or the firmware. During use, the Bluetooth device can read the data in efuse or the firmware to obtain the key used to implement the first encryption algorithm (e.g., the public key used for decryption), thereby enabling the Bluetooth device to decrypt the first data.

[0067] Optionally, if the first encryption algorithm cannot decrypt the first data, or if the decryption fails, it indicates that the Bluetooth device and the main control device are incompatible. The communication function of the Bluetooth device is then turned off, thereby completing the protection of the board-level module communication. This prevents the main control device or the Bluetooth device from being impersonated through hardware replacement or man-in-the-middle attacks, thus deceiving the main control device or the Bluetooth device into working normally.

[0068] Step S230: Obtain the target key based on the first private key and the second public key in the first key pair; wherein, the target key is the same as the key determined by the master control device based on the first public key and the second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0069] In this embodiment of the disclosure, the Bluetooth device can obtain the target key based on the first private key and the second public key in the first key pair. At the same time, the master control device can obtain the same target key as the Bluetooth device based on the first public key and the second private key in the second key pair. Subsequently, the master control device and the Bluetooth device can use the same target key for encrypted communication.

[0070] Optionally, during the subsequent data transmission phase between the master control device and the Bluetooth device, the target key can be used to encrypt the data sent by the master control device and / or the Bluetooth device to the other party, or to decrypt the data received by the master control device and / or the Bluetooth device from the other party.

[0071] Optionally, the target key may include a key for encrypting the data to be sent and a key for decrypting the data to be received. The two keys in the target key match, and the communication between the master control device and the Bluetooth device can use the same target key for encryption and decryption.

[0072] Optionally, the master control device or Bluetooth device can encrypt and send the data to be sent to the other party based on the target key. When the master control device or Bluetooth device cannot decrypt the received data using the target key, the communication function of the master control device or Bluetooth device can be turned off, thereby completing the protection of board-level module communication. It is impossible to impersonate the master control device or Bluetooth device through hardware replacement or man-in-the-middle attacks to deceive the master control device or Bluetooth device into working normally.

[0073] The method provided in this disclosure involves a master control device encrypting and transmitting a first public key from a received first key pair and a second public key from a second key pair held by itself using a first encryption algorithm. A Bluetooth device then decrypts the data using the first encryption algorithm to obtain the second public key. Thus, the master control device obtains the same target key based on the first public key and the second private key, and the Bluetooth device obtains the same target key based on the first private key matching the first public key and the second public key matching the second private key. Hybrid encryption is achieved through key negotiation between the two key pairs and encrypted communication of the public key using the first encryption algorithm. This generates a high-security target key during connection establishment, reduces the overhead of additional encryption and decryption resources, and decreases latency. Furthermore, the high-security target key can protect board-level module communication, improving the security of data transmission between the Bluetooth device and the master control device. By enhancing the security of the target key, the complexity requirements of the encryption algorithm are correspondingly reduced, thereby reducing the consumption of computing resources and memory, and avoiding problems such as decreased processing power, slower response speed, and shortened device battery life.

[0074] In some embodiments, the handshake request further includes identification information of the Bluetooth device; wherein the identification information of the Bluetooth device is used by the master device to decrypt the data in the electronic fuse in the master device to obtain a key for implementing the first encryption algorithm.

[0075] Optionally, the identification information of the Bluetooth device may include ID (Identifier), version information, etc.

[0076] In this embodiment of the disclosure, when the factory is producing the main control device, it can generate ciphertext and write it to efuse based on the identification information of the Bluetooth device paired with the main control device and the private key stored in the cloud. When the main control device receives a handshake request, it can decrypt the data in efuse based on the identification information of the Bluetooth device in the handshake request to obtain the key used to implement the first encryption algorithm. If the decryption key cannot decrypt the data in efuse, it can be indicated that the main control device and the Bluetooth device are not paired, and the communication function is turned off.

[0077] Optionally, when the factory produces the main control device, it can also generate a unique key and write it into efuse based on the identification information of the Bluetooth device paired with the main control device, the identification information of the main control device, and the private key stored in the cloud. When the main control device receives a handshake request, it can generate a decryption key based on the identification information of the Bluetooth device and the identification information of the main control device in the handshake request, decrypt the data in efuse, and obtain the key used to implement the first encryption algorithm.

[0078] Optionally, when the factory produces the main control device, it can also encrypt the private key stored in the cloud according to the identification information of various Bluetooth devices to generate multiple keys for implementing the first encryption algorithm. When the main control device receives a handshake request, it can decrypt the stored data according to the identification information of the Bluetooth device in the handshake request. Among the multiple keys for implementing the first encryption algorithm, the key that can be successfully decrypted is the key corresponding to the current Bluetooth device for implementing the first encryption algorithm. Thus, the main control device can use the key corresponding to the Bluetooth device to encrypt the first data according to the identification information of the Bluetooth device, further improving the security of the key used to implement the first encryption algorithm in the main control device.

[0079] Optionally, the master control device can also verify the legitimacy and security of the Bluetooth device using its identification information. For example, during the production of the master control device, the IDs of Bluetooth devices paired with the master control device can be stored. When the master control device receives a handshake request, it can verify the ID of the Bluetooth device in the handshake request based on the stored ID, or verify whether the Bluetooth device is paired with the master control device based on version information. If the verification is successful, the master control device can encrypt the first public key and the second public key in the second key pair held by the master control device using the first encryption algorithm to obtain the first data. Conversely, if the verification fails, the communication function is disabled.

[0080] According to the above embodiments, the main control device can obtain the key for implementing the first encryption algorithm through the identification information of the Bluetooth device, and in this process, it can determine whether the main control device and the Bluetooth device are matched, thereby improving the security of the first encryption algorithm.

[0081] In some embodiments, step S230, obtaining the target key based on the first private key and the second public key in the first key pair, includes:

[0082] If the first public key obtained by decrypting the first data based on the first encryption algorithm is the same as the first public key in the first key pair, the target key is obtained based on the first private key and the second public key in the first key pair.

[0083] In this embodiment of the disclosure, the Bluetooth device can decrypt the first data based on the first encryption algorithm to obtain the decrypted first public key and second public key. If the decrypted first public key is the same as the first public key in the first key pair held by the Bluetooth device, it can be determined that the decrypted second public key is the second public key held by the master control device. Thus, the Bluetooth device or the master control device has not been replaced or attacked, the Bluetooth device and the master control device are matched, and a handshake can be successfully performed. The Bluetooth device obtains the target key based on the first private key and the second public key in the first key pair.

[0084] According to the above embodiments, the consistency between the decrypted first public key and the first public key held by the user is verified by a Bluetooth device. The enhanced authentication mechanism improves the security and efficiency of the handshake process, ensures the integrity of the first data, and enhances the reliability of data link communication.

[0085] In some embodiments, the key generation method may further include:

[0086] If the first public key obtained by decrypting the first data based on the first encryption algorithm is different from the first public key in the first key pair, the communication function is turned off.

[0087] In this embodiment of the disclosure, if the decrypted first public key is different from the first public key in the first key pair held by the Bluetooth device, it means that the decrypted second public key is also different from the second public key held by the matching master control device. The Bluetooth device and the master control device are not matched, so the Bluetooth device or the master control device has been replaced or attacked. The Bluetooth device and the master control device cannot handshake. Disabling the communication function of the Bluetooth device can complete the protection of the Bluetooth device and the master control device.

[0088] According to the above embodiments, by disabling the communication function when the decrypted first public key is different from the first public key in the first key pair held by the Bluetooth device, the protection of board-level module communication is achieved. It is impossible to impersonate the master control device or Bluetooth device through hardware replacement or man-in-the-middle attacks to deceive the master control device or Bluetooth device into working normally.

[0089] In practical applications, the main control device and Bluetooth device are deployed in the vehicle's infotainment system. The above embodiments can disable the communication function between the main control device and Bluetooth device in the vehicle's infotainment system, preventing the main control device and / or Bluetooth device from being replaced by third-party chips, directly inputting control information to forge control commands to control the vehicle, thus ensuring the safety of vehicle driving.

[0090] In some embodiments, the first encryption algorithm includes a first asymmetric encryption algorithm. Accordingly, step S220, decrypting the first data based on the first encryption algorithm to obtain the second public key, includes:

[0091] The first data is decrypted using the third public key of the first asymmetric encryption algorithm to obtain the second public key; the third public key of the first asymmetric encryption algorithm is matched with the third private key held by the master control device of the Bluetooth device, which is used to encrypt the first public key and the second public key.

[0092] In this embodiment of the disclosure, when the matching master control device and Bluetooth device are manufactured in the factory, a third private key of the first asymmetric encryption algorithm can be written into the master control device, and a third public key of the first asymmetric encryption algorithm can be written into the Bluetooth device. The third private key and the third public key are matched, so that during the handshake process between the master control device and the Bluetooth device, the Bluetooth device can decrypt the data encrypted by the matching master control device.

[0093] After receiving the handshake request, the master control device can encrypt the first public key in the handshake request and the second public key in the second key pair held by the master control device based on the third private key of the first asymmetric encryption algorithm to obtain the first data, and then send the first data to the Bluetooth device.

[0094] Accordingly, when the Bluetooth device receives the first data from the master device, it can decrypt it using the third public key held by the Bluetooth device. This third public key matches the third private key held by the master device. If the third public key can be used for decryption, it indicates that the Bluetooth device and the master device are compatible, allowing them to generate the same target key subsequently. If the third public key cannot be used for decryption, it indicates that the Bluetooth device and the master device are incompatible, and disabling the Bluetooth device's communication function can protect both the Bluetooth device and the master device.

[0095] Optionally, when the factory manufactures the main control device, a unique third private key can be generated and written to efuse based on the main control device's unique information (such as its ID) and the private key stored in the cloud device. During the use of the main control device, a decryption key is generated based on the main control device's unique information to decrypt the data in efuse and obtain the third private key, thereby ensuring the security of the primary data during transmission.

[0096] Optionally, since the third public key in the Bluetooth device is used to decrypt the first data, its security requirements are lower than those of the third private key in the main control device. Therefore, the third public key can be directly written into the Bluetooth device during factory manufacturing, thereby reducing latency and the computational power requirements of the Bluetooth device. This avoids reduced processing power and slower response speeds due to resource constraints in the Bluetooth device. For example, the third public key can be directly written into efuse or firmware during factory manufacturing. During use, the Bluetooth device can read the data in efuse or firmware to obtain the third public key.

[0097] Optionally, the first asymmetric encryption algorithm can be any asymmetric encryption algorithm from related technologies. For example, the first encryption algorithm can be RSA, ECC, SM2, SM9, etc.

[0098] According to the above embodiments, the security of the first data transmission during the handshake process can be enhanced, and the protection of board-level module communication is completed. It is impossible to impersonate the master control device or Bluetooth device through hardware replacement or man-in-the-middle attacks to deceive the master control device or Bluetooth device into working normally.

[0099] In some embodiments, the generation of the first key pair includes: determining a first random number; determining a first private key in the first key pair based on the first random number; and determining a first public key in the first key pair based on the base point information jointly held by the Bluetooth device and the master control device, and the first random number.

[0100] Optionally, the generation method of the second key pair in the master control device can be similar to the generation method of the first key pair, including: determining a second random number; determining a second private key in the second key pair based on the second random number; and determining a second public key in the second key pair based on the base point information jointly held by the Bluetooth device and the master control device, and the second random number.

[0101] Since the first private key held by the Bluetooth device is determined based on a first random number, and the second public key held by the master device is determined based on a second random number and base point information, the target key obtained based on the first private key and the second public key is related to the first random number, the second random number, and the base point information. Similarly, the target key obtained based on the first public key and the second private key is also related to the first random number, the second random number, and the base point information. In this way, unpredictable random numbers can be used to make the Bluetooth device and the master device generate the same target key, thereby improving the availability and security of the target key.

[0102] In some embodiments, the generation of the first and second random numbers is subject to time constraints. For example, at regular intervals, the formats of the first and second random numbers are changed, such as their lengths or data types. The Bluetooth device can verify the usability of the second public key based on its received format. Thus, even if a third party uses a cracked algorithm and key to impersonate the controlling device during the handshake process, the delay in the cracking process will prevent the generation of a verifiable second public key. Therefore, the security of the handshake process can be further improved, thereby enhancing the availability and security of the target key.

[0103] In some embodiments, the aforementioned base point information is dynamically changing, for example, dynamically changing to points on different curves, or different points on the same curve, thus increasing the difficulty of cracking the base point information.

[0104] In some embodiments, the aforementioned base point information may be information about points on an elliptic curve. While calculating a public key based on points on an elliptic curve and a random number is simple, reversing the calculation from that public key to derive points on the elliptic curve is very difficult. Therefore, this approach can further enhance the security of the handshake process, thereby improving the availability and security of the target key. In some embodiments, the first key pair and the second key pair may be generated based on the ECDH (Elliptic Curve Diffie-Hellman) algorithm. Accordingly, the Bluetooth device and the master device can each generate the target key based on the ECDH algorithm.

[0105] In some embodiments, the key generation method may further include:

[0106] The second data to be transmitted is encrypted based on the target key and the third encryption algorithm, and the encrypted second data is sent to the main control device.

[0107] In response to receiving third data from the master control device, the third data is decrypted based on the target key and the fourth encryption algorithm.

[0108] In this embodiment of the disclosure, after the Bluetooth device successfully completes the first handshake and generates the target key, it can directly use the target key to encrypt the second data to be transmitted and to decrypt the third data received from the master control device.

[0109] Accordingly, the master control device can receive the second data from the Bluetooth device, decrypt the second data based on the target key, encrypt the third data to be transmitted based on the target key, and send the encrypted third data to the Bluetooth device.

[0110] Optionally, the target key may include a key for encrypting and transmitting the second data, and a key for decrypting the third data. The two keys in the target key match, and the communication between the master control device and the Bluetooth device can be encrypted and decrypted using the same target key.

[0111] Optionally, any encryption algorithm from the relevant technologies can be used as the third and / or fourth encryption algorithm mentioned above. For example, the third encryption algorithm may include RSA, AES, ECC, or ChaCha20, and the fourth encryption algorithm may also include RSA, AES, ECC, or ChaCha20.

[0112] Optionally, the third and fourth encryption algorithms can be the same or different algorithms. For example, both the third and fourth encryption algorithms can be AES encryption, allowing both the Bluetooth device and the main control device to further encrypt the second and third data before transmission. Alternatively, the third encryption algorithm can be AES, and the fourth encryption algorithm can be ECC.

[0113] In some embodiments, the third and fourth encryption algorithms can be determined based on the data bandwidth. For example, when the bandwidth of data interaction between the Bluetooth device and the master device is low, a preset first set of encryption algorithms and a target key can be used to encrypt or decrypt the second and third data to be transmitted. The first set of encryption algorithms can be a relatively complex encryption algorithm. When the bandwidth of data interaction between the Bluetooth device and the master device is high, a preset second set of encryption algorithms and a target key can be used to encrypt or decrypt the second and third data to be transmitted. The second set of encryption algorithms can be a low-complexity encryption algorithm. Since a high-complexity encryption algorithm would consume excessive resources during encryption or decryption, impacting the performance of both the Bluetooth device and the master device and causing a bottleneck in transmission speed, using a low-complexity encryption algorithm and target key to encrypt the second and third data reduces the overhead of encryption or decryption, achieving greater transmission bandwidth and improving data transmission efficiency. In other words, by selecting two sets of encryption algorithms, a balance can be struck between data transmission efficiency and security improvements, thereby enhancing the performance of the electronic device. Each group of encryption algorithms may include one encryption algorithm (i.e., the third encryption algorithm and the fourth encryption algorithm are the same), or it may include different encryption algorithms (e.g., including a third encryption algorithm and a fourth encryption algorithm).

[0114] In some embodiments, due to different security requirements for the second and third data, the Bluetooth device and the master control device can employ different encryption algorithms to further encrypt the second and third data before transmission. For example, when the master control device and Bluetooth device are deployed in an in-vehicle system, the master control device needs to send vehicle control data, configuration data, and other data (i.e., the third data) to the Bluetooth device, while the Bluetooth device needs to send current vehicle data (e.g., periodically sent vehicle log data) to the master control device. Therefore, the security requirements for the third data are higher than those for the second data. The master control device can use a more secure encryption algorithm (e.g., AES) and a target key to encrypt the third data before sending the encrypted third data to the Bluetooth device, thereby further improving the security of the third data sent by the master control device. Correspondingly, the Bluetooth device can employ a computationally efficient encryption algorithm (e.g., ECC, ChaCha20, etc.), thereby reducing latency and computational power requirements for the Bluetooth device, and improving data encryption and decryption efficiency.

[0115] According to the above embodiments, by using symmetrically encrypted communication between the master control device and the Bluetooth device, the security and efficiency of data transmission between the Bluetooth device and the master control device can be improved, while reducing latency and computing power requirements, and avoiding the decrease in processing power and slow response speed due to the limited resources of the Bluetooth device.

[0116] To better understand the technical solutions of the embodiments of this disclosure, a specific application example is provided below. In this application example, the key generation method includes a key security storage process at the factory stage, a handshake process between the Bluetooth device and the main control chip, and a conventional data communication process.

[0117] During the key security storage process at the factory, the main control unit securely stores the RSA private key to ensure its security. Specifically, during factory production, a unique key is generated and written to efuse based on device-specific information (such as the chip ID) and the private key stored in the cloud. During use, the chip generates a decryption key based on the device-specific information to decrypt the data in efuse and obtain the original private key. This original private key is the private key for the RSA algorithm (i.e., the third private key for the first encryption algorithm mentioned above).

[0118] In the handshake process between the Bluetooth device and the host device, the initial handshake between the Bluetooth module and the host device generates a corresponding untransmitted AES key (i.e., the target key). This handshake verification can be performed using RSA encryption, offering high security. Furthermore, the AES key is dynamically generated each time, reducing security risks. The handshake data flow during the power-on phase may include the following steps:

[0119] Step 1: Upon power-up, the Bluetooth device starts up and generates its ECDH key pair A (i.e., the first key pair), including a private key and a public key (i.e., the first public key and the first private key). The Bluetooth device prepares the A public key (i.e., the first public key) as part of the handshake request. The master device starts up and generates its ECDH key pair B (i.e., the second key pair), including a private key and a public key (i.e., the second public key and the second private key).

[0120] Step 2: The Bluetooth device sends a handshake request to the host device, which includes its generated A public key. At this point, the handshake request may contain other necessary information, such as the Bluetooth device's identity or version number.

[0121] Step 3: After receiving the handshake request, the master control device encrypts the received A public key and its own generated B public key (i.e., the second public key) using the locally stored RSA private key (i.e., the third private key of the first encryption algorithm).

[0122] Step 4: The master device sends the encrypted data back to the Bluetooth device. At this point, the data packet contains the RSA-encrypted public key A and public key B.

[0123] Step 5: After receiving the reply message from the master device, the Bluetooth device uses the locally stored RSA public key (i.e., the third public key of the first encryption algorithm) to decrypt the received data. After decryption, the Bluetooth device obtains the responding A public key and the master device's B public key.

[0124] Step Six: The Bluetooth device verifies whether the decrypted public key A matches expectations. Verification is done by comparing the locally stored public key A with the data decrypted from the received message. If verification is successful, the Bluetooth device considers authentication successful; otherwise, the Bluetooth device will disable communication and terminate the handshake process.

[0125] Step 7: Both devices (Bluetooth device and master device) use their respective private keys and the other's public key to perform key negotiation. Specifically, the Bluetooth device uses its private key A and the master device's public key B to calculate the shared session key C (i.e., the target key), and the master device also uses its private key B and the Bluetooth device's public key A to calculate the same non-transmission session key C (i.e., the target key).

[0126] Step 8: At this point, both devices possess the same AES shared session key C. This key is used for subsequent encrypted communication to ensure data security during transmission. The handshake process is now complete, and all subsequent communication between the two parties will use the shared session key C for encrypted communication.

[0127] In a standard data communication process, AES shared session key C is used for encryption and decryption, resulting in high transmission efficiency and low hardware resource load. A standard communication process may specifically include the following steps:

[0128] Step 1: Bluetooth / master device communication messages are encrypted using the shared session key C and sent to the other end.

[0129] Step 2: The communication messages received by the master / Bluetooth device are decrypted using the shared session key C to complete normal data parsing.

[0130] In some embodiments, Figure 3 This is a schematic diagram illustrating an application example of the key generation method according to an embodiment of this disclosure. For example... Figure 3 As shown, the key generation method may include the following steps S301 to S310:

[0131] Step S301: When the Bluetooth device is powered on, a first key pair is generated; wherein, the first key pair includes a first public key and a first private key;

[0132] Simultaneously, in step S302, when the main control device is powered on, a second key pair is generated; wherein, the second key pair includes a second public key and a second private key;

[0133] Step S303: The Bluetooth device sends the first public key of the first key pair to the master control device;

[0134] Step S304: The main control device uses the third private key to encrypt the first public key and the second public key;

[0135] Step S305: The main control device sends first data to the Bluetooth device; wherein, the first data includes an encrypted first public key and a second public key;

[0136] Step S306: The Bluetooth device uses the third public key to decrypt the first data and verifies the first public key; wherein, the specific verification method includes: if the first public key obtained by decryption is different from the first public key in the first key pair, the verification is considered to have failed; if the first public key obtained by decryption is the same as the first public key in the first key pair, the verification is considered to have succeeded.

[0137] If verification fails, proceed to step S307: the Bluetooth device is turned off, and external communication is stopped.

[0138] If the verification is successful, proceed to step S308: the Bluetooth device generates the target key using the first private key and the second public key;

[0139] Step S309: The master control device generates a target key using the first public key and the second private key; wherein the target key generated by the Bluetooth device and the master control device is the same.

[0140] Step S310: Both parties use the target key to achieve AES encrypted communication.

[0141] As can be seen, the key generation method provided in this embodiment involves the master control device encrypting and transmitting the first public key in the received first key pair and the second public key in the second key pair held by itself based on the first encryption algorithm, and the Bluetooth device decrypting based on the first encryption algorithm and verifying the consistency between the decrypted first public key and the first public key held by itself. Thus, the master control device can obtain the same target key based on the first public key and the second private key, and the Bluetooth device can obtain the same target key based on the first private key that matches the first public key and the second public key that matches the second private key. The enhanced authentication mechanism improves security and efficiency during the handshake process, ensuring the integrity of the initial data, enhancing the reliability of data link communication, and protecting board-level module communication. It prevents the host device or Bluetooth device from being impersonated through hardware replacement or man-in-the-middle attacks to deceive the host device or Bluetooth device into functioning normally. Simultaneously, based on key negotiation between two key pairs and the encryption of the public key using the first encryption algorithm, hybrid encryption is achieved. This generates a high-security target key and reduces the overhead of additional encryption and decryption resources. Therefore, the high-security target key enhances the security of data transmission between the Bluetooth device and the host device. The communication process eliminates the need for complex authentication procedures and protocol design, thereby reducing latency and computing power requirements and preventing reduced processing power and slower response speeds due to resource constraints on the Bluetooth device.

[0142] Figure 4 This is a schematic diagram of a key generation method according to another embodiment of the present disclosure. The method is applied to a master control device, and specifically, the method includes the following steps S410 to S440:

[0143] Step S410: Receive a handshake request from a Bluetooth device; wherein the handshake request includes the first public key in the first key pair held by the Bluetooth device.

[0144] Step S420: Encrypt the first public key and the second public key in the second key pair held by the master control device based on the first encryption algorithm to obtain the first data;

[0145] Step S430: Send the first data to the Bluetooth device;

[0146] Step S440: Obtain the target key based on the second private key in the first public key and the second key pair; wherein, the target key is the same as the key determined by the Bluetooth device based on the first private key and the second public key in the first key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0147] In some embodiments, the key generation method may further include:

[0148] Based on the second encryption algorithm, the data in the electronic fuse in the main control device is decrypted to obtain the key used to implement the first encryption algorithm; wherein, the data in the electronic fuse is written into the electronic fuse during the production of the main control device.

[0149] In some embodiments, based on a second encryption algorithm, data in the electronic fuse of the main control device is decrypted to obtain a key for implementing the first encryption algorithm, including:

[0150] Based on the identification information of the main control device and / or the identification information of the Bluetooth device, the key for the second encryption algorithm is determined;

[0151] Based on the key of the second encryption algorithm and the second encryption algorithm, the data in the electronic fuse is decrypted to obtain the key used to implement the first encryption algorithm.

[0152] In some embodiments, the first encryption algorithm includes a first asymmetric encryption algorithm. Accordingly, step S420, encrypting the first public key and the second public key in the second key pair held by the master device based on the first encryption algorithm to obtain first data, includes:

[0153] The third private key based on the first asymmetric encryption algorithm is used to encrypt the first public key and the second public key in the second key pair held by the master device to obtain the first data; the third private key of the first asymmetric encryption algorithm is matched with the third public key held by the Bluetooth device matched with the master device for decrypting the first public key and the second public key.

[0154] In some embodiments, the second key pair is generated in the following ways:

[0155] Determine the second random number;

[0156] The second private key in the second key pair is determined based on the second random number.

[0157] Based on the base point information shared by the Bluetooth device and the master control device, and the second random number, the second public key in the second key pair is determined.

[0158] In some embodiments, the key generation method may further include:

[0159] In response to receiving second data from a Bluetooth device, the second data is decrypted based on the target key and a third encryption algorithm; and / or,

[0160] The third data to be transmitted is encrypted based on the target key and the fourth encryption algorithm, and then the encrypted third data is sent to the Bluetooth device.

[0161] Specific examples of the key generation method applied to the master control device according to the embodiments of this disclosure can be found in the relevant descriptions of the master control device in the foregoing embodiments, and have corresponding beneficial effects. For the sake of brevity, they will not be repeated here.

[0162] Figure 5 This is a schematic block diagram of a Bluetooth device according to embodiments of the present disclosure. Figure 5 As shown, a Bluetooth device may include:

[0163] The handshake request module 510 is used to send a handshake request to the master control device; wherein, the handshake request includes a first public key in a first key pair held by the Bluetooth device; the first public key is used by the master control device to encrypt the first public key and the second public key in a second key pair held by the master control device based on a first encryption algorithm to obtain first data;

[0164] The decryption module 520 is used to decrypt the first data based on the first encryption algorithm in response to receiving the first data from the main control device, and obtain the second public key.

[0165] The first key determination module 530 is used to obtain a target key based on the first private key and the second public key in the first key pair; wherein the target key is the same as the key determined by the master control device based on the first public key and the second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0166] In some embodiments, the first key determination module 530 is further configured to: obtain a target key based on the first private key and the second public key in the first key pair if the first public key obtained by decrypting the first data based on the first encryption algorithm is the same as the first public key in the first key pair.

[0167] In some embodiments, such as Figure 6 As shown, the Bluetooth device may further include a communication shutdown module 610, which is used to shut down the communication function when the first public key obtained by decrypting the first data based on the first encryption algorithm is different from the first public key in the first key pair.

[0168] In some embodiments, the handshake request further includes identification information of the Bluetooth device; wherein the identification information of the Bluetooth device is used by the master device to decrypt the data in the electronic fuse in the master device to obtain a key for implementing the first encryption algorithm.

[0169] In some embodiments, the first encryption algorithm includes a first asymmetric encryption algorithm; the decryption module 520 is further configured to: decrypt the first data based on the third public key of the first asymmetric encryption algorithm to obtain a second public key; and match the third public key of the first asymmetric encryption algorithm with the third private key held by the master control device matched with the Bluetooth device for encrypting the first public key and the second public key.

[0170] In some embodiments, the first key pair is generated in the following ways:

[0171] Determine the first random number;

[0172] The first private key in the first key pair is determined based on the first random number;

[0173] Based on the base point information shared by the Bluetooth device and the master control device, and the first random number, the first public key in the first key pair is determined.

[0174] In some embodiments, such as Figure 6 As shown, the Bluetooth device may further include a first communication module 620, which is used for:

[0175] Encrypt the second data to be transmitted based on the target key and the third encryption algorithm, and send the encrypted second data to the main control device; and / or,

[0176] In response to receiving third data from the master control device, the third data is decrypted based on the target key and the fourth encryption algorithm.

[0177] Figure 7 This is a schematic block diagram of a main control device according to an embodiment of the present disclosure. Figure 7 As shown, the main control device may include:

[0178] The request receiving module 710 is configured to receive a handshake request from a Bluetooth device; wherein the handshake request includes a first public key in a first key pair held by the Bluetooth device.

[0179] The encryption module 720 is used to encrypt the first public key and the second public key in the second key pair held by the master control device based on the first encryption algorithm to obtain the first data;

[0180] Data transmission module 730 is used to send first data to a Bluetooth device;

[0181] The second key determination module 740 is used to obtain a target key based on the second private key in the first public key and the second key pair; wherein the target key is the same as the key determined by the Bluetooth device based on the first private key and the second public key in the first key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device.

[0182] In some embodiments, such as Figure 8 As shown, the main control device may further include a key decryption module 810, which is used for:

[0183] Based on the second encryption algorithm, the data in the electronic fuse in the main control device is decrypted to obtain the key used to implement the first encryption algorithm; wherein, the data in the electronic fuse is written into the electronic fuse during the production of the main control device.

[0184] In some embodiments, the key decryption module 810 is further configured to:

[0185] Based on the identification information of the main control device and / or the identification information of the Bluetooth device, the key for the second encryption algorithm is determined;

[0186] Based on the key of the second encryption algorithm and the second encryption algorithm, the data in the electronic fuse is decrypted to obtain the key used to implement the first encryption algorithm.

[0187] In some embodiments, the first encryption algorithm includes a first asymmetric encryption algorithm; the encryption module 720 is further configured to:

[0188] The third private key based on the first asymmetric encryption algorithm is used to encrypt the first public key and the second public key in the second key pair held by the master device to obtain the first data; the third private key of the first asymmetric encryption algorithm is matched with the third public key held by the Bluetooth device matched with the master device for decrypting the first public key and the second public key.

[0189] In some embodiments, the second key pair is generated in the following ways:

[0190] Determine the second random number;

[0191] The second private key in the second key pair is determined based on the second random number.

[0192] Based on the base point information shared by the Bluetooth device and the master control device, and the second random number, the second public key in the second key pair is determined.

[0193] In some embodiments, such as Figure 8 As shown, the main control device may further include a second communication module 820, which is used for:

[0194] In response to receiving second data from a Bluetooth device, the second data is decrypted based on the target key and a third encryption algorithm; and / or,

[0195] The third data to be transmitted is encrypted based on the target key and the fourth encryption algorithm, and then the encrypted third data is sent to the Bluetooth device.

[0196] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0197] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0198] Figure 9 This is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Figure 9 As shown, the electronic device includes a memory 910 and a processor 920. The memory 910 stores a computer program that can run on the processor 920. The number of memories 910 and processors 920 can be one or more. The memory 910 can store one or more computer programs, which, when executed by the electronic device, cause the electronic device to perform the methods provided in the above-described method embodiments. The electronic device may also include a communication interface 930 for communicating with external devices and performing data exchange and transmission.

[0199] If the memory 910, processor 920, and communication interface 930 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0200] Optionally, in a specific implementation, if the memory 910, processor 920, and communication interface 930 are integrated on a single device, the memory 910, processor 920, and communication interface 930 can communicate with each other through an internal interface.

[0201] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0202] Further, optionally, the aforementioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct RAMBUS RAM (DR RAM).

[0203] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, Bluetooth, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)). It is worth noting that the computer-readable storage media mentioned in this disclosure can be non-volatile storage media; in other words, it can be non-transient storage media.

[0204] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0205] In the description of the embodiments of this disclosure, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0206] In the description of the embodiments disclosed herein, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0207] In the description of embodiments of this disclosure, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more.

[0208] The above description is merely an exemplary embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. A method for generating a key, applied to a Bluetooth device, characterized in that, The method comprises: sending a handshake request to a master device; wherein the handshake request comprises a first public key in a first key pair held by the Bluetooth device; the first public key is used for the master device to encrypt the first public key and a second public key in a second key pair held by the master device based on a first encryption algorithm to obtain first data; in response to receiving the first data from the master device, decrypting the first data based on the first encryption algorithm to obtain the second public key; obtaining a target key according to a first private key in the first key pair and the second public key; wherein the target key is the same as a key determined by the master device based on the first public key and a second private key in the second key pair, and the target key is used for the Bluetooth device and the master device to perform encrypted communication; wherein the first encryption algorithm comprises a first asymmetric encryption algorithm; decrypting the first data based on the first encryption algorithm to obtain the second public key comprises: decrypting the first data based on a third public key of the first asymmetric encryption algorithm to obtain the second public key; wherein the third public key of the first asymmetric encryption algorithm matches a third private key held by the master device for encrypting the first public key and the second public key, and the third private key is obtained by the master device from device-specific information to generate a decryption key and decrypt data in an electronic fuse; if the third public key cannot be decrypted, it is determined that the Bluetooth device and the master device do not match, and the communication function of the Bluetooth device is closed.

2. The method of claim 1, wherein, obtaining a target key according to a first private key in the first key pair and the second public key comprises: in a case where the first public key obtained by decrypting the first data based on the first encryption algorithm is the same as the first public key in the first key pair, obtaining a target key according to the first private key in the first key pair and the second public key.

3. The method of claim 2, wherein, The method further comprises: in a case where the first public key obtained by decrypting the first data based on the first encryption algorithm is different from the first public key in the first key pair, closing the communication function.

4. The method according to any one of claims 1 to 3, characterized in that, The handshake request further comprises identification information of the Bluetooth device; wherein the identification information of the Bluetooth device is used by the master device to decrypt data in an electronic fuse in the master device to obtain a key for implementing the first encryption algorithm.

5. The method according to any one of claims 1-3, characterized in that, The generation method of the first key pair comprises: determining a first random number; determining a first private key in the first key pair based on the first random number; determining a first public key in the first key pair based on base point information commonly held by the Bluetooth device and the master device and the first random number.

6. The method according to any one of claims 1-3, characterized in that, The method further comprises: encrypting second data to be transmitted based on the target key and a third encryption algorithm, and sending the encrypted second data to the master device; in response to receiving third data from the master device, decrypting the third data based on the target key and a fourth encryption algorithm. 7.A key generation method applied to a master device, characterized in that, The method comprises: receiving a handshake request from a Bluetooth device; wherein the handshake request comprises a first public key in a first key pair held by the Bluetooth device; encrypting the first public key and a second public key in a second key pair held by the master device based on a first encryption algorithm, to obtain first data; sending the first data to the Bluetooth device; obtaining a target key according to the first public key and a second private key in the second key pair; wherein the target key is the same as a key determined by the Bluetooth device based on a first private key in the first key pair and the second public key, and the target key is used for encrypted communication between the Bluetooth device and the master device; wherein the first encryption algorithm comprises a first asymmetric encryption algorithm; the encrypting the first public key and the second public key held by the master device based on the first encryption algorithm, to obtain the first data, comprises: generating a decryption key according to information specific to the device, and decrypting data in the electronic fuse to obtain a third private key of the first asymmetric encryption algorithm; encrypting the first public key and the second public key held by the master device based on the third private key of the first asymmetric encryption algorithm, to obtain the first data; wherein the third private key of the first asymmetric encryption algorithm matches a third public key held by the Bluetooth device and used for decrypting the first public key and the second public key.

8. The method of claim 7, wherein, The method further comprises: decrypting data in an electronic fuse in the master device based on a second encryption algorithm, to obtain a key used for implementing the first encryption algorithm; wherein the data in the electronic fuse is written into the electronic fuse when the master device is produced.

9. The method of claim 8, wherein, The decrypting data in the electronic fuse in the master device based on the second encryption algorithm, to obtain a key used for implementing the first encryption algorithm, comprises: determining a key of the second encryption algorithm based on identification information of the master device and / or identification information of the Bluetooth device; decrypting the data in the electronic fuse based on the key of the second encryption algorithm and the second encryption algorithm, to obtain the key used for implementing the first encryption algorithm.

10. The method according to any one of claims 7-9, characterized in that, The generation manner of the second key pair comprises: determining a second random number; determining a second private key in the second key pair based on the second random number; determining a second public key in the second key pair based on base point information commonly held by the Bluetooth device and the master device, and the second random number.

11. The method according to any one of claims 7-9, characterized in that, The method further comprises: decrypting second data from the Bluetooth device based on the target key and a third encryption algorithm in response to receiving the second data; encrypting third data to be transmitted based on the target key and a fourth encryption algorithm, and sending the encrypted third data to the Bluetooth device.

12. A Bluetooth device, characterized in that comprises: A handshake request module is used to send a handshake request to the master control device; wherein, the handshake request includes a first public key in a first key pair held by the Bluetooth device; the first public key is used by the master control device to encrypt the first public key and a second public key in a second key pair held by the master control device based on a first encryption algorithm to obtain first data; The decryption module is used to decrypt the first data based on the first encryption algorithm in response to receiving the first data from the main control device, and obtain the second public key. The first key determination module is used to obtain a target key based on the first private key and the second public key in the first key pair; wherein, the target key is the same as the key determined by the master control device based on the first public key and the second private key in the second key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device; Wherein, the first encryption algorithm includes a first asymmetric encryption algorithm; the decryption module is further configured to: The first data is decrypted based on the third public key of the first asymmetric encryption algorithm to obtain the second public key; wherein, the third public key of the first asymmetric encryption algorithm is matched with the third private key held by the main control device for encrypting the first public key and the second public key, and the third private key is obtained by the main control device generating a decryption key based on device-specific information and decrypting the data in the electronic fuse. If the third public key cannot be decrypted, it is determined that the Bluetooth device and the master control device are incompatible, and the communication function of the Bluetooth device is turned off.

13. A master device, comprising: include: A request receiving module is configured to receive a handshake request from a Bluetooth device; wherein the handshake request includes a first public key in a first key pair held by the Bluetooth device; An encryption module is used to encrypt the first public key and the second public key in the second key pair held by the main control device based on a first encryption algorithm to obtain first data; The data transmission module is used to send the first data to the Bluetooth device; The second key determination module is used to obtain a target key based on the first public key and the second private key in the second key pair; wherein the target key is the same as the key determined by the Bluetooth device based on the first private key and the second public key in the first key pair, and the target key is used for encrypted communication between the Bluetooth device and the master control device; Wherein, the first encryption algorithm includes a first asymmetric encryption algorithm; the encryption module is further configured to: A decryption key is generated based on the device's unique information to decrypt the data in the electronic fuse and obtain the third private key of the first asymmetric encryption algorithm. The first public key and the second public key in the second key pair held by the master control device are encrypted using the third private key of the first asymmetric encryption algorithm to obtain the first data; the third private key of the first asymmetric encryption algorithm is matched with the third public key held by the Bluetooth device for decrypting the first public key and the second public key.

14. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.

15. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Key determination method and device, electronic equipment and computer readable storage medium

    CN117560150A

  • Communication method and system, electronic equipment and storage medium

    CN119652611A