Dynamic real-time encryption method and system for Bluetooth transmission

By introducing dynamic real-time encryption methods and time verification mechanisms in Bluetooth transmission, the problem of insufficient security in the face of replay attacks in the existing technology is solved, and high security and effectiveness of data transmission are achieved.

CN119653355AInactive Publication Date: 2025-03-18ZHENGZHOU JIACHEN ELECTRIC CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411930456.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-03-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing Bluetooth transmission technology is insecurity in the face of playback attacks, and cannot effectively prevent attackers from performing illegal operations by intercepting and replaying ciphertexts.

Method used

The dynamic real-time encryption method is adopted, and through the time synchronization mechanism and the time verification mechanism, we ensure that the data sent each time contains an encrypted time stamp, ensuring the uniqueness and dynamicity of the data, thereby preventing playback attacks.

Benefits of technology

It effectively prevents data intercept and replay attacks, improves the security and effectiveness of data transmission, simplifies key management, and reduces the difficulty of implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653355A_ABST
    Figure CN119653355A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data encryption, and discloses a dynamic real-time encryption method and system for Bluetooth transmission, and the method comprises the steps: a client and a device end establish Bluetooth connection, the client and the device end carry out time synchronization operation, when the client issues a control instruction, the client obtains current first system time, and the current first system time is sent to the device end; the method comprises the following steps: receiving a first system time, encrypting the first system time to obtain a first encryption timestamp, then adding the first encryption timestamp to a control instruction to generate first encrypted data, sending the first encrypted data to a device end through Bluetooth transmission, and after receiving the first encrypted data, decrypting the first encryption timestamp by the device end to obtain the first system time. And then judging whether the first system time meets a preset condition, if so, executing the control instruction, and if not, prompting that the data is invalid. According to the technical scheme of the invention, the security and effectiveness of data transmission can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of data encryption, and in particular relates to a dynamic real-time encryption method and system for Bluetooth transmission. Background Art

[0002] With the rapid development of wireless communication technology, Bluetooth technology, as a short-range wireless communication technology, is widely used in data transmission between various smart devices.

[0003] The existing technology has significant security risks in the Bluetooth transmission process. Although traditional encryption methods such as symmetric encryption (such as AES) are used, these methods cannot prevent replay attacks. Attackers can intercept encrypted ciphertexts and replay them through the Bluetooth debugging assistant to achieve illegal operations (such as vehicle unlocking). In this case, even if the key and plaintext are unknown, the attacker can still deceive the receiving end by replaying the intercepted data packets, resulting in a significant reduction in security. Therefore, the existing technical solutions have obvious deficiencies in dealing with replay attacks and ensuring the dynamic and uniqueness of data transmission.

[0004] Therefore, it is an urgent problem to provide a dynamic real-time encryption method and system for Bluetooth transmission to improve the security and effectiveness of data transmission. Summary of the invention

[0005] In response to the technical problems raised above, the present invention provides a dynamic real-time encryption method and system for Bluetooth transmission. By introducing a time synchronization mechanism and a time verification mechanism, it ensures that the data sent down each time is unique and dynamically changing, thereby effectively preventing the data from being intercepted and replayed, and improving the security and effectiveness of data transmission.

[0006] In a first aspect, the present invention provides a dynamic real-time encryption method for Bluetooth transmission, the method comprising the following steps:

[0007] Step 1: The client establishes a Bluetooth connection with the device;

[0008] Step 2: The client and the device perform time synchronization operations to synchronize the time of the device and the client;

[0009] Step 3: When issuing a control instruction, the client obtains the current first system time, encrypts the first system time to obtain a first encrypted timestamp, then appends the first encrypted timestamp to the control instruction to generate first encrypted data, and sends the first encrypted data to the device via Bluetooth transmission;

[0010] Step 4: After receiving the first encrypted data, the device decrypts the first encrypted timestamp to obtain the first system time, and then determines whether the first system time meets the preset conditions. If so, proceed to step 5; if not, prompt that the data is invalid.

[0011] Step 5: The device executes the control command.

[0012] Specifically, BLE Secure Connections technology is used for Bluetooth connection.

[0013] Specifically, step 2 includes:

[0014] Step 21: The client obtains the current second system time, encrypts the second system time to obtain a second encrypted timestamp, then appends the second encrypted timestamp to the handshake protocol to generate second encrypted data, and sends the data to the device.

[0015] Step 22: After receiving the second encrypted data, the device decrypts the second encrypted timestamp, obtains the second system time, and sets the second system time as its own current time.

[0016] Specifically, the second encrypted timestamp is added to the handshake protocol to generate the first data, and then the first data is encapsulated in a ProtocolBuffer manner to generate the second encrypted data;

[0017] After receiving the second encrypted data, the device encapsulates the second encrypted data using Protocol Buffer and extracts the second encrypted timestamp.

[0018] Specifically, the encryption and decryption algorithm is one of the AES algorithm, the Fernet algorithm, and the RSA algorithm.

[0019] Specifically, in step 4, determining whether the first system time meets a preset condition includes:

[0020] The device side obtains the current device time, calculates the time difference between the first system time and the current device time, and determines whether the time difference is within a preset range.

[0021] Specifically, after the first encrypted data is generated, the first encrypted data is digitally signed to generate third encrypted data, and the third encrypted data is sent to the device end via Bluetooth transmission;

[0022] The device uses the same digital signature algorithm as the client to verify the third encrypted data. If the verification fails, a reminder message is sent and the third encrypted data is discarded. If the verification passes, the first encrypted timestamp is decrypted.

[0023] Specifically, the digital signature algorithm is one of the HMAC algorithm, the DSS algorithm, and the ECDSA algorithm.

[0024] Specifically, after the device executes the control instruction, it generates execution result data and sends the execution result data to the client via Bluetooth transmission.

[0025] In a second aspect, the present invention further provides a dynamic real-time encryption system for Bluetooth transmission, the system comprising: a client and a device, the client comprising a first connection establishment module, a first time synchronization module and an instruction encryption module, the device comprising a second connection establishment module, a second time synchronization module, an execution judgment module and an execution operation module;

[0026] The first connection establishment module and the second connection establishment module are used to control the client to establish a Bluetooth connection with the device;

[0027] The first time synchronization module and the second time synchronization module are used to control the client and the device to perform time synchronization operations so that the device and the client are synchronized;

[0028] An instruction encryption module, used for obtaining the current first system time when issuing a control instruction, encrypting the first system time to obtain a first encrypted timestamp, then appending the first encrypted timestamp to the control instruction to generate first encrypted data, and sending the first encrypted data to the device end via Bluetooth transmission;

[0029] An execution judgment module is used to, after receiving the first encrypted data, decrypt the first encrypted timestamp to obtain the first system time, and then judge whether the first system time meets the preset conditions. If so, enter the execution operation module; if not, prompt that the data is invalid;

[0030] The execution operation module is used to execute control instructions.

[0031] The present invention discloses a dynamic real-time encryption method and system for Bluetooth transmission, which has at least the following beneficial effects compared with the prior art:

[0032] 1. Dynamic real-time encryption method: the client obtains the current system time and performs specific processing on the time. Then, the processed timestamp is attached to the handshake protocol and command data and sent to the device. Each transmitted data contains an encrypted timestamp to ensure the uniqueness and dynamics of the data, effectively preventing replay attacks.

[0033] 2. Time synchronization mechanism. After the device receives the handshake agreement, it restores the timestamp through the decryption algorithm and sets the device time to be synchronized with the client. The time synchronization mechanism ensures that the client and the device perform data transmission and verification on the same time basis, avoiding the complex key distribution process and simplifying the implementation and maintenance of the system.

[0034] 3. Time verification mechanism: After the device receives the command data, it restores the timestamp through the decryption algorithm and compares it with the current time of the device. The time verification mechanism can effectively prevent the data from being tampered with or delayed for too long during transmission, thereby ensuring the validity and security of the data.

[0035] 4. Simplify key management. Through the time synchronization mechanism, the complex key distribution process is avoided. The client and device only need to synchronize time, and there is no need to frequently replace and distribute keys, which simplifies the implementation and maintenance of the system and reduces the difficulty of implementation.

[0036] 5. Improve the efficiency of dynamic data processing. Through dynamic real-time encryption methods and time verification mechanisms, ensure that the data transmitted each time is dynamically changing, effectively prevent replay attacks, improve the efficiency of dynamic data processing, reduce the consumption of computing resources, and improve system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 A flow chart of a dynamic real-time encryption method for Bluetooth transmission according to the present invention;

[0039] Figure 2 The modular schematic diagram of a dynamic real-time encryption system for Bluetooth transmission of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Obviously, the specific embodiments described herein are only used to explain the present invention and are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.

[0041] It should be noted that if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0042] Figure 1 FIG. 1 is a flow chart of an embodiment of a dynamic real-time encryption method for Bluetooth transmission provided by the present invention, and the flow chart specifically includes the following steps:

[0043] Step 1: Establish a Bluetooth connection between the client and the device.

[0044] The client is the device that initiates the Bluetooth connection request, and the device is the target device that the client wants to connect to. When establishing a Bluetooth connection, the client sends a broadcast signal, and the device responds to these signals. Once the client finds the device, it pairs with the device. After the pairing is successful, a stable Bluetooth connection is established between the client and the device, which allows data to be transmitted between the two devices.

[0045] Specifically, BLE Secure Connections technology is used for Bluetooth connection.

[0046] Other secure Bluetooth connection mechanisms may also be used to ensure encryption and integrity protection during data transmission.

[0047] Step 2: The client and the device perform time synchronization operations to synchronize the time of the device and the client.

[0048] Specifically, step 2 includes:

[0049] Step 21: The client obtains the current second system time, encrypts the second system time to obtain a second encrypted timestamp, then appends the second encrypted timestamp to the handshake protocol to generate second encrypted data, and sends it to the device.

[0050] Step 22: After receiving the second encrypted data, the device decrypts the second encrypted timestamp, obtains the second system time, and sets the second system time as its own current time.

[0051] The handshake protocol is a protocol that is exchanged between two parties at the beginning of communication to establish a connection and synchronize information.

[0052] Timestamp refers to the number of seconds or milliseconds from a specific time starting point (usually 00:00:00 UTC on January 1, 1970, i.e. Unix epoch or Epoch time) to a certain moment. It is often used in computer systems to indicate the precise time of an event or operation.

[0053] The client obtains the current system time and encrypts the system time using a specific encryption method (such as a specific calculation formula or AES encryption) to generate a ciphertext. This encrypted timestamp is attached to the handshake protocol and sent to the device. Since the system time obtained each time is different, the ciphertext generated each time is also different, ensuring that the data sent each time is dynamically changing. The use of dynamic real-time encryption methods effectively prevents attackers from intercepting ciphertext and replaying it to perform illegal operations.

[0054] After receiving the ciphertext in the handshake protocol, the device restores the timestamp through the decryption algorithm and performs time synchronization to ensure the time synchronization between the device and the client. The time synchronization mechanism ensures that the device and the client perform data transmission and verification on the same time basis, thereby improving the reliability of data transmission.

[0055] Specifically, the second encrypted timestamp is added to the handshake protocol to generate the first data, and then the first data is encapsulated in a ProtocolBuffer manner to generate the second encrypted data;

[0056] After receiving the second encrypted data, the device encapsulates the second encrypted data using Protocol Buffer and extracts the second encrypted timestamp.

[0057] Specifically, the encryption and decryption algorithm is one of the AES algorithm, the Fernet algorithm, and the RSA algorithm.

[0058] Preferably, in the time synchronization step, the device uses the AES-CCM protocol in the IEEE802.15.4 standard to achieve confidentiality, integrity and authentication of wireless communications.

[0059] Step 3: When issuing a control instruction, the client obtains the current first system time, encrypts the first system time to obtain a first encrypted timestamp, then appends the first encrypted timestamp to the control instruction to generate first encrypted data, and sends the first encrypted data to the device via Bluetooth transmission.

[0060] When the client issues an instruction, it encrypts the current time using a specific encryption method and appends it to the transmitted data. Each transmitted data contains an encrypted timestamp to ensure the uniqueness and dynamic nature of the data.

[0061] Step 4: After receiving the first encrypted data, the device decrypts the first encrypted timestamp to obtain the first system time, and then determines whether the first system time meets the preset conditions. If so, proceed to step 5; if not, prompt that the data is invalid.

[0062] Specifically, in step 4, determining whether the first system time meets a preset condition includes: the device side obtains the current device time, calculates the time difference between the first system time and the current device time, and determines whether the time difference is within a preset range.

[0063] After receiving the transmitted data, the device restores the timestamp through the decryption algorithm and compares it with the current time on the device. Considering the possible delay in the transmission process, a certain range of time error is allowed (such as 2 seconds). If the error between the decrypted timestamp and the current time on the device is within the allowed range, the data is considered valid and the device executes the instructions sent by the client. Otherwise, the data is considered invalid and the device refuses to execute the instructions.

[0064] The time error range is set according to actual application scenarios and requirements, for example, set to 2 seconds or a smaller value.

[0065] Through the time verification mechanism, we can ensure that the data sent down each time is unique and dynamically changing, which can effectively prevent the data from being tampered with or delayed for too long during transmission, thereby ensuring the validity and security of the data.

[0066] Specifically, after the first encrypted data is generated, the first encrypted data is digitally signed to generate third encrypted data, and the third encrypted data is sent to the device end via Bluetooth transmission;

[0067] The device uses the same digital signature algorithm as the client to verify the third encrypted data. If the verification fails, a reminder message is sent and the third encrypted data is discarded. If the verification passes, the first encrypted timestamp is decrypted.

[0068] Specifically, the digital signature algorithm is one of the HMAC algorithm, the DSS algorithm, and the ECDSA algorithm.

[0069] Digital signatures provide a mechanism to ensure the integrity of data and the non-repudiation of its source during transmission, making it more difficult for attackers to tamper with data. Due to the uniqueness of digital signatures, any tampering with the data will result in signature verification failure, thereby protecting the data from unauthorized modification. When the signature verification fails, the device can immediately discard the data and alert the user, simplifying the error handling process and avoiding the processing of invalid data. By introducing the digital signature mechanism, the security, integrity and reliability of Bluetooth transmission data are significantly improved, while also enhancing the system's anti-attack and error handling capabilities.

[0070] Step 5: The device executes the control command.

[0071] Specifically, after the device executes the control instruction, it generates execution result data and sends the execution result data to the client via Bluetooth transmission.

[0072] The above-mentioned execution result data includes: operation status: whether the operation is successful, or the reason for failure; the current working status of the device; the error code when the operation fails; detailed data of the operation result, etc.

[0073] Generating and sending execution result data helps improve the transparency and traceability of operations, enhancing the practicality of the entire system and user trust.

[0074] Preferably, the client and device respectively record log information of instruction transmission, time synchronization and execution results for subsequent analysis and troubleshooting.

[0075] The present invention ensures that the data sent each time is unique and dynamically changes through a dynamic real-time encryption method, a time synchronization mechanism and a time verification mechanism, effectively prevents data from being intercepted and replayed, improves the security and effectiveness of data during Bluetooth transmission, simplifies system implementation and maintenance, and reduces implementation difficulty.

[0076] Figure 2 FIG. 2 is a schematic diagram of a structure of an embodiment of a dynamic real-time encryption system for Bluetooth transmission provided by the present invention. Figure 2 As shown, the system includes: a client 10 and a device 20, the client 10 includes a first connection establishment module 101, a first time synchronization module 102 and an instruction encryption module 103, and the device 20 includes a second connection establishment module 201, a second time synchronization module 202, an execution judgment module 203 and an execution operation module 204.

[0077] The first connection establishing module 101 and the second connection establishing module 201 are used to control the client 10 to establish a Bluetooth connection with the device 20 .

[0078] The first time synchronization module 102 and the second time synchronization module 202 are used to control the client 10 and the device 20 to perform time synchronization operations so as to synchronize the time of the device and the client.

[0079] The instruction encryption module 103 is used to obtain the current first system time when issuing a control instruction, and encrypt the first system time to obtain a first encrypted timestamp, and then attach the first encrypted timestamp to the control instruction to generate first encrypted data, and send the first encrypted data to the device end 20 via Bluetooth transmission.

[0080] The execution judgment module 203 is used to decrypt the first encrypted timestamp after receiving the first encrypted data, obtain the first system time, and then judge whether the first system time meets the preset conditions. If so, enter the execution operation module 204, if not, prompt that the data is invalid.

[0081] The execution operation module 204 is used to execute the control instruction.

[0082] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The above-mentioned program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0084] The above embodiments only express the preferred implementation mode of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A dynamic real-time encryption method for Bluetooth transmission, characterized in that: The steps include: Step 1: The client establishes a Bluetooth connection with the device; Step 2: The client performs a time synchronization operation with the device to synchronize the time of the device with the client; Step 3: When issuing a control instruction, the client obtains the current first system time, encrypts the first system time to obtain a first encrypted timestamp, then appends the first encrypted timestamp to the control instruction to generate first encrypted data, and sends the first encrypted data to the device end via Bluetooth transmission; Step 4: After receiving the first encrypted data, the device end decrypts the first encrypted timestamp to obtain the first system time, and then determines whether the first system time meets a preset condition. If so, proceed to step 5; if not, prompt that the data is invalid. Step 5: The device executes the control instruction.

2. The method according to claim 1, characterized in that Use BLE Secure Connections technology for Bluetooth connection.

3. The method according to claim 1, characterized in that The step 2 comprises: Step 21, the client obtains the current second system time, encrypts the second system time to obtain a second encrypted timestamp, then appends the second encrypted timestamp to the handshake protocol to generate second encrypted data, and sends it to the device end; Step 22: After receiving the second encrypted data, the device decrypts the second encrypted timestamp, obtains the second system time, and sets the second system time as its own current time.

4. The method according to claim 3, characterized in that: The second encrypted timestamp is added to the handshake protocol to generate first data, and then the first data is encapsulated in a Protocol Buffer manner to generate the second encrypted data; After receiving the second encrypted data, the device encapsulates the second encrypted data using Protocol Buffer and extracts the second encrypted timestamp.

5. The method according to claim 1, characterized in that The encryption and decryption algorithm is one of the AES algorithm, Fernet algorithm, and RSA algorithm.

6. The method according to claim 1, characterized in that In step 4, determining whether the first system time meets a preset condition includes: The device side obtains the current device time, calculates the time difference between the first system time and the current device time, and determines whether the time difference is within a preset range.

7. The method according to claim 1, characterized in that After generating the first encrypted data, digitally signing the first encrypted data to generate third encrypted data, and sending the third encrypted data to the device end via Bluetooth transmission; The device uses the same digital signature algorithm as the client to verify the third encrypted data. If the verification fails, a reminder message is sent and the third encrypted data is discarded. If the verification passes, the first encrypted timestamp is decrypted.

8. The method according to claim 7, characterized in that The digital signature algorithm is one of the HMAC algorithm, the DSS algorithm, and the ECDSA algorithm.

9. The method according to claim 1, characterized in that: After the device executes the control instruction, it generates execution result data and sends the execution result data to the client via Bluetooth transmission.

10. A dynamic real-time encryption system for Bluetooth transmission, used to implement the method according to any one of claims 1 to 9, characterized in that: It includes: a client and a device, wherein the client includes a first connection establishment module, a first time synchronization module and an instruction encryption module, and the device includes a second connection establishment module, a second time synchronization module, an execution judgment module and an execution operation module; The first connection establishing module and the second connection establishing module are used to control the client to establish a Bluetooth connection with the device end; The first time synchronization module and the second time synchronization module are used to control the client and the device to perform time synchronization operations, so that the device and the client are synchronized in time; The instruction encryption module is used to obtain the current first system time when issuing a control instruction, and encrypt the first system time to obtain a first encrypted timestamp, then append the first encrypted timestamp to the control instruction to generate first encrypted data, and send the first encrypted data to the device end via Bluetooth transmission; The execution judgment module is used to, after receiving the first encrypted data, decrypt the first encrypted timestamp to obtain the first system time, and then judge whether the first system time meets the preset conditions, if so, enter the execution operation module, if not, prompt that the data is invalid; The execution operation module is used to execute the control instruction.

Citation Information

Patent Citations

  • Instruction Bluetooth-transmission method, equipment side and Bluetooth control system

    CN109327830A

  • Carrier control method and system, carrier, equipment and medium

    CN113783879A

  • Bluetooth communication encryption method and system, Bluetooth locker and storage medium

    CN116709321A

  • Encryption transmission method and system

    CN118432924A