Bluetooth two-way authentication method and system based on cloud service identification
By dynamically calculating the private service identifier and generating a one-time session token through the cloud service identifier, the problem of Bluetooth service entry points being easily scanned and enumerated and the lack of two-way authentication in the authentication process is solved. This achieves the logical binding of Bluetooth connection security and authentication, and ensures the atomicity of key rotation and revocation.
Patent Information
- Application Number
- CN202611576203.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-13
- Publication Date
- 2026-11-27
AI Technical Summary
In the current authentication process for Bluetooth IoT devices, the Bluetooth service entry point is easily scanned and enumerated, lacks two-way authentication, and the identity authorization is separated from the Bluetooth connection, making it difficult for security policies to take effect in a timely manner in multiple application, multiple channel, and multiple regional scenarios.
By dynamically calculating and distributing private service identifiers through cloud service identifiers, and combining them with mobile devices and target Bluetooth devices to generate one-time session tokens, two-way authentication is achieved, the Bluetooth authentication service entry point is hidden, and the same session token is generated through key derivation function as a unique root of trust to ensure the atomicity of key rotation and revocation.
It hides the Bluetooth service entry point, enhances the logical binding of two-way authentication, reduces the risk of scanning and enumeration, avoids session replay and identity forgery, ensures the atomicity of key rotation and revocation, and improves the security of Bluetooth connections.
Smart Images

Figure CN123185552A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of Bluetooth communication and network security technology, and in particular to a Bluetooth two-way authentication method and system based on cloud service identifiers. Background Technology
[0002] The current network configuration entry points for Bluetooth IoT devices typically cover multiple paths, including QR code scanning, Bluetooth discovery, AP network configuration, device unique identifier network configuration, and base station binding to sub-devices. Mobile devices store information such as device serial number, device unique identifier, device model, channel information, platform type, and cloud authorization status in these paths, and obtain temporary authorization tokens or binding results from the cloud. Based on this, existing solutions still often rely on scannable Bluetooth peripheral names, fixed service entry points, cloud tokens, or one-way authorization results to complete connection authentication.
[0003] Currently, existing technologies disclose a two-way authentication anti-counterfeiting system and method based on Bluetooth Low Energy, including a cloud, a device, and a mobile terminal; the cloud and the mobile terminal communicate via a mobile network, and the mobile terminal and the device communicate via Bluetooth; the cloud verifies the signature information of the device and informs the mobile terminal whether the signature of the device is valid; the device verifies the signature information of the cloud and informs the mobile terminal whether the signature of the cloud is valid. The existing solution has the following drawbacks: Bluetooth peripheral names, device serial number suffixes, and fixed broadcast rules can still be scanned and enumerated; fixed service entry points amplify the risks of unauthorized connections and brute-force attempts; the unique device identifier, verification status, and platform type obtained during the scanning phase are not jointly bound with the one-way authorization result, cloud temporary token, and device serial number during the Bluetooth connection phase, lacking a one-time session factor; different cloud platforms generate temporary authorization tokens based on device serial number, unique device identifier, or gateway identifier, resulting in a lack of a unified two-stage private authentication layer on the Bluetooth connection side; in base station and sub-device scenarios, the mobile terminal, base station, sub-device, and cloud rely solely on a single binding token, which is insufficient to prove that the Bluetooth connection object is the device to be bound or the target device of the wireless network to be synchronized; if the device-side key is not periodically synchronized with the cloud, key rotation, version revocation, and temporary authorization revocation cannot be achieved, making it difficult for security policies to take effect in a timely manner in multi-application, multi-channel, multi-region cloud, and batch device scenarios. Summary of the Invention
[0004] The purpose of this application is to at least solve one of the aforementioned technical defects, particularly the technical problems in the prior art such as the ease with which Bluetooth service entry points can be scanned and enumerated, the lack of two-way authentication in the authentication process, and the disconnect between identity authorization and Bluetooth connection.
[0005] In a first aspect, this application provides a Bluetooth two-way authentication method based on a cloud service identifier, the method comprising the following steps: Step S1: The mobile device obtains the device identifier of the target Bluetooth device and sends a service identifier query request carrying the device identifier to the cloud authentication service. Step S2: The mobile terminal receives the private service identifier, dynamic key, and valid time window returned after the device identifier verification is successful; Step S3: Within the effective time window, the mobile terminal discovers and connects to the authentication service of the target Bluetooth device based on the private service identifier. The mobile terminal generates a mobile terminal random number and receives a device-side random number generated by the target Bluetooth device. Step S4: The mobile terminal and the target Bluetooth device each use the dynamic key, private service identifier, mobile terminal random number, device terminal random number and valid time window as input parameters to generate the same one-time session token through the key derivation function. The private service identifier serves as both the service discovery entry point and the token derivation input parameter. Step S5: The mobile terminal and the target Bluetooth device perform two-way authentication based on the one-time session token.
[0006] A Bluetooth two-way authentication system based on cloud service identifiers, including mobile devices, cloud authentication servers, and Bluetooth security devices; The mobile device sends a service identifier query request carrying the device identifier to the cloud authentication server, receives the private service identifier, dynamic key and valid time window returned by the cloud authentication server, and discovers and connects to the Bluetooth security device within the valid time window; The mobile terminal and the Bluetooth security device send each other random numbers. Each device uses the dynamic key, private service identifier, mobile terminal random number, device terminal random number and valid time window as input parameters to generate a one-time session token through a key derivation function, and performs two-way authentication based on the one-time session token.
[0007] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: By dynamically calculating and issuing a private service identifier in the cloud based on the device identifier and authorization status, the target's Bluetooth authentication entry point is hidden; by directly using the private service identifier as a derived input parameter of the one-time session token, the service entry point discovery and subsequent two-way authentication are tightly logically bound together, fundamentally realizing two-way identity verification and access control. Furthermore, the two-way authentication of this application uses the same one-time session token shared by the mobile terminal and the target Bluetooth device as the unique root of trust, distinguishing the two authentication directions only by different direction labels, ensuring atomicity of key rotation and revocation, and avoiding the semi-failure window that occurs when the rotation is not synchronized in the dual-material scheme. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0009] Figure 1 A flowchart of a Bluetooth two-way authentication method based on a cloud service identifier provided in an embodiment of the present invention; Figure 2 A two-stage connection authentication flowchart provided for embodiments of the present invention; Figure 3 This is a timing diagram for dynamic key bidirectional authentication provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the protocol field structure provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware architecture of a Bluetooth two-way authentication system based on cloud service identifiers provided in an embodiment of the present invention. Detailed Implementation
[0010] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0011] Furthermore, the technical features in the various embodiments or individual embodiments provided in this application can be arbitrarily combined to form a feasible technical solution. Such combination is not constrained by the order of steps and / or the structural composition mode, but must be based on the ability of those skilled in the art to implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0012] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of units and modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or modules can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical or other forms.
[0013] In addition, each functional unit in the various embodiments of this application can be integrated into a single processor, or each unit can be a separate device, or two or more units can be integrated into a single device; each functional unit in the various embodiments of this application can be implemented in hardware or in the form of hardware plus software functional units.
[0014] Those skilled in the art will understand that all or part of the steps of the following method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When executed, the program instructions perform the steps of the following method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks. It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they can be replaced by other expressions.
[0015] Furthermore, 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 technical features indicated. Therefore, a feature marked "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" or "several" means two or more, unless otherwise explicitly specified. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only for illustrative purposes and to aid those skilled in the art, and are not intended to limit the implementation conditions of this application. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effects and objectives of this application, should still fall within the scope of the technical content disclosed in this application.
[0016] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0017] It should also be noted that, in this document, terms such as “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or device that includes the aforementioned element.
[0018] like Figure 1 As shown, the Bluetooth two-way authentication method based on cloud service identifiers includes the following steps: Step S1: The mobile device obtains the device identifier of the target Bluetooth device and sends a service identifier query request carrying the device identifier to the cloud authentication service. Step S2: The mobile terminal receives the private service identifier, dynamic key, and valid time window returned after the device identifier verification is successful; Step S3: Within the valid time window, the mobile terminal discovers and connects to the authentication service of the target Bluetooth device based on the private service identifier. The mobile terminal generates a mobile random number and receives a device-side random number generated by the target Bluetooth device. Step S4: The mobile terminal and the target Bluetooth device each use the dynamic key, private service identifier, mobile terminal random number, device terminal random number and valid time window as input parameters, and generate the same one-time session token through the key derivation function. Step S5: Perform two-way authentication based on a one-time session token.
[0019] This method dynamically distributes a private service identifier based on the device identifier in the cloud to hide the Bluetooth authentication service entry point. This private service identifier is also used as an essential input parameter for both the Bluetooth service discovery entry point and the one-time session token derivation, thus realizing the logical association between service entry point hiding and two-way authentication. This reduces the risk of the Bluetooth service entry point being scanned and enumerated, and eliminates the security risks of identity forgery and session replay.
[0020] Unlike schemes that use two independent key materials to support two authentication directions respectively, the two-way authentication in this application shares the same one-time session token as the unique root of trust, which has the following technical effects: First, the scheme using two independent materials has two independent key lifecycles. When the rotation or revocation of either set of materials is not synchronized, a semi-invalid window will appear where one direction has been updated but the other direction can still be accessed by the old material. This application has only one key, and the key rotation and revocation are atomic, so this window does not exist. Second, the two sets of materials require two independent key storage and rotation processing logics, occupying double the key material storage and computing power on resource-constrained low-power Bluetooth devices. This application can complete two-way authentication with a single root and a single key derivation. Third, by using different first-direction tags and second-direction tags, the authentication response that is eavesdropped on in either direction cannot be replayed to the other direction, compensating for the directional isolation that may be lost after merging the root of trust.
[0021] In step S1, the mobile device obtains the device identifier of the target Bluetooth device, including: When scanning the image QR code of a target Bluetooth device with a camera, the device identifier, device verification status, and platform type are parsed and obtained. When searching for devices via Bluetooth broadcast, the Bluetooth broadcast name is parsed to obtain the device identifier and device model.
[0022] In practice, the mobile device obtains the device identifier through two paths: the QR code scanning path and the Bluetooth self-discovery path. When using the QR code scanning method, the mobile device scans the QR code attached to the shell of the Bluetooth security device with its camera, and parses and saves the device serial number, device unique identifier, verification status, platform type, device model and channel information; When using the Bluetooth self-discovery path, the mobile device parses the broadcast peripheral name and looks up the matching device model, device serial number, and channel information.
[0023] Before entering the Bluetooth private service, the mobile device solidifies the authentication context (including device serial number, device unique identifier, verification status, binding information, channel and platform type).
[0024] The mobile device encapsulates the device's unique identifier, device identity summary, user authorization information, device model, platform type, and request timestamp into a first-stage service identifier query request message, which is then sent to the cloud authentication server via the mobile network. The purpose of the first-stage service identifier query request message is to allow the cloud to confirm "who the requester is, which device is being requested to connect to, and whether the device is currently allowed to connect".
[0025] In step S2, the verification process includes: The cloud authentication service verifies the account binding relationship, space ownership status, channel information, device model, verification status, platform type, device unbinding status, device revocation status, and device freeze status of the device corresponding to the device identifier. After all verifications pass, the cloud authentication service calculates the private service identifier based on the mapping between the device identifier and the current time step.
[0026] Specifically, after receiving the service identifier query request message, the cloud authentication server verifies the device identifier and context information in the message: The cloud authentication server verifies user identity, home or organizational space ownership, device identification mapping relationship, channel information, device model, verification status, platform type, binding restrictions, and checks whether the device has been unbound, revoked, migrated to another tenant, or frozen.
[0027] After all verifications pass, the authentication processing component uses the device serial number, device unique identifier, and gateway identifier as identity anchors, combined with the dynamic key version and time step, to dynamically calculate the private service identifier currently available for the device. This private service identifier is used to hide the authentication service entry point of the target Bluetooth device.
[0028] In a preferred embodiment of the present invention, the private service identifier generation method includes fixed mapping at the device serial number level, mapping at the device unique identifier level, batch-level mapping, channel mapping, platform type mapping, derived identifier that changes according to time window, or temporary identifier obtained by mapping broadcast short code.
[0029] Mobile devices can only use the service identifier to scan, connect, or discover authentication features within a valid time window.
[0030] Reference Figure 5 The cloud authentication server generates a first-stage service identifier query response message and returns it to the mobile device. The first-stage service identifier query response message includes a private service identifier, a temporary authorization token, a dynamic key, a dynamic key version, a valid time window (including an expiration time), handshake parameters, and a rate limiting policy. If the verification fails, an error response is returned, and the mobile device terminates the subsequent Bluetooth connection.
[0031] The purpose of the first-stage service identifier query response message is to send the available Bluetooth authentication service entry and temporary authentication materials to the authorized mobile terminal.
[0032] Step S3 specifically includes the following sub-steps: Step S301: When the local system time is within the valid time window, initialize the low-power Bluetooth scanning filter and set the scanning filtering conditions to only match broadcast short codes derived from the private service identifier. Specifically, the mobile processing component in the mobile device starts a local clock timer based on the valid time window returned by the cloud authentication server; When the local system time is within the valid time window, the mobile processing unit drives the low-power Bluetooth scanning component in the mobile Bluetooth communication unit to initialize the low-power Bluetooth scanning filter and set the scanning filtering condition to match only the received private service identifier. Step S302: The target Bluetooth device sends a broadcast data packet. The data payload of the broadcast data packet carries a broadcast short code derived from the private service identifier. The broadcast short code is updated with the effective time window. The device identifier digest included in the broadcast data packet is parsed and verified. After the verification is successful, a Bluetooth connection establishment command is triggered. Specifically, the Bluetooth security device sends out broadcast data packets through the Bluetooth Low Energy Broadcast component in the device's Bluetooth communication component. After the Bluetooth Low Energy Scanning component on the mobile terminal captures the broadcast data packets, it parses the device identifier summary included in the broadcast data packets, verifies and confirms that it is consistent with the target Bluetooth security device, and triggers a Bluetooth connection establishment command.
[0033] Step S303: Establish a Bluetooth Low Energy link, perform maximum transmission unit negotiation, and open the authentication feature value channel by retrieving the authentication feature value of the main service in the general attribute configuration file corresponding to the private service identifier. Specifically, the Bluetooth property profile client component on the mobile device initiates a Bluetooth Low Energy link layer connection request frame to the Bluetooth property profile server component on the Bluetooth security device. After the Bluetooth Low Energy link is established, the Bluetooth property profile client component and the Bluetooth property profile server component negotiate the maximum transmission unit to determine the upper limit of bytes for single-frame data packet transmission in this Bluetooth session.
[0034] The mobile device's Bluetooth property profile client component sends a service discovery request to the Bluetooth property profile server component, retrieves the main service of the general property profile corresponding to the private service identifier, and after locating the main service, further retrieves the authentication feature values included in the main service, and enables the notification and indication data transmission permissions of the authentication feature value channel by writing an enable control word to the client feature configuration descriptor.
[0035] Step S304: Call the hardware pseudo-random number generation algorithm to generate a mobile terminal random number, encapsulate the mobile terminal random number into a general attribute configuration file write request frame, and send it through the authentication feature value channel. The target Bluetooth device receives the general attribute configuration file write request frame and generates a device-side random number, and assigns a unique session identifier. Specifically, the mobile processing unit on the mobile device calls the hardware pseudo-random number generation algorithm through the session token derivation component to generate mobile random numbers with high entropy characteristics. The mobile device's Bluetooth property configuration file client component encapsulates the mobile device's random number into a general property configuration file write request frame, and sends it to the Bluetooth security device through the authorized authentication feature value channel. After the Bluetooth attribute configuration file server component of the Bluetooth security device receives the write request frame through the authentication feature value channel, it writes the mobile terminal random number into the temporary session storage area of the device processing component, and at the same time triggers the random number generation component to generate a device-side random number and assigns a unique session identifier for this authentication handshake process.
[0036] Step S305: The device-side random number, unique session identifier, and valid time window number are encapsulated into a notification frame and sent to the mobile terminal. The mobile terminal receives and parses the notification frame to obtain the device-side random number.
[0037] Specifically, refer to Figure 5 The Bluetooth security device's processing component encapsulates the generated device-side random number, unique session identifier, and valid time window number into a second-stage Bluetooth authentication handshake frame. This frame is then sent to the mobile device via the Bluetooth property profile server component as a general property profile notification frame. The mobile device's Bluetooth property profile client component receives and parses the notification frame, extracts the device-side random number, and completes the bidirectional random number exchange. The purpose of the second-stage Bluetooth authentication handshake frame is to exchange the random challenge and status information required for the current session after the mobile device and the device have established a Bluetooth connection.
[0038] It should be noted that, because the Private Service Identifier is dynamically issued by the cloud and updated periodically within a valid time window, Bluetooth security devices only broadcast a short broadcast code derived from this specific Private Service Identifier. After the mobile device scans and discovers a matching short broadcast code, a Bluetooth link is established and the device enters the authentication feature value channel. This step occurs after the Bluetooth physical link is established and data read / write capabilities are available, but before the wireless network list is read or the base station binding page is redirected.
[0039] In one specific embodiment of the present invention, reference is made to... Figure 2 The attached diagram illustrates a two-phase connection authentication process. The labeling includes: 201—Mobile device obtains device identifier; 202—Requests cloud service identifier, temporary token, and device status; 203—Determines authorization and device status validity; 204—Connection rejected; 205—Mobile device discovers Bluetooth service using private service identifier; 206—Both parties generate challenge numbers and derive churk; 207—Establishes encrypted session after successful two-way authentication.
[0040] After entering the authentication feature value channel, the first processing component on the mobile device generates a random number on the mobile device, and the second processing component on the Bluetooth security device generates a random number on the device side. Both parties exchange handshake data through the second-stage Bluetooth authentication handshake frame, which includes frame type, session ID, mobile device random number, device side random number, valid time window number, and authentication result code.
[0041] In step S4, the input parameters also include: The cloud authentication service returns the temporary authorization token, dynamic key version number, and platform type. The mobile device and the target Bluetooth device input the dynamic key, dynamic key version number, private service identifier, device identifier, temporary authorization token, mobile device random number, device random number, valid time window, and platform type into the key derivation function to calculate a one-time session token. ; The private service identifier serves as both the service discovery entry point and the token derivation input parameter.
[0042] Specifically, the key derivation function's logic includes: The key derivation function corresponds to the churk derivation function operator, and its mathematical expression is: ; in, This indicates a derived, one-time session token. This indicates a dynamic key sent from the cloud to the mobile device, and the Bluetooth security device has been synchronized with the cloud. Indicates the unique identifier of the device. Indicates a private service identifier. This indicates a temporary authorization token returned from the cloud. Represents a random number on a mobile device. This represents a random number generated by the device. Indicates the effective time window number. Indicates the dynamic key version number. Indicates the service platform category (platform type). Represents the key derivation function; In this step, the private service identifier Forced to be used as a derived one-time session token One of the core input parameters. The private service identifier is used both to discover service entry points and to participate in token derivation, thus binding "service entry point hiding" and "two-way authentication".
[0043] In step S5, two-way authentication includes: The mobile device generates a mobile authentication digest based on a one-time session token, the mobile device's random number, and the mobile device's direction tag string, and sends the mobile authentication digest to the target Bluetooth device; The target Bluetooth device verifies the mobile authentication digest based on a locally generated one-time session token. When the mobile authentication digest verification passes, the target Bluetooth device generates a device authentication digest based on the one-time session token, the device-side random number, the session identifier, and the device-side direction tag string, and sends the device authentication digest to the mobile device. After the mobile device passes the authentication digest verification of the device, the identity of the target Bluetooth device is confirmed to be legitimate. The mobile authentication digest and the device authentication digest are derived from the same one-time session token, and the mobile direction tag string and the device direction tag string are different from each other.
[0044] Specifically, the authentication digest generation algorithm can adopt HMAC-SHA256, AES-CMAC, GMAC or the national cryptographic SM3 / SM4 digest authentication algorithm; In one specific embodiment of the present invention, reference is made to... Figure 3 This is a timing diagram for dynamic key two-way authentication. The labels in this diagram are as follows: 301—Mobile device; 302—Cloud authentication service; 303—Device device; 304—Query temporary token and authentication materials by device identifier; 305—Return private service identifier, temporary token, key version, and time window; 306—Device synchronizes key version / revocation status; 307—Connect to private Bluetooth authentication service; 308—Device randomly challenges nonceD; 309—Mobile phone responds with MAC; 310—Device responds with MAC; 311—Both parties confirm and enter encrypted session; 312—Abnormal: key expired / device revoked; 313—Terminate connection and clear temporary parameters.
[0045] The mobile device fills the mobile authentication digest into the MAC digest field and sends it to the Bluetooth security device; Bluetooth security devices use a locally derived churk to independently calculate the expected mobile authentication digest and compare it with the received mobile authentication digest. If the two do not match, the Bluetooth security device immediately disconnects. If the two match, the verification passes. The Bluetooth security device calculates and generates a device authentication digest based on churk, a random number on the device, the unique device identifier of the session, and the device's direction tag string "DEVICE". The mobile-side directional label string is a preset fixed literal "APP" (which can also be "MOBILE" or "PHONE"), and the device-side directional label string is a preset fixed literal "DEVICE"; the two are different from each other and are preset constants of both the mobile device and the target Bluetooth device. Therefore, even if both the mobile-side authentication digest and the device-side authentication digest are derived from the same one-time session token as the unique root of trust, the digest outputs in the two directions will be different due to the difference in label values, and the authentication digest eavesdropped in one direction cannot be replayed in the other direction.
[0046] The Bluetooth security device returns the device authentication digest to the mobile device. The mobile device verifies the device authentication digest. Once verified, both parties confirm the trustworthiness of the session and can continue to generate one-time session tokens for subsequent Bluetooth Wi-Fi list reading, Wi-Fi information writing, base station / sub-device binding, Wi-Fi reconnection, control, and firmware maintenance.
[0047] If either party discovers that the dynamic key version is inconsistent, the time window has expired, the random number is duplicated, the MAC is incorrect, the device has been revoked, or the cloud status is abnormal, the connection will be terminated immediately and the one-time session token will be cleared.
[0048] The device can synchronize the latest key (dynamic key) version and revocation status with the cloud in the background according to the policy.
[0049] The mobile device and the target Bluetooth device calculate and generate a session encryption key based on a one-time session token; The session encryption key is used to encrypt the transmission of data during processes such as reading wireless network lists, writing wireless network configuration information, binding base stations and sub-devices, reconnecting to wireless networks, and firmware maintenance.
[0050] Specifically, after two-way authentication is successful, the mobile device and the Bluetooth security device derive a session encryption key based on churk; When the mobile device sends commands to the Bluetooth security device to read the wireless network list, write the wireless network account and password, bind the base station and the sub-device, reconnect to the wireless network, or maintain the firmware, the session encryption key is used for symmetric encryption of the data transmission.
[0051] The target Bluetooth device performs replay protection and lockout control, including: The target Bluetooth device verifies the received random number from the mobile terminal. If the random number from the mobile terminal exists in a preset historical random number storage list, the connection is terminated. When the number of consecutive authentication failures reaches the preset limit, the target Bluetooth device locks the write channel of the Bluetooth authentication feature value and rejects subsequent data write requests.
[0052] When the target Bluetooth device cannot connect to the Internet, the last valid dynamic key and the offline valid time window number stored locally are used to perform one-time session token derivation and two-way authentication with the mobile terminal.
[0053] The embodiments of the present invention also include an anomaly protection and security control mechanism, the specific logic of which includes: The first security mechanism is that the Bluetooth security device opens a storage area to record the random numbers and session IDs of mobile devices used in a short period of time. When a duplicate random number from a mobile device is received, authentication is rejected and the physical connection is terminated. The second security mechanism sets an effective time window for both the private service identifier and the dynamic key. After the expiration, the mobile device must re-request the latest service identifier and key from the cloud authentication server. The third security mechanism involves the cloud authentication server adjusting the key version according to the device, batch, or risk level, and Bluetooth security devices updating their local key database through regular synchronization with the cloud or event-triggered synchronization. The fourth security mechanism is as follows: when the Bluetooth security device is offline and not connected to the Internet, it will downgrade to using the version of the last valid dynamic key cached locally and the short-term offline time window number; after the tolerance period is exceeded, new connections will be rejected. The fifth security mechanism is that when the number of consecutive authentication failures reaches the preset limit (e.g., 5 consecutive failures), the Bluetooth security device locks the Bluetooth authentication feature value writing channel, and the cloud records the risk event synchronously. The sixth security mechanism is that when a user unbinds their device, reports a lost device, a tenant migrates their device, or the device is frozen, the cloud authentication server stops issuing private service identifiers, and the Bluetooth security device is simultaneously deactivated and refuses access to the old token.
[0054] like Figure 5 As shown, the Bluetooth two-way authentication system based on cloud service identifiers includes a mobile terminal, a cloud authentication server, and Bluetooth security devices; The mobile device sends a service identifier query request carrying the device identifier to the cloud authentication server, receives the private service identifier, dynamic key and valid time window returned by the cloud authentication server, and discovers and connects to the Bluetooth security device within the valid time window; The mobile device and the Bluetooth security device send each other random numbers. Each device uses a dynamic key, a private service identifier, a random number from the mobile device, a random number from the device, and a valid time window as input parameters to generate a one-time session token through a key derivation function, and performs two-way authentication based on the one-time session token.
[0055] This invention is a Bluetooth private protocol mechanism based on device identifier and cloud token to issue private service identifier, and both parties negotiate churk session token to complete two-way challenge and response authentication.
[0056] The device exposes only a limited number of discovery entry points. The real authentication service entry point (private BluetoothServiceUUID) is dynamically determined after authorization by the cloud. Unauthorized terminals cannot predict the private service identifier within the current valid time window, and therefore cannot discover and connect to the authentication service within the valid time window. The mobile and device terminals generate a one-time session authentication token churk based on multiple parameters such as dynamic key, device identifier, temporary authorization token, and random numbers from both parties through a key derivation function; Both parties' response values are bound to mobile random numbers and device random numbers, and are distinguished only by directional labels, thus achieving true two-way identity verification; the mobile terminal is exemplified by a mobile phone.
[0057] The cloud provides unified management of key versions and time windows, and supports key rotation and revocation.
[0058] Reference Figure 5 This is a schematic diagram of the hardware architecture of a Bluetooth two-way authentication system based on a cloud service identifier. This embodiment of the invention provides a hardware architecture for a Bluetooth two-way authentication system based on a cloud service identifier. The system includes a mobile terminal 101 (corresponding to the component level), a cloud authentication server 102 (corresponding to the component level), and a Bluetooth security device 103 (corresponding to the component level).
[0059] The mobile terminal 101 includes a first processing component and a first Bluetooth transceiver component. The first processing component is responsible for image QR code parsing, network packet assembly, and key derivation calculation; the first Bluetooth transceiver component is responsible for Bluetooth Low Energy broadcast scanning and data channel establishment.
[0060] The cloud authentication server consists of an authentication processing component and a database component. The authentication processing component is responsible for verifying device binding permissions, dynamically calculating private service identifiers, and managing key versions; the database component is used to store unique device identifiers, tenant relationships, binding status, and key revocation lists.
[0061] The Bluetooth security device includes a second processing component and a second Bluetooth transceiver component. The second processing component is responsible for generating random numbers on the device side, deriving one-time session tokens, and performing message authentication code verification; the second Bluetooth transceiver component is responsible for broadcasting the private service identifier and establishing a Bluetooth connection channel.
[0062] Table 1 shows the complete data field mapping and its role in each stage in this embodiment of the invention: Table 1: Definition Table of Key Data Fields in the Protocol In a preferred embodiment of the present invention, the private service identifier is generated in the following ways: fixed mapping based on device serial number, mapping based on device batch, mapping based on tenant, and temporary identifier dynamically generated based on time slice hash value.
[0063] In a preferred embodiment of the present invention, the sources of dynamic keys include real-time distribution from the cloud, derivation of temporary authorization tokens, periodic retrieval from the device, derivation of the factory root key via KDF, generation by a hardware security unit, or generation through a dynamic code mechanism such as a bank's U-shield.
[0064] In a preferred embodiment of the present invention, the digest authentication algorithm used for two-way authentication includes Advanced Encryption Standard Message Authentication Code (AES-CMAC), Advanced Encryption Standard Galois Message Authentication Code (GMAC), Chinese national cryptographic SM3 hash algorithm, and Chinese national cryptographic SM4 block cipher algorithm.
[0065] In a preferred embodiment of the present invention, the key derivation function adopts HKDF or an equivalent KDF, including the key derivation function algorithm based on hash message authentication code (HMAC-SHA256-KDF), the key derivation function algorithm based on the national cryptographic SM3 algorithm (HMAC-SM3-KDF), and the key derivation function algorithm based on Advanced Encryption Standard block cipher (AES-CMAC-KDF).
[0066] In a preferred embodiment of the present invention, the authentication sequence may be that the device first proves its identity to the mobile phone and then requests the mobile phone to submit an authorization response; or the two may be combined into a single handshake to reduce the number of Bluetooth interactions.
[0067] In a preferred embodiment of the present invention, the offline strategy includes the ability of the device to choose, based on the risk level, to completely reject offline connections, allow short-term offline connections, allow only whitelisted mobile devices to connect, or only enable read-only diagnostic capabilities.
[0068] In a preferred embodiment of the present invention, the Bluetooth device includes a camera, doorbell, base station, bun-making equipment network configuration, Bluetooth smart door lock, industrial inspection terminal, after-sales maintenance tools, sensor, and low-power gateway.
[0069] In a preferred embodiment of the present invention, the device owner is allowed to issue a temporary authorization token (including the validity period and permission level) to a third-party App via the cloud. The third-party App uses the temporary authorization token to access the device through a private authentication process, without the need for the device owner to directly share the key. This solution is suitable for home sharing and temporary maintenance scenarios.
[0070] In a preferred embodiment of the present invention, the calculation factor of the private Service UUID is expanded from device identifier + platform type to include multi-dimensional information such as geographical location, Wi-Fi BSSID, and time slice hash value. The device only exposes the real private service when the multi-dimensional conditions are met, thereby further enhancing the service's concealment.
[0071] In a specific embodiment of the present invention, this solution divides Bluetooth connection authentication into two consecutive stages: the first stage is the private service entry discovery stage, where the mobile device does not directly rely on the public service identifier, but uses the device serial number, device unique identifier, verification status, device model, channel information and platform type obtained by scanning the code or Bluetooth self-discovery, and obtains the currently available private Service UUID, temporary authorization token and temporary authentication parameters of the device after verification by the cloud authentication service; the second stage is the dynamic authentication stage after the actual Bluetooth connection, where after the mobile device connects to the device and enters the communicable state, it no longer relies solely on the one-way authorization result, but generates random challenges and derives a one-time session authentication token churk based on the dynamic authentication information issued by the cloud or synchronized by the device, and completes two-way identity verification through challenge response.
[0072] Here, churk can be understood as a temporary verification factor used in a single Bluetooth authentication session. It is not directly stored as a long-term key, but is generated by a key derivation function from parameters such as the dynamic key, device unique identifier, private service identifier, mobile random number, device random number, temporary authorization token, time window, key version, and platform type. Changes to any of these parameters will cause changes to churk, thereby reducing the risk of replay attacks and data leakage / reuse.
[0073] For example, in one specific embodiment of the present invention, user Zhang Wei purchased a Bluetooth video doorbell (Bluetooth security device) and a gateway base station for use with it. During network configuration, Zhang Wei used a mobile app (mobile terminal) to scan the QR code on the bottom of the doorbell.
[0074] The mobile device obtains the doorbell's unique identifier and sends a query request to the cloud authentication server. After verifying that the doorbell is unbound and has been sold normally, the cloud authentication server dynamically calculates the private service identifier UUID-A for the current 5-minute valid time window based on the device's unique identifier, and returns the UUID-A and dynamic key K1 to the mobile device.
[0075] The doorbell calculates the same UUID-A locally and broadcasts its derived short code / encrypted payload. The mobile device uses the UUID-A and its derived short code to locate and connect to the doorbell's private Bluetooth signature channel. After the connection is established, the mobile device generates a mobile random number, and the doorbell generates a device random number. Both devices input the dynamic key K1, UUID-A, mobile random number, and device random number into the HMAC-SHA256 algorithm to derive the session token churk.
[0076] The mobile device sends a mobile authentication digest (MAC-M) calculated based on the session token churk to the doorbell. The doorbell verifies the phone's legitimacy and confirms its legitimacy. Subsequently, the doorbell sends a device-side digest (MAC-D) calculated based on churk to the mobile device. The mobile device verifies this as well, confirming the doorbell's legitimacy. After successful two-way authentication, the mobile device writes its encrypted home Wi-Fi account and password into the doorbell, and the doorbell successfully connects to the network and completes network configuration.
[0077] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0078] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0079] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A Bluetooth two-way authentication method based on cloud service identifiers, characterized in that, Includes the following steps: Step S1: The mobile device obtains the device identifier of the target Bluetooth device and sends a service identifier query request carrying the device identifier to the cloud authentication service. Step S2: The mobile terminal receives the private service identifier, dynamic key, and valid time window returned after the device identifier verification is successful; Step S3: Within the effective time window, the mobile terminal discovers and connects to the authentication service of the target Bluetooth device based on the private service identifier. The mobile terminal generates a mobile terminal random number and receives a device-side random number generated by the target Bluetooth device. Step S4: The mobile terminal and the target Bluetooth device each use the dynamic key, private service identifier, mobile terminal random number, device terminal random number and valid time window as input parameters to generate the same one-time session token through the key derivation function. The private service identifier serves as both the service discovery entry point and the token derivation input parameter. Step S5: The mobile terminal and the target Bluetooth device perform two-way authentication based on the one-time session token.
2. The Bluetooth two-way authentication method based on cloud service identifier according to claim 1, characterized in that: In step S1, the mobile terminal obtains the device identifier of the target Bluetooth device, including: When scanning the image QR code of the target Bluetooth device with a camera, the device identifier, device verification status, and platform type are parsed and obtained. When searching for devices via Bluetooth broadcast, the device identifier and device model are obtained by parsing the Bluetooth broadcast name.
3. The Bluetooth two-way authentication method based on cloud service identifier according to claim 1, characterized in that: In step S2, the verification process includes: The cloud authentication service verifies the account binding relationship, space ownership status, channel information, device model, verification status, platform type, device unbinding status, device revocation status, and device freeze status of the device corresponding to the device identifier. After all verifications pass, the cloud authentication service calculates the private service identifier based on the mapping between the device identifier and the current time step.
4. The Bluetooth two-way authentication method based on cloud service identifier according to claim 1, characterized in that: Step S3 specifically includes the following sub-steps: Step S301: When the local system time is within the effective time window, initialize the low-power Bluetooth scanning filter and set the scanning filtering conditions to only match broadcast short codes derived from the private service identifier. Step S302: The target Bluetooth device sends a broadcast data packet. The data payload of the broadcast data packet carries a broadcast short code derived from the private service identifier. The broadcast short code is updated with the effective time window. The device identifier digest included in the broadcast data packet is parsed and verified. After the verification is successful, a Bluetooth connection establishment command is triggered. Step S303: Establish a Bluetooth Low Energy link, perform maximum transmission unit negotiation, and open the authentication feature value channel by retrieving and locating the authentication feature value of the main service in the general attribute configuration file corresponding to the private service identifier. Step S304: Call the hardware pseudo-random number generation algorithm to generate a mobile terminal random number, encapsulate the mobile terminal random number into a general attribute configuration file write request frame, and send it through the authentication feature value channel. The target Bluetooth device receives the general attribute configuration file write request frame and generates a device-side random number, and assigns a unique session identifier. Step S305: The device-side random number, unique session identifier, and valid time window number are encapsulated into a notification frame and sent to the mobile terminal. The mobile terminal receives and parses the notification frame to obtain the device-side random number.
5. The Bluetooth two-way authentication method based on cloud service identifier according to claim 1, characterized in that: In step S4, the input parameters further include: The cloud authentication service returns the temporary authorization token, dynamic key version number, and platform type. The mobile terminal and the target Bluetooth device input the dynamic key, dynamic key version number, private service identifier, device identifier, temporary authorization token, mobile terminal random number, device terminal random number, valid time window and platform type into the key derivation function to calculate a one-time session token; The private service identifier serves as both the service discovery entry point and the token derivation input parameter.
6. The Bluetooth two-way authentication method based on cloud service identifier according to claim 1, characterized in that: In step S5, two-way authentication includes: The mobile device generates a mobile authentication digest based on the one-time session token, the mobile device random number, and the mobile device direction tag string, and sends the mobile authentication digest to the target Bluetooth device; The target Bluetooth device verifies the mobile authentication digest based on the locally generated one-time session token. When the mobile authentication digest verification passes, the target Bluetooth device generates a device authentication digest based on the one-time session token, the device-side random number, the session identifier, and the device-side direction tag string, and sends the device authentication digest to the mobile device. After the mobile terminal verifies the authentication digest of the device terminal, it confirms that the target Bluetooth device is legitimate. The mobile authentication digest and the device authentication digest are derived from the same one-time session token, and the mobile direction tag string and the device direction tag string are different from each other.
7. The Bluetooth two-way authentication method based on cloud service identifier according to claim 6, characterized in that: The mobile device and the target Bluetooth device calculate and generate a session encryption key based on the one-time session token; The session encryption key is used to encrypt and transmit data during processes such as reading wireless network lists, writing wireless network configuration information, binding base stations and sub-devices, reconnecting to wireless networks, and firmware maintenance.
8. The Bluetooth two-way authentication method based on cloud service identifier according to claim 7, characterized in that: The target Bluetooth device performs replay protection and lockout control, including: The target Bluetooth device verifies the received random number from the mobile terminal. If the random number from the mobile terminal exists in a preset historical random number storage list, the connection is terminated. When the number of consecutive authentication failures reaches the preset limit, the target Bluetooth device locks the write channel of the Bluetooth authentication feature value and rejects subsequent data write requests.
9. The Bluetooth two-way authentication method based on cloud service identifier according to claim 8, characterized in that: When the target Bluetooth device cannot connect to the Internet, the last valid dynamic key and the offline valid time window number stored locally are used to perform the derivation and two-way authentication of the one-time session token with the mobile terminal.
10. A Bluetooth two-way authentication system based on a cloud service identifier, used to run the Bluetooth two-way authentication method based on a cloud service identifier as described in any one of claims 1-9, characterized in that: This includes mobile devices, cloud authentication servers, and Bluetooth security devices; The mobile device sends a service identifier query request carrying the device identifier to the cloud authentication server, receives the private service identifier, dynamic key and valid time window returned by the cloud authentication server, and discovers and connects to the Bluetooth security device within the valid time window; The mobile terminal and the Bluetooth security device send each other random numbers. Each device uses the dynamic key, private service identifier, mobile terminal random number, device terminal random number and valid time window as input parameters to generate a one-time session token through a key derivation function, and performs two-way authentication based on the one-time session token.
