Broadcast key generation method, broadcast key generation system, and bluetooth broadcast device
Patent Information
- Application Number
- CN202511140569.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-08-15
AI Technical Summary
[0002]蓝牙广播在不加密广播的情况下,由于缺乏有效加密机制,存在仿冒风险,降低了发射模块与接收模块之间连接的安全性,通常采用无线发射器来实现蓝牙广播的加密,无线发射器本身具有认证密码,为出厂预设或用户自定义的,出厂预设一般为默认设置,标识在产品身上或说明书中,也有产品可以根据用户选择自定义设置或修改,该认证密码较为固定单一,且具有可见性并容易被破解,缺乏安全性
[0014] The technical solution provided in this application includes the following method: constructing broadcast name information; generating a unique digital code for the transmitting device; and calculating an authentication key for encrypting the broadcast data to be encrypted using a preset algorithm based on the broadcast name information and the digital code. Thus, by generating a unique and unpredictable authentication key for the transmitting device, a password is automatically generated and is invisible, thereby encrypting the broadcast data to be encrypted, thereby improving the security of communication between the transmitting module and the receiving module.
Smart Images

Figure CN120676348B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of wireless communication, and more specifically, to a broadcast key generation method, a broadcast key generation system, and a Bluetooth broadcast device. Background Technology
[0002] Without encryption, Bluetooth broadcasting lacks an effective encryption mechanism, making it vulnerable to counterfeiting and reducing the security of the connection between the transmitting and receiving modules. Encryption of Bluetooth broadcasting is usually achieved using a wireless transmitter. The wireless transmitter itself has an authentication password, which can be preset at the factory or user-defined. The factory preset is usually the default setting, marked on the product or in the instruction manual. Some products can also allow users to customize or modify the password. This authentication password is relatively fixed and simple, and is visible and easy to crack, thus lacking security. Summary of the Invention
[0003] In view of the above problems, this application proposes a broadcast key generation method, a broadcast key generation system, and a Bluetooth broadcasting device to solve the above problems.
[0004] In a first aspect, embodiments of this application provide a broadcast key generation method applied to a transmitting device. The method includes: constructing broadcast name information; generating a unique digital code for the transmitting device; and calculating an authentication key for encrypting broadcast data to be encrypted by using a preset algorithm with the broadcast name information and the digital code.
[0005] Optionally, constructing the broadcast name information specifically includes: obtaining the device name, device model, and any four digits of the Bluetooth address of the transmitting device; determining the broadcast name information based on the string formed by concatenating the device name, device model, and any four digits of the Bluetooth address, wherein the Bluetooth address is separated from the device name or device model by an underscore character.
[0006] Optionally, if the length of the generated string is odd, a space character is added to the last position of the string to make the length of the string even.
[0007] Optionally, the Bluetooth address is the last four hexadecimal characters of the transmitting device's MAC address.
[0008] Optionally, all characters are encoded in ASCII.
[0009] Optionally, the numeric encoding is a 4-byte integer, represented as a 6-digit string, wherein the string value ranges from 000001 to 999999.
[0010] Optionally, the method includes: concatenating the string of broadcast name information and a 6-digit string of numerical encoding to generate an input string; calculating an MD5 digest based on the input string using a preset MD5 algorithm; converting the MD5 digest into a 32-bit hexadecimal string; and extracting any 6 consecutive characters of the string as the authentication key.
[0011] Optionally, the digital code is updated periodically.
[0012] Secondly, embodiments of this application provide a broadcast key generation system, which includes: a construction module for constructing broadcast name information; a generation module for generating a unique digital code for the transmitting device; and an execution module for calculating the broadcast name information and the digital code using a preset algorithm to obtain an authentication key for encrypting broadcast data to be encrypted.
[0013] Thirdly, embodiments of this application provide a Bluetooth broadcasting device, including a processor, a memory, and one or more applications; the one or more applications are stored in the memory and configured to be executed by the processor to implement the above-described broadcast key generation method.
[0014] The technical solution provided in this application includes the following method: constructing broadcast name information; generating a unique digital code for the transmitting device; and calculating an authentication key for encrypting the broadcast data to be encrypted using a preset algorithm based on the broadcast name information and the digital code. Thus, by generating a unique and unpredictable authentication key for the transmitting device, a password is automatically generated and is invisible, thereby encrypting the broadcast data to be encrypted, thereby improving the security of communication between the transmitting module and the receiving module. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments and drawings obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0016] Figure 1 A flowchart illustrating a broadcast key generation method provided in an embodiment of this application is shown.
[0017] Figure 2 A flowchart illustrating the digital encoding generation process of a broadcast key generation system provided in an embodiment of this application is shown.
[0018] Figure 3 A schematic diagram of the structure of a broadcast key generation system provided in an embodiment of this application is shown.
[0019] Figure 4 This is a schematic diagram of the structure of a Bluetooth broadcasting device provided in an embodiment of this application.
[0020] Figure 5 This illustration shows a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0022] Bluetooth broadcasting has two modes: encrypted and unencrypted. In the case of unencrypted broadcasting, the receiving device usually identifies itself directly based on the identity characteristics corresponding to the broadcast. The lack of an effective encryption mechanism poses a risk of impersonation and reduces the security of the connection between the transmitting and receiving devices. Separate encryption can be performed on the broadcast source device, such as a speaker or a wireless transmitter (dongle) connected to a computer. The wireless transmitter itself has an authentication password, which can be preset at the factory or customized by the user. The factory preset is usually the default setting, which is marked on the product or in the instruction manual. Some products can also allow users to customize or modify the settings.
[0023] Typically, wireless transmitters not only encrypt their broadcast information individually, but also have the ability to broadcast audio information from connected speakers or computers via Bluetooth. When mobile devices such as speakers or computers do not have Bluetooth broadcasting capabilities, a wireless transmitter is still required. In this case, the wireless transmitter acts as the transmitting device, only emitting broadcast signals. External receiving devices can scan for these Bluetooth broadcast signals, and after entering a password, they can pair and connect to complete the broadcast network for signal transmission. Since the wireless transmitter itself has no input interface, and the receiving device requires password verification, traditional wireless transmitters rely on a medium for transmitting password pairing, such as a mobile app. After the mobile app connects to the receiving device via Bluetooth, it will display a message. After selecting the receiving device and entering the password, the device connected to the mobile phone can receive the broadcast from the transmitter. This method requires multiple devices to work together, is complex to operate, and the visibility of the password and reliance on the app to transmit the password pose a risk of password leakage.
[0024] To address the aforementioned issues, this application provides a broadcast key generation method, a broadcast key generation system, and a Bluetooth broadcasting device, applicable to a transmitting device. The method includes: constructing broadcast name information; generating a unique digital code for the transmitting device; and calculating an authentication key using a preset algorithm to encrypt the broadcast data to be encrypted, based on the broadcast name information and the digital code.
[0025] Therefore, by generating a unique and unpredictable authentication key for the transmitting device to encrypt the broadcast data, the password is automatically generated and invisible, thereby improving the security of communication between the transmitting and receiving devices.
[0026] Please see Figure 1 , Figure 1 A flowchart illustrating a broadcast key generation method provided in an embodiment of this application is shown. Figure 1 As shown, the method may include steps 110 to 130 and can be applied to a transmitting device. Specifically: In step 110, broadcast name information is constructed.
[0027] In some implementations, the broadcast source device is connected to an external wireless transmitter (dongle), which then transmits the broadcast. The wireless transmitter acts as the transmitting device. The broadcast source device can be a laptop, desktop computer, mobile phone, headphones, or video game console, etc. For example, the video game console could be a PS4 or PS5. The broadcast name information is the broadcast name information of the transmitting device (i.e., the wireless transmitter).
[0028] By constructing the broadcast name information of the transmitting device, subsequent steps can easily construct a unique and unpredictable authentication key for the transmitting device based on the broadcast name information. Specifically, in some implementations, the step "constructing broadcast name information" may include the following steps: (1) Obtain the device name, device model and any four bits of the Bluetooth address of the transmitting device.
[0029] (2) Determine the broadcast name information based on a string formed by concatenating any four characters of the device name, device model and Bluetooth address, wherein the Bluetooth address and the device name or device model are separated by an underscore character.
[0030] In some implementations, the device name can be a prefix of the transmitting device. The prefix can be customized and is generally the brand name of the transmitting device. For example, it could be a prefix of the brand name of a wireless transmitter. Exemplarily, the device name could be "BRD", "AUD", or "DEV", etc.
[0031] In some implementations, the device model can be the model of the transmitting device. For example, the device model can be "Speaker1", "Mic" or "Device", etc.
[0032] In some implementations, the Bluetooth address is any four hexadecimal characters from the transmitter's MAC address. The transmitter's Bluetooth address is typically a 6-byte MAC address, and its format can be "XX:XX:XX:XX:XX:XX". For example, if the Bluetooth address is "11:22:33:44:55:66", then any four characters of the Bluetooth address can be "1122", "2233", "3344", "4455", or "5566". In other words, any four characters of the Bluetooth address only take four characters from the address, excluding the colon.
[0033] In one specific implementation, the Bluetooth address can be the last four hexadecimal characters of the transmitting device's MAC address. For example, if the Bluetooth address is "11:22:33:44:55:66", then the last four digits of the Bluetooth address are "5566". Taking the last four digits facilitates subsequent calculations and a unified generation rule.
[0034] The transmitting device concatenates its corresponding device name, device model, and the last four digits of its Bluetooth address to obtain a specific broadcast name. The Bluetooth address and device name or device model are separated by an underscore character. The underscore separator has a fixed concatenation order, increasing the difficulty of constructing a disguised device and improving security.
[0035] That is, the broadcast name information is "Device Name" + "Device Model" + "_" + "Last four digits of Bluetooth Address". Alternatively, the broadcast name information is "Device Model" + "Device Name" + "_" + "Last four digits of Bluetooth Address". For example: "Broadcast Name Information" = "Device Name" + "Device Model" + "_" + "Last four digits of Bluetooth Address".
[0036] It is worth noting that the length of the broadcast name information, which is constructed by concatenating the corresponding device name, device model, and any four digits of the Bluetooth address, may be odd. Broadcast name information with an odd-length string is inconvenient for subsequent calculations or processing, while broadcast name information with an even-length string is convenient. For example, in embedded systems or Bluetooth protocols, data is processed in bytes, and an even length simplifies memory access, verification calculations (e.g., CRC), or data transmission alignment to the 32-byte limit of Bluetooth broadcast packets (avoiding alignment issues). Therefore, in some implementations, the broadcast key generation method may further include: if the generated string has an odd character length, padding the last character of the string with a space character to make the string's character length even.
[0037] By padding the last character of the broadcast name information string with a space character, not only can the length of the broadcast name information string be adjusted to an even number, but the impact on the readability of the broadcast name information can also be minimized.
[0038] Understandably, if the string length corresponding to the broadcast name information constructed by the transmitting device is even, then there is no need to pad the length of the broadcast name information with spaces. In other words, the final broadcast name information constructed by the transmitting device is a string of even length.
[0039] In some implementations, all characters are ASCII encoded. That is, all characters included in the broadcast name information are ASCII encoded. By using ASCII encoding for all characters, it is ensured that the broadcast name information remains consistent across devices, aligning with the 32-byte limit of Bluetooth broadcast packets, unifying broadcast data, and reducing broadcast latency.
[0040] For example, suppose the transmitter's device name is "BRD", its device model is "Speaker1", and its Bluetooth address is "00:1A:7D:DA:71:13". Assume the last four digits of the Bluetooth address are 7113. The transmitter constructs the following string for the broadcast name information: "BRD" + "Speaker1" + "_" + "7113" = "BRDSpeaker1_7113". Since its length is 17 characters, a space needs to be added at the end to make it an even number of characters. Therefore, the transmitter constructs the following string for the broadcast name information: "BRDSpeaker1_7113" (with a space at the end, totaling 18 characters). This is the final broadcast name information constructed by the transmitter.
[0041] For example, suppose the transmitter's device name is "BRD", the transmitter's device model is "Mic", and any four digits of the Bluetooth address are assumed to be the last four digits (1234). The transmitter constructs the broadcast name information string as: "BRD" + "Mic" + "_" + "1234" = "BRDMic_1234". Since its length is 14 characters, it is not necessary to add a space character at the end to make it an even number. That is, the final broadcast name information constructed by the transmitter is "BRDMic_1234".
[0042] The transmitting device constructs a broadcast name with an even length and all four bits of the device name, device model, and Bluetooth address, ensuring that the broadcast names of different devices are not repeated. In subsequent steps, a unique and unpredictable authentication key for the transmitting device is generated based on the constructed broadcast name information.
[0043] Further: In step 120, a unique digital code for the transmitting device is generated.
[0044] In some implementations, the digital code can be a unique broadcast ID for the transmitting device, a unique identifier defined by the transmitting device manufacturer, and an initial code generated based on the hardware unique ID (such as the chip serial number) when the transmitting device is first started.
[0045] In some implementations, the numeric encoding is a 4-byte integer represented as a 6-digit string, where the string value ranges from 000001 to 999999. For example, the string corresponding to the numeric encoding is "999999". Figure 2 As shown, when the device is first started, the digital encoding generates a 4-byte initial value through a hash operation based on the unique hardware identifier (such as the chip serial number), and then converts it into a 6-digit numeric string. This ensures that different devices have different hardware IDs and that there will be no duplicates. Furthermore, the 4-byte integer storage only occupies 32 bits of memory, and the 6-digit string transmission can adapt to the 6-8 byte payload limit of BLE Bluetooth broadcast packets, saving storage space resources.
[0046] It's worth noting that if the string corresponding to a numeric code is less than 6 digits, you can add 0s to the beginning of the string to make it 6 digits. For example, if the string corresponding to the numeric code is "123", adding 0s to the beginning will give you the string "000123". Similarly, if the string corresponding to the numeric code is "1", adding 0s to the beginning will give you the string "000001".
[0047] In some implementations, the digital code is updated periodically, such as every 24 hours. This increases the unpredictability of the authentication key generated in subsequent steps, thereby improving the security of the broadcast data to be encrypted. During updates, a random number from the hardware device can be used to enhance dynamic security. The current random value of the hardware device (e.g., the current temperature, obtained from a temperature sensor) is introduced, and a random number is generated based on the temperature. Even if the algorithm is known, the next code cannot be predicted. This random number is then combined with the algorithm for updating the code (current code + random number) to generate the updated digital code, ensuring that the range is 000001 to 999999.
[0048] Furthermore, in step 130, the broadcast name information and the digital code are calculated using a preset algorithm to obtain an authentication key used to encrypt the broadcast data to be encrypted.
[0049] In some implementations, the preset algorithm can be a preset MD5 algorithm. It is understood that the preset algorithm can also be other encryption algorithms, and this application does not impose specific limitations on them.
[0050] This application uses a preset MD5 algorithm to generate the authentication key, which protects device information with its irreversible nature. Even if the authentication key is obtained, it is impossible to deduce the device name or numerical code. Furthermore, MD5 calculation only requires 512 bytes of RAM, making it fast and time-efficient, thus better meeting the real-time requirements of Bluetooth broadcasting.
[0051] Specifically, in some implementations, the broadcast key generation method may further include the following steps: (1) Concatenate the string of the broadcast name information and the 6-digit string of the numeric encoding to generate the input string.
[0052] (2) Calculate the MD5 digest based on the input string using the preset MD5 algorithm, convert the MD5 digest into a 32-bit hexadecimal string, and extract any 6 consecutive characters as the authentication key.
[0053] As described above, if the string corresponding to the numeric code is less than 6 characters, it needs to be converted into a 6-character string first, and then the string of the broadcast name information and the 6-character string of the numeric code are concatenated.
[0054] The transmitting device concatenates the string of broadcast name information and the 6-digit string of numerical encoding to obtain the input string. The transmitting device then calculates the MD5 digest of the entire concatenated string (i.e., the input string), and then converts the MD5 digest result into a 32-character hexadecimal string (usually lowercase, but will be converted to uppercase at the end). Finally, any 6 hexadecimal characters (uppercase) of the MD5 digest result are taken as the authentication key.
[0055] For example, the broadcast name information of a Bluetooth device is in the string format "BRDSpeaker_7113" (with a space at the end, totaling 16 characters); the numerical encoding of the Bluetooth device is in the string format "000123"; then the input string is: "BRDSpeaker_7113 " + "000123" = "BRDSpeaker_7113 000123". Directly concatenating the beginning and end reduces the length of the broadcast packet. Then, the concatenated input string is converted into a byte sequence, which can be represented as: "B:66, R:82, D:68, S:83, p:112, e:101, a:97, k:107, e:101, r:114, _:95, 7:55, 1:49, 1:49, 3:51, space:32, 0:48, 0:48, 0:48, 1:49, 2:50, 3:51”, then calculate the MD5 hash of these bytes using the preset MD5 algorithm. Assuming the calculated MD5 hexadecimal string (32 characters) is “1a2b3c4d5e6f78901234567890abcdef”, take any 6 characters (uppercase) as the authentication key. For example, the authentication key could be “1A2B3C”, “4D5E6F”, “789012”, “345678”, or “90ABCD”, etc.
[0056] In one specific implementation, the transmitting device calculates an MD5 digest based on the input string using a preset MD5 algorithm, converts the MD5 digest into a 32-bit hexadecimal string, and extracts the first 6 hexadecimal characters from the MD5 digest, converts them into uppercase form, and uses them as the authentication key.
[0057] For example, the input string is: input string = "BRDSpeaker_7113 000123". The concatenated input string is then converted into a byte sequence, which can be represented as: "B:66, R:82, D:68, S:83, p:112, e:101, a:97, k:107, e:101, r:114, _:95, 7:55, 1:49, 1:49, 3:51, space:32,0:48, 0:48, 0:48, 1:49, 2:50, 3:51". The MD5 hash of these bytes is then calculated using a pre-defined MD5 algorithm. Assuming the calculated MD5 hexadecimal string (32 characters) is "1a2b3c4d5e6f78901234567890abcdef", the first 6 characters (uppercase) are used as the authentication key. For example, the authentication key could be "1A2B3C". The use of hexadecimal uppercase eliminates platform compatibility issues, and the fixed truncation position (first 6 bits) ensures that the receiving end does not need additional signaling to synchronize the key position, thus reducing protocol complexity.
[0058] After obtaining the authentication key "1A2B3C", the broadcast data packet sent by the transmitting device is encrypted using this key, making the broadcast private. Subsequent receiving devices need to obtain this authentication key to decrypt the broadcast data packet. In some implementations, after the digital code is updated periodically, when the digital code "000123" is updated to "000124", the authentication key generated for the same broadcast name changes from "1A2B3C" to "8E9F0A"; it is also updated in a timely manner before transmitting the broadcast, using the new authentication key for encryption.
[0059] Thus, it can be seen that the transmitting device constructs the broadcast name information of the transmitting device through the device name, device model and Bluetooth address; the transmitting device then generates a unique and unpredictable authentication key based on the broadcast name information, digital encoding and preset algorithm, and encrypts the data to be encrypted according to the authentication key to obtain encrypted broadcast information, and then forms a broadcast data packet including broadcast name information, digital encoding and encrypted broadcast information, and broadcasts the broadcast data packet so that the receiving device can scan the broadcast data packet to perform the corresponding operation.
[0060] Furthermore, the receiving device generates an authentication key using the same logic. When the receiving device scans the broadcast from the external source, the broadcast data includes plaintext and ciphertext. The ciphertext is the data encrypted with the authentication key, while the plaintext can be directly scanned, obtained, and parsed by the external source. This plaintext includes information such as the name of the transmitting device, its device model, its Bluetooth address, and its digital code. The plaintext can be extracted from the broadcast data packet and used as a decryption condition parameter. This receiving device is paired with the transmitting device and has the same logic algorithm.
[0061] The receiving device directly obtains the name, model, and last 4 bits of the Bluetooth address of the transmitting device from the broadcast data packet. Based on the logical algorithm, it can construct the broadcast name information, such as the broadcast name "BRDSpeaker_7113". Then, it parses the digital code of the transmitting device from the broadcast data packet, which is a 6-digit numeric string "000123". It then concatenates the input string "BRDSpeaker_7113 000123", calculates the MD5 hash, and takes the first 6 hexadecimal digits: "1A2B3C". It uses this key to decrypt the ciphertext of the broadcast data packet. If the verification is successful, the device's legitimacy is authenticated, and the connection is successfully matched.
[0062] Thus, it can be seen that by scanning broadcast data packets, the receiving device can obtain the broadcast name information of the transmitting device, including the device name, device model, and Bluetooth address, as well as the data of digital encoding used as the decryption authentication key. The receiving device can generate a decryption authentication key through a preset algorithm, decrypt the ciphertext in the broadcast data packet, and perform matching and connection. The decryption and connection operation can be completed without manually entering the authentication key, which has the advantages of security and convenience.
[0063] Please see Figure 3 , Figure 3 This illustration shows a schematic diagram of a broadcast key generation system 200 provided in an embodiment of this application. The broadcast key generation system 200 includes: a construction module 210, a generation module 220, and an execution module 230. Specifically: Module 210 is used to construct broadcast name information.
[0064] The generation module 220 is used to generate a unique digital code for the transmitting device.
[0065] The execution module 230 is used to calculate the broadcast name information and the numerical code through a preset algorithm to obtain the authentication key used to encrypt the broadcast data to be encrypted.
[0066] In some embodiments, the construction module 210 may further include an acquisition unit and an execution unit, wherein: The acquisition unit is used to acquire the device name, device model, and any four bits of the Bluetooth address of the transmitting device; The execution unit is used to determine the broadcast name information based on a string composed of any four characters of the device name, device model, and Bluetooth address. The Bluetooth address is separated from the device name or device model by an underscore character.
[0067] In some implementations, the construction module 210 may further include a padding unit, which is used to pad the last character of the string with a space character if the character length of the generated string is odd, so that the character length of the string is even.
[0068] In some implementations, the Bluetooth address in the execution unit is the last four hexadecimal characters of the transmitting device's MAC address.
[0069] In some implementations, all characters in the execution unit are encoded in ASCII.
[0070] In some implementations, the numeric encoding in the generation module 220 is a 4-byte integer, represented as a 6-digit string, wherein the value range of the string is 000001 to 999999.
[0071] In some implementations, the digital encoding in the generation module 220 is updated periodically.
[0072] In some implementations, the execution module 230 further includes a splicing unit and a determining unit, wherein: The concatenation unit is used to concatenate the string of the broadcast name information and the 6-digit string of the numeric encoding to generate the input string.
[0073] The determination unit is used to calculate the MD5 digest based on the input string using a preset MD5 algorithm, convert the MD5 digest into a 32-bit hexadecimal string, and extract the first 6 consecutive characters of the string as the authentication key.
[0074] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0075] In the several embodiments provided in this application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or other forms.
[0076] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0077] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a Bluetooth broadcasting device provided in an embodiment of this application. The Bluetooth broadcasting device 300 in this application may include one or more of the following components: a processor 310, a memory 320, and one or more application programs. The one or more application programs may be stored in the memory 320 and configured to be executed by one or more processors 310. The one or more programs are configured to execute the broadcast key generation method as described in the foregoing method embodiments. The Bluetooth broadcasting device also includes an encryption system for encrypting broadcast data based on the generated authentication key.
[0078] Processor 310 may include one or more processing cores. Processor 310 connects to various parts within the Bluetooth broadcasting device 300 using various interfaces and lines, and performs various functions and processes data of the Bluetooth broadcasting device 300 by running or executing instructions, programs, code sets, or instruction sets stored in memory 320, and by calling data stored in memory 320. Optionally, processor 310 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 310 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 310 and may be implemented separately using a communication chip.
[0079] The memory 320 may include random access memory (RAM) or read-only memory (ROM). The memory 320 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 320 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created by the Bluetooth broadcasting device 300 during use.
[0080] Please see Figure 5 , Figure 5 The diagram illustrates the structure of a computer-readable storage medium 400 provided in an embodiment of this application. The computer-readable storage medium 400 stores program code, which can be called by a processor to execute the broadcast key generation method described in the above method embodiment.
[0081] The computer-readable storage medium 400 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 400 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 400 has storage space for program code 410 that performs any of the method steps described above. This program code can be read from or written to one or more computer program devices. The program code 410 may be compressed, for example, in a suitable form.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating a broadcast key, characterized in that, The method includes: The broadcast name information is constructed using the transmitting device; the broadcast name information is constructed based on a string formed by concatenating any four characters of the device name, device model, and Bluetooth address. A unique digital code for the transmitting device is generated through the transmitting device; the digital code is updated periodically; the digital code is a 4-byte integer, represented as a 6-digit string; when the digital code is updated periodically, the current random value of the hardware device is introduced, a random number is generated based on the temperature, and the updated digital code is generated by combining the update code algorithm, with a value range of 000001 to 999999. The transmitting device calculates the broadcast name information and the digital code using a preset algorithm to obtain an authentication key for encrypting the broadcast data to be encrypted. The step involves calculating an authentication key for encrypting the broadcast name information and the digital code using a preset algorithm, including: The input string is generated by concatenating the string of the broadcast name information and the 6-digit string of the numeric encoding. The MD5 digest is calculated based on the input string using a preset MD5 algorithm. The MD5 digest is then converted into a 32-bit hexadecimal string, and any 6 consecutive characters are extracted as the authentication key. A receiving device is used to scan broadcast data from the transmitting device from the outside. The broadcast data includes a plaintext part and a ciphertext part. The ciphertext part is data encrypted by the authentication key. The plaintext part is the device name, device model, Bluetooth address, and digital code of the transmitting device. The receiving device has the same logic algorithm as the transmitting device.
2. The broadcast key generation method according to claim 1, characterized in that, The construction of the broadcast name information specifically includes: Obtain the device name, device model, and any four digits of the Bluetooth address of the transmitting device; The broadcast name information is determined by concatenating the device name, the device model, and any four characters of the Bluetooth address, wherein the Bluetooth address is separated from the device name or the device model by an underscore character.
3. The broadcast key generation method according to claim 2, characterized in that, If the length of the generated string is odd, then a space character is padded to the last position of the string so that the length of the string is even.
4. The broadcast key generation method according to claim 2, characterized in that, The Bluetooth address is the last four hexadecimal characters of the MAC address of the transmitting device.
5. The broadcast key generation method according to claim 2, characterized in that, All characters are encoded in ASCII.
6. A broadcast key generation system, characterized in that, include: The construction module is used to construct broadcast name information through the transmitting device; The broadcast name information is constructed based on a string formed by concatenating any four characters of the device name, device model, and Bluetooth address; The generation module is used to generate a unique digital code for the transmitting device; the digital code is updated periodically; the digital code is a 4-byte integer, represented as a 6-digit string; when the digital code is updated periodically, the current random value of the hardware device is introduced, a random number is generated based on the temperature, and an updated digital code is generated by combining the update code algorithm, with a value range of 000001 to 999999. The execution module is used to calculate, through a preset algorithm, the broadcast name information and the digital code by the transmitting device to obtain an authentication key for encrypting the broadcast data to be encrypted; The step involves calculating an authentication key for encrypting the broadcast name information and the digital code using a preset algorithm, including: The input string is generated by concatenating the string of the broadcast name information and the 6-digit string of the numeric encoding. The MD5 digest is calculated based on the input string using a preset MD5 algorithm. The MD5 digest is then converted into a 32-bit hexadecimal string, and any 6 consecutive characters are extracted as the authentication key. A receiving device is used to scan broadcast data from the transmitting device from the outside. The broadcast data includes a plaintext part and a ciphertext part. The ciphertext part is data encrypted by the authentication key. The plaintext part is the device name, device model, Bluetooth address, and digital code of the transmitting device. The receiving device has the same logic algorithm as the transmitting device.
7. A Bluetooth broadcasting device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors as described in any one of claims 1-5, for the purpose of generating a broadcast key.
Citation Information
Patent Citations
Secure beacons
CN113302961A