WO2018120883A1 - 低功耗蓝牙设备通讯加密方法及*** - Google Patents

低功耗蓝牙设备通讯加密方法及*** Download PDF

Info

Publication number
WO2018120883A1
WO2018120883A1 PCT/CN2017/099427 CN2017099427W WO2018120883A1 WO 2018120883 A1 WO2018120883 A1 WO 2018120883A1 CN 2017099427 W CN2017099427 W CN 2017099427W WO 2018120883 A1 WO2018120883 A1 WO 2018120883A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth device
bluetooth
connection
authentication
pairing
Prior art date
Application number
PCT/CN2017/099427
Other languages
English (en)
French (fr)
Inventor
贾高威
Original Assignee
北京握奇数据股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京握奇数据股份有限公司 filed Critical 北京握奇数据股份有限公司
Publication of WO2018120883A1 publication Critical patent/WO2018120883A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the invention relates to a Bluetooth communication encryption technology, in particular to a low-power Bluetooth device communication encryption method and system.
  • Low-power Bluetooth devices (BLE) enable ultra-low peak, balanced, and idle mode power consumption with communication distances of up to 100 meters. Low device duty cycles save more power and can be used for many years even with button cells.
  • the security of Bluetooth communication mainly depends on the E0 algorithm of the baseband layer. Due to the limited capacity of the linear feedback shift register (LFSR), the security is relatively weak. For scenarios with high security requirements (such as payment), a higher security communication mechanism is needed to ensure the security of Bluetooth communication.
  • LFSR linear feedback shift register
  • the RC4 encryption algorithm is a cluster of variable-length stream encryption algorithms designed by Ronald Rivest, the number one in the famous RSA trio, in 1987. It is called a cluster because the S-box length of its core part can be arbitrary, but it is generally 256 bytes.
  • the algorithm can achieve about 10 times the speed of DES encryption and has a very high level of nonlinearity.
  • MD5 is Message-Digest Algorithm 5, which is used to ensure complete and consistent information transmission. It is one of the hash algorithms widely used by computers (also translated into abstract algorithm and hash algorithm). MD5 is widely used in mainstream programming languages. achieve. Calculating data (such as Chinese characters) into another fixed-length value is the basic principle of the hash algorithm. The predecessors of MD5 are MD2, MD3, and MD4.
  • the MD5 algorithm has the following characteristics:
  • anti-modification any changes to the original data, even if only 1 byte is modified, the MD5 value obtained is very different.
  • the role of MD5 is to allow large amounts of information to be "compressed" into a secure format (that is, to convert a string of arbitrary length into a string of hexadecimal digits of a certain length) before signing the private key with the digital signature software.
  • a secure format that is, to convert a string of arbitrary length into a string of hexadecimal digits of a certain length
  • the most famous ones are sha-1, RIPEMD and Haval.
  • the object of the present invention is to provide a communication and encryption method and system for a low-power Bluetooth device, which realizes communication security and ensures communication security of the Bluetooth device.
  • Low-power Bluetooth device communication encryption method including:
  • the Bluetooth device and the paired device complete the communication connection for RC4 encrypted communication based on the above key information.
  • the method for generating the Bluetooth device key includes:
  • the related identifier is a Bluetooth identifier or the related identifier is a Bluetooth identifier and an international mobile device identification code.
  • step (2) the Bluetooth device and the paired device complete pairing according to the above key information, including:
  • the Bluetooth device and the paired device establish a Bluetooth layer connection
  • the Bluetooth device sends a first connection instruction carrying the key information in step (1) to the pairing device;
  • the Bluetooth device receives the first connection instruction feedback information of the paired device
  • the key information carried in the first connection instruction is used as the key information of the paired device, and the pairing of the Bluetooth device and the paired device is completed.
  • step (203) if the first connection instruction feedback information is not confirmed, (205) rejecting the communication connection between the Bluetooth device and the paired device.
  • the Bluetooth device and the paired device complete the communication connection to perform the RC4 encrypted communication based on the key information, including:
  • the (301) Bluetooth device sends the first authentication command to the pairing device;
  • the Bluetooth device receives the first authentication instruction feedback information of the paired device
  • the Bluetooth device and the paired device complete the communication.
  • the connection is for RC4 encrypted communication based on the above key information.
  • step (302) if the first authentication command feedback information is not passed, then (205) rejecting the communication connection between the Bluetooth device and the paired device.
  • the method for determining the first authentication command by the Bluetooth device communication encryption method is that the Bluetooth device and the paired device respectively perform encryption operation on the same content in the first instruction authentication command, and the operation result is consistent
  • the Bluetooth device adopts the key information of the Bluetooth device generated by the method (1), and the pairing device uses the key information of the paired device.
  • step (3) the paired device paired with the Bluetooth device is completed by using the key information in step (1), and the Bluetooth device and the paired device complete the communication connection.
  • the method for performing RC4 encrypted communication based on the above key information includes:
  • the Bluetooth device sends a second authentication command to the paired device
  • the Bluetooth device receives the second authentication instruction feedback information of the paired device
  • the Bluetooth device completes the communication connection with the paired device to perform RC4 encrypted communication based on the key information.
  • step (403) if the second authentication instruction feedback information is not passed, (405) the Bluetooth device sends a second connection instruction carrying the key information to the pairing device;
  • the Bluetooth device receives the second connection instruction feedback information of the paired device
  • step (407) the key information carried in the second connection instruction is used as key information of the paired device, and the process returns to step (402).
  • step (406) if the second connection instruction feedback information is not confirmed, the communication connection between the Bluetooth device and the paired device is rejected.
  • the method for determining whether the second authentication command passes by the Bluetooth low-power device communication encryption method is that the Bluetooth device and the pairing device respectively perform encryption operation on the same content in the second instruction authentication command, and the operation result is consistent
  • the Bluetooth device adopts the key information of the Bluetooth device generated by the method (1), and the pairing device uses the key information of the paired device.
  • the present invention also provides a low power Bluetooth device communication encryption system, including:
  • a key generation unit configured to generate a key of the Bluetooth device
  • a pairing unit configured to establish a Bluetooth layer connection between the Bluetooth device and the pairing device, and complete pairing between the Bluetooth device and the paired device according to the key generated by the key generation unit;
  • the connecting unit is configured to establish a communication connection between the Bluetooth device and the paired device to perform RC4 encrypted communication based on the key information.
  • the key generation unit includes:
  • An identifier obtaining module configured to obtain a Bluetooth identifier from the Bluetooth device; or used to obtain a Bluetooth identifier and an international mobile device identification code from the Bluetooth device;
  • a keySource generating module configured to generate a keySource according to the Bluetooth identifier or generate a keySource according to the Bluetooth identifier and the international mobile device identification code;
  • the key generation module performs MD5 operation on the keySource to generate a key.
  • the Bluetooth identifier is a MAC or a UUID.
  • the pairing unit includes:
  • the first connection instruction transceiver module is disposed on the Bluetooth device, configured to send a first connection instruction carrying the key information generated by the key generation unit to the second connection instruction transceiver module and receive the first connection from the second connection instruction transceiver module Instruction feedback information;
  • the second connection instruction transceiver module is disposed on the pairing device, configured to receive the first connection instruction from the first connection instruction transceiver module, and send the first connection instruction feedback information to the first connection instruction transceiver module according to the user selection;
  • the pairing confirmation module is configured to determine whether the first connection instruction feedback information is an acknowledgment, and if so, complete the pairing, and if not, prompt the user to reject the connection.
  • connection unit includes:
  • a first authentication command transceiver module is disposed in the Bluetooth device, configured to send a first authentication command to the second authentication command transceiver module and receive the first authentication command feedback information from the second authentication command transceiver module after the pairing is completed;
  • a second authentication command transceiver module configured to receive the first authentication command from the first authentication command transceiver module, and send the first authentication command feedback information to the first authentication command transceiver module according to the authentication result;
  • the authentication determining module is configured to determine whether the first authentication command passes. If the Bluetooth device and the pairing device complete the communication connection to perform the RC4 encrypted communication based on the key information, if not, the user is prompted to reject the connection.
  • the authentication determination module includes:
  • a first encryption operation module configured to be used by the Bluetooth device to perform encryption operation on the content in the first authentication instruction
  • a second encryption operation module configured to be used by the pairing device to perform an encryption operation on the same content in the first authentication instruction
  • the operation result comparison module compares the encryption result of the first encryption operation module with the encryption result of the second operation module, and if the two are the same, the authentication result is determined to be passed, and if the two are different, the authentication result is determined as not by.
  • the first authentication command transceiver module is further configured to complete the pairing, the Bluetooth device and the pairing device re-establish the Bluetooth layer connection, send the second authentication command to the second authentication command transceiver module, and receive the second authentication command from the second authentication command transceiver module. Feedback;
  • the second authentication command transceiver module is further configured to receive the second authentication command from the first authentication command transceiver module and send the second authentication command feedback information to the first authentication command transceiver module according to the authentication result;
  • the authentication determining module is further configured to determine whether the second authentication command is passed. If the Bluetooth device and the pairing device complete the communication connection, the RC4 encrypted communication based on the key information is performed, and if not, the first connection command sending and receiving module is sent. Request information.
  • the first connection instruction transceiver module is further configured to: after receiving the request information, send a second connection instruction to the second connection instruction transceiver module and receive the second connection instruction feedback information from the second connection instruction transceiver module;
  • connection instruction transceiver module configured to receive a second from the first connection instruction transceiver module Connecting the instruction and sending the second connection instruction feedback information to the first connection instruction transceiver module according to the user selection;
  • the pairing confirmation module is configured to determine whether the second connection instruction feedback information is an acknowledgment, and if so, complete the pairing, and if not, prompt the user to reject the connection.
  • the authentication determination module includes:
  • a first encryption operation module configured to be used by the Bluetooth device to perform encryption operation on the content in the second authentication instruction
  • a second encryption operation module configured to be used by the pairing device to perform an encryption operation on the same content in the second authentication instruction
  • the operation result comparison module compares the encryption result of the first encryption operation module with the encryption result of the second operation module, and if the two are the same, the authentication result is determined to be passed, and if the two are different, the authentication result is determined as not by.
  • the technical solution of the present invention uses the md5 code to generate a key according to the relevant identifier, and has high security;
  • a BLE low-power Bluetooth device such as a mobile terminal or a wearable device
  • the key exchange and key generation are completed by the user participating in the pairing confirmation (or confirmation at the time of connection).
  • the key is finally obtained through MD5 operation, and then all Bluetooth communication messages are protected by RC4 encryption; each connection will perform authentication of the encrypted information, so that the user can recognize the connected device.
  • the key generation can also be combined with the unique identifier of the mobile phone (IMEI) to further improve the security of the key.
  • IMEI unique identifier of the mobile phone
  • FIG. 1 is a flow chart of a communication encryption method for a low power Bluetooth device according to the present invention.
  • FIG. 2 is a structural block diagram of a communication encryption system for a low power Bluetooth device according to the present invention.
  • FIG. 3 is a flowchart of a method for generating a key according to the present invention.
  • FIG. 4 is a structural block diagram of a key generation unit according to the present invention.
  • FIG. 5 is a structural block diagram of a pairing unit according to the present invention.
  • Figure 6 is a block diagram showing the structure of the connecting unit of the present invention.
  • FIG. 7 is a structural block diagram of an authentication determination module according to the present invention.
  • FIG. 8 is a flow chart of an embodiment of a pairing connection for the first time in the communication encryption method of the Bluetooth low energy device of the present invention.
  • FIG. 9 is a flow chart of an embodiment of a paired connection of a low power Bluetooth device communication encryption method according to the present invention.
  • the present invention provides a low-power Bluetooth device communication encryption method, including: generating a key of a Bluetooth device, S1; the Bluetooth device and the pairing device complete pairing according to the key information, S2; Bluetooth device and The pairing device completes the communication connection for RC4 encrypted communication based on the above key information, S3.
  • the low-power Bluetooth device communication encryption system is as shown in FIG. 2, and includes a key generation unit, a pairing unit, and a connection unit.
  • a key generating unit configured to generate a key of the Bluetooth device
  • a pairing unit configured to: after the Bluetooth device and the pairing device establish a Bluetooth layer connection, complete the pairing between the Bluetooth device and the paired device according to the key generated by the key generating unit;
  • the unit is configured to establish a communication connection between the Bluetooth device and the paired device for performing RC4 encrypted communication based on the key information.
  • the Bluetooth device can be completed using the key information.
  • the key generation unit After the key generation unit generates the key, the key information is used to complete the pairing between the Bluetooth device and the paired device, and then the communication connection between the Bluetooth device and the paired device is implemented through the connection unit to perform encrypted communication based on the key information.
  • the key generation unit of the present invention includes: an identifier acquisition module for acquiring a Bluetooth identifier from a Bluetooth device; or for acquiring a Bluetooth identifier and an International Mobile Equipment Identity (IMEI) from a Bluetooth device; a keySource generation module And generating a keySource according to the Bluetooth identifier or generating a keySource according to the Bluetooth identifier and the international mobile device identification code; the key generation module performs MD5 operation on the keySource to generate a key.
  • IMEI International Mobile Equipment Identity
  • the identifier obtaining module includes at least a first acquiring submodule for acquiring the Bluetooth identifier, and a second acquiring submodule for acquiring the international mobile device identification code; the keySource generating module is configured to acquire the Bluetooth identifier of the first acquiring submodule and the second The international mobile device identification code obtained by the acquisition sub-module is combined into a keySource; the key generation module performs an MD5 operation on the keySource to generate a key.
  • the method for generating a key according to the key generation unit is as shown in FIG. 3, and includes:
  • the step of acquiring the relevant identifier of the Bluetooth device includes the steps of acquiring the Bluetooth identifier and obtaining the international mobile device identification code, where the two steps have no timing requirement;
  • the Bluetooth identifier is Bluetooth-based
  • the Bluetooth device is mainly a mobile phone. In actual situations, due to the different permissions of the current mainstream Android and iOS systems, for the iOS system and some Bluetooth devices that do not contain the international mobile device identification code, the international mobile device identification cannot be obtained. The case of the code. Therefore, the specific process of step S102 of generating a keySource according to the relevant identifier is:
  • the combination mode is a Bluetooth identification + an international mobile device identification code, and the technology in the field Personnel can also adopt other combinations different from this achieve. If not obtained, the Bluetooth logo is used as the keySource.
  • the pairing unit of this embodiment is shown in FIG. 5 and includes:
  • the first connection instruction transceiver module is disposed on the Bluetooth device, configured to send a connection instruction carrying the key information and receive the connection instruction feedback information;
  • the second connection instruction transceiver module is disposed on the pairing device, configured to receive the connection instruction and select according to the user Sending connection instruction feedback information;
  • the pairing confirmation module is configured to determine whether the connection instruction feedback information is an acknowledgment, and if so, complete the pairing, and if not, prompt the user to reject the connection.
  • the connecting unit of this embodiment is shown in FIG. 6 and includes:
  • a first authentication command transceiver module is disposed on the Bluetooth device, configured to send an authentication command and receive authentication command feedback information;
  • a second authentication command transceiver module is disposed on the pairing device, configured to receive an authentication command, and send the authentication command feedback information according to the authentication result;
  • the authentication determination module is configured to determine whether the authentication instruction is passed. If the Bluetooth device and the paired device complete the communication connection to perform the RC4 encrypted communication based on the key information, if not, the user is prompted to refuse to connect or send the request information to the first Connect the command transceiver module.
  • the configuration of the authentication determination module of this embodiment is as shown in FIG. 7 , and includes: a first encryption operation module, configured to be used in the Bluetooth device to perform encryption operation on the content in the authentication instruction; and a second encryption operation module,
  • the pairing device is configured to perform an encryption operation on the same content in the authentication instruction;
  • the operation result comparison module compares the encryption result of the encryption operation module with the encryption result of the operation module. If the two are the same, the authentication result is determined to be passed, and if the two are different, the authentication result is determined to be not passed.
  • the operation result comparison module can be set in the Bluetooth device, and the encryption result of the second encryption operation module is transmitted to the Bluetooth device along with the authentication instruction feedback information, thereby being acquired by the operation result comparison module.
  • the Bluetooth device and the paired device complete pairing according to the key information, S2; the specific steps are:
  • the Bluetooth device and the paired device establish a Bluetooth layer connection, S201;
  • the Bluetooth device sends a first connection instruction carrying the key information in step S1 to the pairing device, S202;
  • the Bluetooth device receives the first connection instruction feedback information of the paired device, S203;
  • the key information carried in the first connection instruction is used as the key information of the paired device, and S204, the pairing between the Bluetooth device and the paired device is completed.
  • the communication connection between the Bluetooth device and the paired device is rejected, S205.
  • the Bluetooth device and the paired device complete the communication connection for performing RC4 encrypted communication based on the above key information, S3; the specific steps are as follows:
  • the Bluetooth device After the pairing of step S204 is completed, the Bluetooth device sends a first authentication command to the pairing device, S301;
  • the Bluetooth device receives the first authentication instruction feedback information of the paired device, S302;
  • the Bluetooth device completes a communication connection with the paired device to perform RC4 encrypted communication based on the key information, S303;
  • the communication connection between the Bluetooth device and the paired device is rejected, S205.
  • the method for determining whether the first authentication instruction is passed is that the Bluetooth device and the pairing device perform an encryption operation on the same content in the first instruction authentication instruction, and the operation result is consistent; in the encryption operation, the Bluetooth device adopts Key information of the Bluetooth device generated by the method of step S1, The pairing device uses the key information of the paired device.
  • the first connection instruction transceiver module is configured to send a first connection instruction that carries the key information generated by the key generation unit to the second connection instruction transceiver module and receive the first connection instruction feedback information from the second connection instruction transceiver module;
  • a second connection instruction transceiver module configured to receive a first connection instruction from the first connection instruction transceiver module and send the first connection instruction feedback information to the first connection instruction transceiver module according to the user selection;
  • the pairing confirmation module is configured to determine whether the first connection instruction feedback information is an acknowledgment, and if so, complete the pairing, and if not, prompt the user to reject the connection.
  • a first authentication command transceiver module configured to send the first authentication command to the second authentication command transceiver module after receiving the pairing, and receive the first authentication command feedback information from the second authentication command transceiver module;
  • a second authentication command transceiver module configured to receive a first authentication command from the first authentication command transceiver module, and send the first authentication command feedback information to the first authentication command transceiver module according to the authentication result;
  • the authentication determining module is configured to determine whether the first authentication command passes. If the Bluetooth device and the pairing device complete the communication connection to perform the RC4 encrypted communication based on the key information, if not, the user is prompted to reject the connection.
  • the first encryption operation module is disposed on the Bluetooth device, and performs encryption operation on the content in the first authentication instruction;
  • a second encryption operation module is disposed on the pairing device to perform an encryption operation on the same content in the first authentication instruction
  • the operation result comparison module compares the encryption result of the first encryption operation module with the encryption result of the second operation module, and if the two are the same, the authentication result is determined to be passed, and if the two are different, the authentication result is determined as not by.
  • the above technical solution can successfully complete the first encrypted communication connection between the Bluetooth device and the paired device, realize the communication encryption in the form of RC4, and the speed of the RC4 algorithm can reach about 10 times of the DES encryption, and has a high level of nonlinearity, which makes the limitation.
  • the hardware computing capability obtains high-level encryption; at the same time, it provides a secure and feasible encryption communication mechanism for BLE Bluetooth devices such as wearable devices, which makes up for the shortcomings of the current Bluetooth baseband layer general encryption.
  • step S203 if the first connection instruction feedback information is not confirmed, the communication connection between the Bluetooth device and the paired device is rejected. If the first authentication instruction feedback information is not passed, the communication connection between the Bluetooth device and the paired device is rejected.
  • the confirmation connection instruction provides the user of the paired device with a selection space that fully satisfies the user's needs during the connection process. The pass or fail of the authentication command ensures that the Bluetooth device and the paired device use the same set of key information for encryption, thereby achieving the integrity and reliability of the encrypted communication.
  • the present invention also provides another low-power Bluetooth device encrypted communication connection scheme, which is completed with the key information in step S1 and the Bluetooth device. Paired pairing device, because the Bluetooth device and the paired device have used the key information to complete the pairing. If the key information is correct, the connection can be directly performed, which saves time flow.
  • the specific method is shown in Figure 9:
  • Bluetooth device and paired device establish Bluetooth layer connection, S401;
  • the Bluetooth device sends a second authentication command to the pairing device, S402;
  • the Bluetooth device receives the second authentication instruction feedback information of the paired device, S403;
  • the Bluetooth device completes the communication connection with the paired device.
  • RC4 encrypted communication based on key information S404.
  • the Bluetooth device and the paired device are disconnected and then connected again, the encryption key may be changed.
  • the Bluetooth device sends the key information. a second connection instruction to the pairing device, S405;
  • the Bluetooth device receives the second connection instruction feedback information of the paired device, S406;
  • the second connection instruction feedback information is the confirmation
  • the key information carried in the second connection instruction is used as the key information of the paired device, and the process returns to step S402 to resend the second authentication command.
  • the communication connection between the Bluetooth device and the paired device is rejected, S205.
  • the method for determining whether the second authentication command is passed is that the Bluetooth device and the pairing device respectively perform encryption operations on the same content in the second instruction authentication command, and the operation result is consistent;
  • the Bluetooth device adopts key information of the Bluetooth device generated by the method of step S1, and the pairing device uses key information of the paired device.
  • a first authentication command transceiver module the Bluetooth device and the pairing device respectively establish a Bluetooth layer connection, and then send a second authentication command to the second authentication command transceiver module and receive the second authentication command feedback information from the second authentication command transceiver module;
  • the second authentication command transceiver module receives the second authentication command from the first authentication command transceiver module and sends the second authentication command feedback information to the first authentication command transceiver module according to the authentication result;
  • the authentication determination module determines whether the second authentication command passes. If yes, the Bluetooth device completes the communication connection with the paired device to perform RC4 encrypted communication based on the key information, and if not, sends the request information to the first connection command transceiver module.
  • connection instruction transceiver module after receiving the request information, sending a second connection instruction to a second connection instruction transceiver module and a second connection instruction feedback information received from the second connection instruction transceiver module;
  • the second connection instruction transceiver module receives the second connection instruction from the first connection instruction transceiver module and sends the second connection instruction feedback information to the first connection instruction transceiver module according to the user selection;
  • the pairing confirmation module determines whether the second connection instruction feedback information is an acknowledgment, and if so, completes the pairing, and if not, prompts the user to reject the connection.
  • the first encryption operation module is disposed on the Bluetooth device, and performs encryption operation on the content in the second authentication instruction;
  • a second encryption operation module configured to be paired to perform the encryption operation on the same content in the second authentication instruction
  • the operation result comparison module compares the encryption result of the first encryption operation module with the encryption result of the second operation module, and if the two are the same, the authentication result is determined to be passed, and if the two are different, the authentication result is determined as not by.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Power Engineering (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种低功耗蓝牙设备通讯加密方法和***,方法包括:生成蓝牙设备的密钥;蓝牙设备和配对设备根据上述密钥信息完成配对;蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯。***包括:密钥生成单元,用于生成蓝牙设备的密钥;配对单元,用于蓝牙设备和配对设备建立蓝牙层连接后根据密钥生成单元生成的密钥完成蓝牙设备与配对设备之间的配对;连接单元,用于蓝牙设备与配对设备之间的通讯连接以进行基于上述密钥信息的RC4加密通讯。采用本发明的密钥使用RC4加密方式保护所有的蓝牙通讯报文;每次连接会进行加密信息的认证工作,使用户认可连接的设备能够安全的进行蓝牙通讯。

Description

低功耗蓝牙设备通讯加密方法及*** 技术领域
本发明涉及蓝牙通讯加密技术,具体涉及一种低功耗蓝牙设备通讯加密方法及***。
背景技术
低功耗蓝牙设备(BLE)可实现超低的峰值、均衡和空闲模式的功耗,通信距离长达100米左右,设备占空比低可节省更多电能,使用纽扣电池甚至可以运行多年。
目前低功耗蓝牙设备的应用范围越来越广,涉及医疗,智能穿戴等领域,在物联网生态***中也将扮演重要的角色。同时,iOS、安卓、Windows 10、Linux等主流操作***均开始原生支持BLE低功耗蓝牙。
目前蓝牙通讯的安全性主要依赖基带层的E0算法,受制于线性反馈移位寄存器(LFSR)资源能力有限,安全性相对来说比较弱。对于安全性要求较高的场景(如支付),需要有更高的安全通讯机制来保证蓝牙通讯的安全。
RC4加密算法是大名鼎鼎的RSA三人组中的头号人物Ronald Rivest在1987年设计的密钥长度可变的流加密算法簇。之所以称其为簇,是由于其核心部分的S-box长度可为任意,但一般为256字节。该算法的速度可以达到DES加密的10倍左右,且具有很高级别的非线性。
MD5即Message-Digest Algorithm 5(信息-摘要算法5),用于确保信息传输完整一致,是计算机广泛使用的杂凑算法之一(又译摘要算法、哈希算法),主流编程语言普遍已有MD5实现。将数据(如汉字)运算为另一固定长度值,是杂凑算法的基础原理,MD5的前身有MD2、MD3和MD4。
MD5算法具有以下特点:
1、压缩性:任意长度的数据,算出的MD5值长度都是固定的。
2、容易计算:从原数据计算出MD5值很容易。
3、抗修改性:对原数据进行任何改动,哪怕只修改1个字节,所得到的MD5值都有很大区别。
4、强抗碰撞:已知原数据和其MD5值,想找到一个具有相同MD5值的数据(即伪造数据)是非常困难的。
MD5的作用是让大容量信息在用数字签名软件签署私人密钥前被"压缩"成一种保密的格式(就是把一个任意长度的字节串变换成一定长的十六进制数字串)。除了MD5以外,其中比较有名的还有sha-1、RIPEMD以及Haval等。
发明内容
针对现有技术中所存在的问题,本发明的目的在于提供一种低功耗蓝牙设备通讯加密方法及***,实现通讯安全性,保证蓝牙设备通讯的安全。
为达到上述发明目的,本发明的技术方案如下:
低功耗蓝牙设备通讯加密方法,包括:
(1)生成蓝牙设备的密钥;
(2)蓝牙设备和配对设备根据上述密钥信息完成配对;
(3)蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(1)中,生成蓝牙设备密钥的方法包括:
(101)获取蓝牙设备的相关标识;
(102)根据相关标识生成keySource,
(103)对keySource进行MD5运算生成密钥;
所述相关标识为蓝牙标识或者所述相关标识为蓝牙标识和国际移动设备辨识码。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(2)中,蓝牙设备和配对设备根据上述密钥信息完成配对,包括:
(201)蓝牙设备和配对设备建立蓝牙层连接;
(202)蓝牙设备发送携带步骤(1)中密钥信息的第一连接指令给配对设备;
(203)蓝牙设备接收配对设备的第一连接指令反馈信息;
若第一连接指令反馈信息为确认,则(204)第一连接指令中携带的密钥信息作为配对设备的密钥信息,完成蓝牙设备与配对设备的配对。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(203)中,若第一连接指令反馈信息不为确认,则(205)拒绝所述蓝牙设备与配对设备之间通讯连接。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(3)中,蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯的方法包括:
步骤(204)的配对完成后,(301)蓝牙设备发送第一认证指令给配对设备;
(302)蓝牙设备接收配对设备的第一认证指令反馈信息;
若第一认证指令反馈信息为通过,则(303)蓝牙设备与配对设备完成通 讯连接以进行基于上述密钥信息的RC4加密通讯。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(302)中,若第一认证指令反馈信息为不通过,则(205)拒绝所述蓝牙设备与配对设备之间通讯连接。
进一步地,上述低功耗蓝牙设备通讯加密方法,判断所述第一认证指令是否通过的方法为,蓝牙设备和配对设备分别对第一指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤(1)方法生成的本蓝牙设备的密钥信息,所述配对设备采用配对设备的密钥信息。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(3)中,对于采用步骤(1)中密钥信息完成过与所述蓝牙设备配对的配对设备,蓝牙设备和该配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯的方法包括:
(401)蓝牙设备和配对设备建立蓝牙层连接;
(402)蓝牙设备发送第二认证指令给配对设备;
(403)蓝牙设备接收配对设备的第二认证指令反馈信息;
若第二认证指令反馈信息为通过,则(404)蓝牙设备与配对设备完成通讯连接以进行基于密钥信息的RC4加密通讯。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(403)中,若第二认证指令反馈信息为不通过,则(405)蓝牙设备发送携带密钥信息的第二连接指令给配对设备;
(406)蓝牙设备接收配对设备的第二连接指令反馈信息;
若第二连接指令反馈信息为确认,则(407)将第二连接指令中携带的密钥信息作为配对设备的密钥信息,返回步骤(402)。
进一步地,上述低功耗蓝牙设备通讯加密方法,步骤(406)中,若第二连接指令反馈信息不为确认,则拒绝所述蓝牙设备与配对设备之间通讯连接。
进一步地,上述低功耗蓝牙设备通讯加密方法,判断所述第二认证指令是否通过的方法为,蓝牙设备和配对设备分别对第二指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤(1)方法生成的本蓝牙设备的密钥信息,所述配对设备采用配对设备的密钥信息。
相应地,本发明还提供了低功耗蓝牙设备通讯加密***,包括:
密钥生成单元,用于生成蓝牙设备的密钥;
配对单元,用于蓝牙设备和配对设备建立蓝牙层连接后根据密钥生成单元生成的密钥完成蓝牙设备与配对设备之间的配对;
连接单元,用于建立蓝牙设备与配对设备之间的通讯连接以进行基于上述密钥信息的RC4加密通讯。
进一步地,上述低功耗蓝牙设备通讯加密***,所述密钥生成单元包括:
标识获取模块,用于从蓝牙设备获取蓝牙标识;或者用于从蓝牙设备获取蓝牙标识和国际移动设备辨识码;
keySource生成模块,用于根据蓝牙标识生成keySource或根据蓝牙标识和国际移动设备辨识码生成keySource;
密钥生成模块,对keySource进行MD5运算生成密钥。
进一步地,上述低功耗蓝牙设备通讯加密***,所述蓝牙标识为MAC或UUID。
进一步地,上述低功耗蓝牙设备通讯加密***,所述配对单元包括:
第一连接指令收发模块,设置于蓝牙设备,用于发送携带密钥生成单元所生成密钥信息的第一连接指令给第二连接指令收发模块和接收来自第二连接指令收发模块的第一连接指令反馈信息;
第二连接指令收发模块,设置于配对设备,用于接收来自第一连接指令收发模块的第一连接指令和根据用户选择发送第一连接指令反馈信息给第一连接指令收发模块;
配对确认模块,用于判断第一连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
进一步地,上述低功耗蓝牙设备通讯加密***,所述连接单元包括:
第一认证指令收发模块,设置于所述蓝牙设备,用于完成配对后发送第一认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第一认证指令反馈信息;
第二认证指令收发模块,设置于所述配对设备,用于接收来自第一认证指令收发模块的第一认证指令和根据认证结果发送第一认证指令反馈信息给第一认证指令收发模块;
认证判定模块,用于判定第一认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则提示用户拒绝连接。
进一步地,上述低功耗蓝牙设备通讯加密***,所述认证判定模块包括:
第一加密运算模块,设置于所述蓝牙设备,用于对第一认证指令中的内容进行加密运算;
第二加密运算模块,设置于所述配对设备,用于对第一认证指令中的相同内容进行加密运算;
运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
进一步地,上述低功耗蓝牙设备通讯加密***,
第一认证指令收发模块,还用于完成配对、蓝牙设备和配对设备再次建立蓝牙层连接后发送第二认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第二认证指令反馈信息;
第二认证指令收发模块,还用于接收来自第一认证指令收发模块的第二认证指令和根据认证结果发送第二认证指令反馈信息给第一认证指令收发模块;
认证判定模块,还用于判定第二认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则给第一连接指令收发模块发送请求信息。
进一步地,上述低功耗蓝牙设备通讯加密***,
第一连接指令收发模块,还用于接收所述请求信息后,发送第二连接指令给第二连接指令收发模块和接收来自第二连接指令收发模块的第二连接指令反馈信息;
第二连接指令收发模块,还用于接收来自第一连接指令收发模块的第二 连接指令和根据用户选择发送第二连接指令反馈信息给第一连接指令收发模块;
配对确认模块,用于判断第二连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
进一步地,上述低功耗蓝牙设备通讯加密***,所述认证判定模块包括:
第一加密运算模块,设置于所述蓝牙设备,用于对第二认证指令中的内容进行加密运算;
第二加密运算模块,设置于所述配对设备,用于对第二认证指令中的相同内容进行加密运算;
运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
本发明具有以下有益效果:
1、本发明的技术方案采用md5码根据相关标识生成密钥,安全性高;
2、基于手机终端、可穿戴设备等BLE低功耗蓝牙设备,采用上述密钥进行加密通讯的连接时,通过用户参与配对确认(或连接时确认)的过程完成密钥的交换,密钥生成依赖于手机终端的蓝牙标识(MAC或UUID)通过MD5运算最终得到密钥,而后使用RC4加密方式保护所有的蓝牙通讯报文;每次连接会进行加密信息的认证工作,使用户认可连接的设备能够安全的进行蓝牙通讯;
3、权限许可的前提下,密钥的生成还可以配合手机的唯一标识(IMEI),进一步提高密钥的安全性。
附图说明
图1为本发明低功耗蓝牙设备通讯加密方法的流程框图。
图2为本发明低功耗蓝牙设备通讯加密***的结构框图。
图3为本发明密钥生成方法的流程图。
图4为本发明密钥生成单元的结构框图。
图5为本发明配对单元的结构框图。
图6为本发明连接单元的结构框图。
图7为本发明认证判定模块的结构框图。
图8为本发明低功耗蓝牙设备通讯加密方法首次进行配对连接的一个实施例的流程图。
图9为本发明低功耗蓝牙设备通讯加密方法再次进行配对连接的一个实施例的流程图。
具体实施方式
下面结合附图和实施例对本发明进行详细的描述。
如图1所示,本发明提供了一种低功耗蓝牙设备通讯加密方法,包括:生成蓝牙设备的密钥,S1;蓝牙设备和配对设备根据上述密钥信息完成配对,S2;蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,S3。
对应的,本发明提供的低功耗蓝牙设备通讯加密***如图2所示,包括密钥生成单元、配对单元和连接单元。密钥生成单元,用于生成蓝牙设备的密钥;配对单元,用于蓝牙设备和配对设备建立蓝牙层连接后根据密钥生成单元生成的密钥完成蓝牙设备与配对设备之间的配对;连接单元,用于建立蓝牙设备与配对设备之间通讯连接以进行基于上述密钥信息的RC4加密通讯。通过上述技术方案,能够利用密钥信息完成蓝牙设备。配对单元在所述 密钥生成单元生成密钥后利用该密钥信息完成蓝牙设备与配对设备的配对,而后通过连接单元实现蓝牙设备与配对设备的通讯连接,以进行基于上述密钥信息的加密通讯。
本发明的密钥生成单元如图4所示,包括:标识获取模块,用于从蓝牙设备获取蓝牙标识;或者用于从蓝牙设备获取蓝牙标识和国际移动设备辨识码(IMEI);keySource生成模块,用于根据蓝牙标识生成keySource或根据蓝牙标识和国际移动设备辨识码生成keySource;密钥生成模块,对keySource进行MD5运算生成密钥。标识获取模块至少包括用于获取蓝牙标识的第一获取子模块,还可以包括用于获取国际移动设备辨识码的第二获取子模块;keySource生成模块将第一获取子模块的蓝牙标识和第二获取子模块获取到的国际移动设备辨识码组合成keySource;密钥生成模块对所述keySource进行MD5运算生成密钥。
根据密钥生成单元生密钥的方法如图3所示,包括:
获取蓝牙设备的相关标识,S101;在本实施例中,获取蓝牙设备的相关标识步骤包括获取蓝牙标识和获取国际移动设备辨识码的步骤,这两个步骤无时序性要求;蓝牙标识为基于蓝牙芯片的MAC或UUID,由于蓝牙设备必定使用蓝牙芯片,则所述蓝牙标识一定能够被获取。现阶段蓝牙设备主要为手机,在实际情况中,由于目前主流***Android和ios***的权限不同,对于ios***和一些不包含国际移动设备辨识码的蓝牙设备,会出现无法获取到国际移动设备辨识码的情况。因此,根据相关标识生成keySource的步骤S102具体流程为:
判断是否获取到国际移动设备辨识码,若获取到,则将蓝牙标识和国际移动设备辨识码组合成为keySource;在本实施例中,该组合方式为蓝牙标识+国际移动设备辨识码,本领域技术人员也可采用其他不同于此的组合方式 实现。若未获取到,则将蓝牙标识作为keySource。
对keySource进行MD5运算生成的最终密钥,S103。
本具体实施方式的配对单元如图5所示,包括:
第一连接指令收发模块,设置于蓝牙设备,用于发送携带密钥信息的连接指令和接收连接指令反馈信息;第二连接指令收发模块,设置于配对设备,用于接收连接指令和根据用户选择发送连接指令反馈信息;配对确认模块,用于判断连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
本具体实施方式的连接单元如图6所示,包括:
第一认证指令收发模块,设置于所述蓝牙设备,用于发送认证指令和接收认证指令反馈信息;
第二认证指令收发模块,设置于所述配对设备,用于接收认证指令和根据认证结果发送认证指令反馈信息;
认证判定模块,用于判定认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则提示用户拒绝连接或发送请求信息给第一连接指令收发模块。
本具体实施方式的认证判定模块的结构如图7所示,包括:第一加密运算模块,设置于所述蓝牙设备,用于对认证指令中的内容进行加密运算;第二加密运算模块,设置于所述配对设备,用于对认证指令中的相同内容进行加密运算;
运算结果比对模块,用于加密运算模块的加密结果和运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。该运算结果比对模块可设置于蓝牙设备,第二加密运算模块的加密结果随认证指令反馈信息传递至蓝牙设备,从而被运算结果比对模块获取。
实施例1
在取得密钥的基础上,蓝牙设备与配对设备进行初次配对而后进行通讯连接的流程如图8所示。
蓝牙设备和配对设备根据密钥信息完成配对,S2;具体步骤为:
蓝牙设备和配对设备建立蓝牙层连接,S201;
蓝牙设备发送携带步骤S1中密钥信息的第一连接指令给配对设备,S202;
蓝牙设备接收配对设备的第一连接指令反馈信息,S203;
若第一连接指令反馈信息为确认,则第一连接指令中携带的密钥信息作为配对设备的密钥信息,S204,完成蓝牙设备与配对设备的配对。
若第一连接指令反馈信息不为确认,则拒绝所述蓝牙设备与配对设备之间通讯连接,S205。
蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,S3;具体步骤如下:
步骤S204的配对完成后,蓝牙设备发送第一认证指令给配对设备,S301;
蓝牙设备接收配对设备的第一认证指令反馈信息,S302;
若第一认证指令反馈信息为通过,则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,S303;
若第一认证指令反馈信息为不通过,则拒绝所述蓝牙设备与配对设备之间通讯连接,S205。
判断所述第一认证指令是否通过的方法为,蓝牙设备和配对设备分别对第一指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤S1方法生成的本蓝牙设备的密钥信息,所 述配对设备采用配对设备的密钥信息。
采用本实施例的方法时,相应的***各个模块作用如下:
配对单元:
第一连接指令收发模块,用于发送携带密钥生成单元所生成密钥信息的第一连接指令给第二连接指令收发模块和接收来自第二连接指令收发模块的第一连接指令反馈信息;
第二连接指令收发模块,用于接收来自第一连接指令收发模块的第一连接指令和根据用户选择发送第一连接指令反馈信息给第一连接指令收发模块;
配对确认模块,用于判断第一连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
连接单元:
第一认证指令收发模块,用于完成配对后发送第一认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第一认证指令反馈信息;
第二认证指令收发模块,用于接收来自第一认证指令收发模块的第一认证指令和根据认证结果发送第一认证指令反馈信息给第一认证指令收发模块;
认证判定模块,用于判定第一认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则提示用户拒绝连接。
认证判定模块:
第一加密运算模块,设置于蓝牙设备,对第一认证指令中的内容进行加密运算;
第二加密运算模块,设置于配对设备,对第一认证指令中的相同内容进行加密运算;
运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
上述技术方案,能够顺利完成蓝牙设备与配对设备的初次加密通讯连接,实现RC4形式的通讯加密,采用RC4算法的速度可以达到DES加密的10倍左右,且具有很高级别的非线性,使有限的硬件计算能力获得高级别的加密;同时为穿戴设备等BLE蓝牙设备提供一个安全可行的加密通讯机制,弥补目前蓝牙基带层通用加密的不足。
在上述步骤S203中,若第一连接指令反馈信息不为确认,则拒绝所述蓝牙设备与配对设备之间通讯连接。若第一认证指令反馈信息为不通过,则拒绝所述蓝牙设备与配对设备之间通讯连接。确认连接指令给配对设备的用户提供了选择空间,在连接过程中充分满足用户需求。而认证指令通过与否能够确保蓝牙设备与配对设备采用同一套密钥信息进行加密,实现加密通讯的完整性和可靠性。
实施例2
为了在保证通讯安全性的前提下使得连接更加快捷方便,本发明还提供了另外一种低功耗蓝牙设备加密通讯连接方案,此方案针对采用步骤S1中密钥信息完成过与所述蓝牙设备配对的配对设备,由于该蓝牙设备与配对设备曾经采用过密钥信息完成过配对,若密钥信息无误,则直接进行连接即可,节约时间流程,具体方法如图9所示:
蓝牙设备和配对设备建立蓝牙层连接,S401;
蓝牙设备发送第二认证指令给配对设备,S402;
蓝牙设备接收配对设备的第二认证指令反馈信息,S403;
若第二认证指令反馈信息为通过,则蓝牙设备与配对设备完成通讯连接 以进行基于密钥信息的RC4加密通讯,S404。
当然,由于蓝牙设备和配对设备存在配对后断开而后再次连接的情况,加密密钥可能发生改变,在此情况下,第二认证指令反馈信息为不通过,则蓝牙设备发送携带密钥信息的第二连接指令给配对设备,S405;
蓝牙设备接收配对设备的第二连接指令反馈信息,S406;
若第二连接指令反馈信息为确认,则将第二连接指令中携带的密钥信息作为配对设备的密钥信息,返回步骤S402进行再次发送第二认证指令。
若第二连接指令反馈信息不为确认,则拒绝所述蓝牙设备与配对设备之间通讯连接,S205。
本实施例中,判断所述第二认证指令是否通过的方法为,蓝牙设备和配对设备分别对第二指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤S1方法生成的本蓝牙设备的密钥信息,所述配对设备采用配对设备的密钥信息。
采用本实施例的方法时,相应的***各个模块作用如下:
连接单元:
第一认证指令收发模块,蓝牙设备和配对设备再次建立蓝牙层连接后发送第二认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第二认证指令反馈信息;
第二认证指令收发模块,接收来自第一认证指令收发模块的第二认证指令和根据认证结果发送第二认证指令反馈信息给第一认证指令收发模块;
认证判定模块,判定第二认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则给第一连接指令收发模块发送请求信息。
配对单元:
第一连接指令收发模块,接收到所述请求信息后,发送第二连接指令给 第二连接指令收发模块和接收来自第二连接指令收发模块的第二连接指令反馈信息;
第二连接指令收发模块,接收来自第一连接指令收发模块的第二连接指令和根据用户选择发送第二连接指令反馈信息给第一连接指令收发模块;
配对确认模块,判断第二连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
认证判定模块:
第一加密运算模块,设置于蓝牙设备,对第二认证指令中的内容进行加密运算;
第二加密运算模块,设置于配对设备,对第二认证指令中的相同内容进行加密运算;
运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若对本发明的这些修改和变型属于本发明权利要求及其同等技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (20)

  1. 低功耗蓝牙设备通讯加密方法,包括:
    (1)生成蓝牙设备的密钥,
    (2)蓝牙设备和配对设备根据上述密钥信息完成配对;
    (3)蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯。
  2. 如权利要求1所述的低功耗蓝牙设备通讯加密方法,其特征在于,
    步骤(1)中,生成蓝牙设备密钥的方法包括:
    (101)获取蓝牙设备的相关标识;
    (102)根据相关标识生成keySource,
    (103)对keySource进行MD5运算生成密钥;
    所述相关标识为蓝牙标识或者所述相关标识为蓝牙标识和国际移动设备辨识码。
  3. 如权利要求1所述的低功耗蓝牙设备通讯加密方法,其特征在于,
    步骤(2)中,蓝牙设备和配对设备根据上述密钥信息完成配对,包括:
    (201)蓝牙设备和配对设备建立蓝牙层连接;
    (202)蓝牙设备发送携带步骤(1)中密钥信息的第一连接指令给配对设备;
    (203)蓝牙设备接收配对设备的第一连接指令反馈信息;
    若第一连接指令反馈信息为确认,则(204)第一连接指令中携带的密钥信息作为配对设备的密钥信息,完成蓝牙设备与配对设备的配对。
  4. 如权利要求3所述的低功耗蓝牙设备通讯加密方法,其特征在于, 步骤(203)中,若第一连接指令反馈信息不为确认,则(205)拒绝所述蓝牙设备与配对设备之间通讯连接。
  5. 如权利要求1所述的低功耗蓝牙设备通讯加密方法,其特征在于,
    步骤(3)中,蓝牙设备和配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯的方法包括:
    步骤(204)的配对完成后,(301)蓝牙设备发送第一认证指令给配对设备;
    (302)蓝牙设备接收配对设备的第一认证指令反馈信息;
    若第一认证指令反馈信息为通过,则(303)蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯。
  6. 如权利要求5所述的低功耗蓝牙设备通讯加密方法,其特征在于,步骤(302)中,若第一认证指令反馈信息为不通过,则(205)拒绝所述蓝牙设备与配对设备之间通讯连接。
  7. 如权利要求5所述的低功耗蓝牙设备通讯加密方法,其特征在于,判断所述第一认证指令是否通过的方法为,蓝牙设备和配对设备分别对第一指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤(1)方法生成的本蓝牙设备的密钥信息,所述配对设备采用配对设备的密钥信息。
  8. 如权利要求3所述的低功耗蓝牙设备通讯加密方法,其特征在于,步骤(3)中,对于采用步骤(1)中密钥信息完成过与所述蓝牙设备配对的配对设备,蓝牙设备和该配对设备完成通讯连接以进行基于上述密钥信息的 RC4加密通讯的方法包括:
    (401)蓝牙设备和配对设备建立蓝牙层连接;
    (402)蓝牙设备发送第二认证指令给配对设备;
    (403)蓝牙设备接收配对设备的第二认证指令反馈信息;
    若第二认证指令反馈信息为通过,则(404)蓝牙设备与配对设备完成通讯连接以进行基于密钥信息的RC4加密通讯。
  9. 如权利要求8所述的低功耗蓝牙设备加密通讯的连接方法,其特征在于,步骤(403)中,若第二认证指令反馈信息为不通过,则(405)蓝牙设备发送携带密钥信息的第二连接指令给配对设备;
    (406)蓝牙设备接收配对设备的第二连接指令反馈信息;
    若第二连接指令反馈信息为确认,则(407)将第二连接指令中携带的密钥信息作为配对设备的密钥信息,返回步骤(402)。
  10. 如权利要求9所述的低功耗蓝牙设备加密通讯的连接方法,其特征在于,步骤(406)中,若第二连接指令反馈信息不为确认,则拒绝所述蓝牙设备与配对设备之间通讯连接。
  11. 如权利要求8-10任一所述的低功耗蓝牙设备加密通讯的连接方法,其特征在于,判断所述第二认证指令是否通过的方法为,蓝牙设备和配对设备分别对第二指令认证指令中的相同内容做加密运算,运算结果一致即为通过;该加密运算中,所述蓝牙设备采用步骤(1)方法生成的本蓝牙设备的密钥信息,所述配对设备采用配对设备的密钥信息。
  12. 低功耗蓝牙设备通讯加密***,其特征在于,包括:
    密钥生成单元,用于生成蓝牙设备的密钥;
    配对单元,用于蓝牙设备和配对设备建立蓝牙层连接后根据密钥生成单元生成的密钥完成蓝牙设备与配对设备之间的配对;
    连接单元,用于建立蓝牙设备与配对设备之间的通讯连接以进行基于上述密钥信息的RC4加密通讯。
  13. 如权利要求12所述的低功耗蓝牙设备通讯加密***,其特征在于,所述密钥生成单元包括:
    标识获取模块,用于从蓝牙设备获取蓝牙标识;或者用于从蓝牙设备获取蓝牙标识和国际移动设备辨识码;
    keySource生成模块,用于根据蓝牙标识生成keySource或根据蓝牙标识和国际移动设备辨识码生成keySource;
    密钥生成模块,对keySource进行MD5运算生成密钥。
  14. 如权利要求13所述的低功耗蓝牙设备通讯加密***,其特征在于,所述蓝牙标识为MAC或UUID。
  15. 如权利要求12所述的低功耗蓝牙设备通讯加密***,其特征在于,所述配对单元包括:
    第一连接指令收发模块,设置于蓝牙设备,用于发送携带密钥生成单元所生成密钥信息的第一连接指令给第二连接指令收发模块和接收来自第二连接指令收发模块的第一连接指令反馈信息;
    第二连接指令收发模块,设置于配对设备,用于接收来自第一连接指令收发模块的第一连接指令和根据用户选择发送第一连接指令反馈信息给第一连接指令收发模块;
    配对确认模块,用于判断第一连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
  16. 如权利要求15所述的低功耗蓝牙设备通讯加密***,其特征在于,所述连接单元包括:
    第一认证指令收发模块,设置于所述蓝牙设备,用于完成配对后发送第一认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第一认证指令反馈信息;
    第二认证指令收发模块,设置于所述配对设备,用于接收来自第一认证指令收发模块的第一认证指令和根据认证结果发送第一认证指令反馈信息给第一认证指令收发模块;
    认证判定模块,用于判定第一认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则提示用户拒绝连接。
  17. 如权利要求16所述的低功耗蓝牙设备通讯加密***,其特征在于,所述认证判定模块包括:
    第一加密运算模块,设置于所述蓝牙设备,用于对第一认证指令中的内容进行加密运算;
    第二加密运算模块,设置于所述配对设备,用于对第一认证指令中的相同内容进行加密运算;
    运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
  18. 如权利要求16所述的低功耗蓝牙设备通讯加密***,其特征在于,
    第一认证指令收发模块,还用于完成配对且蓝牙设备和配对设备再次建立蓝牙层连接后发送第二认证指令给第二认证指令收发模块和接收来自第二认证指令收发模块的第二认证指令反馈信息;
    第二认证指令收发模块,还用于接收来自第一认证指令收发模块的第二认证指令和根据认证结果发送第二认证指令反馈信息给第一认证指令收发模块;
    认证判定模块,还用于判定第二认证指令是否通过,若通过则蓝牙设备与配对设备完成通讯连接以进行基于上述密钥信息的RC4加密通讯,若否,则给第一连接指令收发模块发送请求信息。
  19. 如权利要求18所述的低功耗蓝牙设备通讯加密***,其特征在于,
    第一连接指令收发模块,还用于接收到所述请求信息后,发送第二连接指令给第二连接指令收发模块和接收来自第二连接指令收发模块的第二连接指令反馈信息;
    第二连接指令收发模块,还用于接收来自第一连接指令收发模块的第二连接指令和根据用户选择发送第二连接指令反馈信息给第一连接指令收发模块;
    配对确认模块,用于判断第二连接指令反馈信息是否为确认,若是,则完成配对,若否,则提示用户拒绝连接。
  20. 如权利要求18所述的低功耗蓝牙设备通讯加密***,其特征在于,所述认证判定模块包括:
    第一加密运算模块,设置于所述蓝牙设备,用于对第二认证指令中的内容进行加密运算;
    第二加密运算模块,设置于所述配对设备,用于对第二认证指令中的相同内容进行加密运算;
    运算结果比对模块,用于第一加密运算模块的加密结果和第二运算模块的加密结果进行比对,若二者相同,则判定认证结果为通过,若二者不同则判定认证结果为不通过。
PCT/CN2017/099427 2016-12-28 2017-08-29 低功耗蓝牙设备通讯加密方法及*** WO2018120883A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611236664.3A CN106788977A (zh) 2016-12-28 2016-12-28 低功耗蓝牙设备通讯加密方法及***
CN201611236664.3 2016-12-28

Publications (1)

Publication Number Publication Date
WO2018120883A1 true WO2018120883A1 (zh) 2018-07-05

Family

ID=58925215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099427 WO2018120883A1 (zh) 2016-12-28 2017-08-29 低功耗蓝牙设备通讯加密方法及***

Country Status (2)

Country Link
CN (1) CN106788977A (zh)
WO (1) WO2018120883A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111200807A (zh) * 2019-12-30 2020-05-26 上海博泰悦臻网络技术服务有限公司 一种基于蓝牙的信息交互方法及其装置
WO2022156348A1 (zh) * 2021-01-20 2022-07-28 青岛海尔空调器有限总公司 空调器的控制方法、终端设备、空调器控制***
CN115379590A (zh) * 2022-10-27 2022-11-22 深圳市正浩创新科技股份有限公司 蓝牙连接建立方法、装置、电子设备及计算机存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106788977A (zh) * 2016-12-28 2017-05-31 北京握奇数据***有限公司 低功耗蓝牙设备通讯加密方法及***
EP3665909B1 (en) * 2017-08-11 2021-11-10 Sonova AG Method and system for fitting a hearing device
CN107357184A (zh) * 2017-08-29 2017-11-17 芜湖莫森泰克汽车科技股份有限公司 一种具有蓝牙通讯功能的天窗控制***及其控制方法
CN109862560B (zh) * 2017-11-30 2022-06-14 阿里巴巴集团控股有限公司 一种蓝牙认证方法、装置、设备和介质
EP3716567A1 (de) * 2019-03-28 2020-09-30 Tecpharma Licensing AG Sichere kommunikationsverbindung zwischen medizinischen geräten einer datenmanagementvorrichtung
CN110113734B (zh) * 2019-04-02 2022-08-12 惠州高盛达科技有限公司 蓝牙一对多的数据传输方法、***及存储介质
CN110635901B (zh) * 2019-09-11 2023-01-17 北京方研矩行科技有限公司 用于物联网设备的本地蓝牙动态认证方法和***
CN111192381A (zh) * 2019-12-30 2020-05-22 上海博泰悦臻网络技术服务有限公司 一种车载智能计算装置及其控制方法
CN111653076A (zh) * 2020-05-06 2020-09-11 宇龙计算机通信科技(深圳)有限公司 Ar眼镜的控制方法、装置、存储介质及终端
CN112244360B (zh) * 2020-10-12 2023-12-22 武汉瑞纳捷半导体有限公司 电子烟烟弹的认证方法、装置及电子烟

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102983892A (zh) * 2012-11-19 2013-03-20 深圳市文鼎创数据科技有限公司 蓝牙配对方法及***
CN103986503A (zh) * 2014-05-16 2014-08-13 北京民芯科技有限公司 安全蓝牙耳机及其语音通信方法
CN104602230A (zh) * 2013-10-31 2015-05-06 深圳富泰宏精密工业有限公司 蓝牙通信装置及其使用方法
CN106788977A (zh) * 2016-12-28 2017-05-31 北京握奇数据***有限公司 低功耗蓝牙设备通讯加密方法及***

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014210122A1 (en) * 2013-06-25 2014-12-31 Qardio, Inc. Methods for authenticating device-to-device communication
CN105722013A (zh) * 2016-02-02 2016-06-29 深圳市文鼎创数据科技有限公司 蓝牙配对方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102983892A (zh) * 2012-11-19 2013-03-20 深圳市文鼎创数据科技有限公司 蓝牙配对方法及***
CN104602230A (zh) * 2013-10-31 2015-05-06 深圳富泰宏精密工业有限公司 蓝牙通信装置及其使用方法
CN103986503A (zh) * 2014-05-16 2014-08-13 北京民芯科技有限公司 安全蓝牙耳机及其语音通信方法
CN106788977A (zh) * 2016-12-28 2017-05-31 北京握奇数据***有限公司 低功耗蓝牙设备通讯加密方法及***

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111200807A (zh) * 2019-12-30 2020-05-26 上海博泰悦臻网络技术服务有限公司 一种基于蓝牙的信息交互方法及其装置
CN111200807B (zh) * 2019-12-30 2024-03-29 上海博泰悦臻网络技术服务有限公司 一种基于蓝牙的信息交互方法及其装置
WO2022156348A1 (zh) * 2021-01-20 2022-07-28 青岛海尔空调器有限总公司 空调器的控制方法、终端设备、空调器控制***
CN115379590A (zh) * 2022-10-27 2022-11-22 深圳市正浩创新科技股份有限公司 蓝牙连接建立方法、装置、电子设备及计算机存储介质

Also Published As

Publication number Publication date
CN106788977A (zh) 2017-05-31

Similar Documents

Publication Publication Date Title
WO2018120883A1 (zh) 低功耗蓝牙设备通讯加密方法及***
CN110177354B (zh) 一种车辆的无线控制方法及***
JP2021193800A (ja) 通信デバイスとネットワークデバイスとの間の通信におけるセキュリティ構成
CN102571702B (zh) 物联网中的密钥生成方法、***和设备
CN109479049B (zh) 用于密钥供应委托的***、设备和方法
CN101247605A (zh) 短信息加密、签名方法、移动终端及短信息加密***
CN104092663A (zh) 一种加密通信方法和加密通信***
CN104579679B (zh) 用于农配网通信设备的无线公网数据转发方法
CN107425971B (zh) 无证书的数据加/解密方法和装置、终端
JP2012530311A5 (zh)
CN104821933A (zh) 证书生成的设备和方法
CN111400727A (zh) 区块链的访问控制方法和装置以及电子设备
CN102420642B (zh) 蓝牙设备及其通信方法
CN101621794A (zh) 一种无线应用服务***的安全认证实现方法
CN114900304B (zh) 数字签名方法和装置、电子设备和计算机可读存储介质
CN107483191A (zh) 一种sm2算法密钥分割签名***及方法
CN109600725A (zh) 一种基于sm9算法的短信加密方法
US20230308875A1 (en) Wi-fi security authentication method and communication apparatus
CN105162592B (zh) 一种认证可穿戴设备的方法及***
WO2019085659A1 (zh) 一种信息交互方法及装置
CN111031535A (zh) 一种用于智能卡***的安全通信方法及***
KR20200064017A (ko) 블록체인 기법을 이용한 fido2.0 암호키를 생성하는 방법
CN105915531B (zh) 一种屏幕解锁方法及终端
WO2018076299A1 (zh) 数据传输方法及装置
Braga et al. Implementation issues in the construction of an application framework for secure SMS messages on android smartphones

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17887250

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17887250

Country of ref document: EP

Kind code of ref document: A1