CN106471831A - The method of configuration, the device of configuration and equipment - Google Patents
The method of configuration, the device of configuration and equipment Download PDFInfo
- Publication number
- CN106471831A CN106471831A CN201480080297.5A CN201480080297A CN106471831A CN 106471831 A CN106471831 A CN 106471831A CN 201480080297 A CN201480080297 A CN 201480080297A CN 106471831 A CN106471831 A CN 106471831A
- Authority
- CN
- China
- Prior art keywords
- key
- signature
- network
- configuration
- information
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 129
- 238000012795 verification Methods 0.000 claims abstract description 430
- 238000004891 communication Methods 0.000 claims abstract description 179
- 238000005516 engineering process Methods 0.000 abstract description 2
- 239000000463 material Substances 0.000 description 44
- 238000000060 site-specific infrared dichroism spectroscopy Methods 0.000 description 39
- 238000006243 chemical reaction Methods 0.000 description 24
- 230000003287 optical effect Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 239000004984 smart glass Substances 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 4
- 210000003127 knee Anatomy 0.000 description 4
- 238000005406 washing Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/18—Network architectures or network communication protocols for network security using different networks or channels, e.g. using out of band channels
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/08—Access security
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/50—Secure pairing of devices
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mobile Radio Communication Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本发明涉及无线通信领域,特别涉及一种配置的方法、配置的装置及设备。The present invention relates to the field of wireless communication, in particular to a configuration method, configuration device and equipment.
随着无线通信技术的迅速发展,无线网络连接配置的简便性和安全性也越来越受到用户的关注。一般地,为设备配置无线网络连接的过程比较复杂,如需要用户手动输入密码等,不仅繁琐还欠缺安全性。With the rapid development of wireless communication technology, the simplicity and security of wireless network connection configuration have attracted more and more attention from users. Generally, the process of configuring a wireless network connection for a device is relatively complicated, such as requiring the user to manually enter a password, which is not only cumbersome but also lacks security.
目前,一种配置的方法,首先配置设备与第一设备之间进行交互,获取第一设备的相关信息,并将自身的相关信息发送给第一设备,实现对第一设备的配置;然后配置设备与第二设备之间进行交互,获取第二设备的相关信息,并将自身的相关信息发送给第二设备,实现对第二设备的配置;最后由配置设备配置的第一设备,以及由配置设备配置的第二设备之间,进行无线通信,从而避免了用户手动输入密码等较为复杂的过程。At present, a configuration method, first configures the interaction between the device and the first device, obtains the relevant information of the first device, and sends its own relevant information to the first device to realize the configuration of the first device; then configures The device interacts with the second device, obtains the relevant information of the second device, and sends its own relevant information to the second device to realize the configuration of the second device; finally, the first device configured by the configuration device and the The wireless communication is performed between the second devices configured by the configuration device, thereby avoiding relatively complicated processes such as manual input of passwords by the user.
然而,当配置设备分别对第一设备及第二设备进行配置时,若配置设备与某一设备之间不能进行带内通信,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,则上述配置过程无法完成,从而导致为设备进行配置的成功率较低。However, when the configuration device configures the first device and the second device respectively, if in-band communication cannot be performed between the configuration device and a certain device, for example, a certain device does not support in-band communication, or the configuration device and a certain If the in-band communication modes supported by the device do not match, the above configuration process cannot be completed, resulting in a low success rate of configuring the device.
发明内容Contents of the invention
本发明提供一种配置的方法、配置的装置及设备,可以提高设备进行配置的成功率。The invention provides a configuration method, configuration device and equipment, which can improve the success rate of equipment configuration.
本发明采用的技术方案为:The technical scheme adopted in the present invention is:
第一方面,本发明提供一种配置的方法,应用于配置系统中,所述配置系统包括第一设备、第二设备及配置设备,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信;所述方法包括: In the first aspect, the present invention provides a configuration method, which is applied in a configuration system, the configuration system includes a first device, a second device, and a configuration device, and an in-band configuration is performed between the configuration device and the first device. Communication, performing out-of-band communication between the configuration device and the second device; the method includes:
所述第一设备接收所述配置设备发送的第二设备带外密钥,所述第二设备带外密钥由所述配置设备通过与所述第二设备之间进行带外通信获得;The first device receives the out-of-band key of the second device sent by the configuration device, and the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device;
所述第一设备根据所述第二设备带外密钥,生成加密密钥,所述加密密钥用于对第一设备向第二设备发送的信息进行加密;The first device generates an encryption key according to the second device's out-of-band key, and the encryption key is used to encrypt information sent by the first device to the second device;
所述第一设备生成第一签名生成密钥及第一签名验证密钥,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应;The first device generates a first signature generation key and a first signature verification key, the first signature generation key is used for the first device to sign, and the first signature verification key is used for Decrypting the information signed by the first device, the first signature generation key and the first signature verification key correspond to each other;
所述第一设备接收所述第二设备发送的第二网络密钥,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备生成共享密钥;The first device receives a second network key sent by the second device, the second network key is generated by the second device, and the second network key is used by the first device to generate a shared key;
所述第一设备利用第一签名生成密钥对所述第二网络密钥进行签名,得到第一签名信息;The first device signs the second network key by using a first signature generation key to obtain first signature information;
所述第一设备向所述第二设备发送加密后的第一连接信息,所述第一连接信息包括所述第一签名信息及所述第二网络密钥,所述加密后的第一连接信息由所述第一设备利用第一密钥对所述第一连接信息进行加密得到,所述第一密钥由所述第一设备根据所述加密密钥得到,以使得所述第二设备获取并向所述第一设备发送所述第一连接信息,所述第一连接信息用于所述第一设备确定所述第二设备是否合法。The first device sends encrypted first connection information to the second device, the first connection information includes the first signature information and the second network key, and the encrypted first connection The information is obtained by the first device encrypting the first connection information with a first key, and the first key is obtained by the first device according to the encryption key, so that the second device Acquiring and sending the first connection information to the first device, where the first connection information is used by the first device to determine whether the second device is legitimate.
结合第一方面,在第一方面的第一种可能的实现方式中,所述第一设备接收所述配置设备发送的第二设备带外密钥之前,还包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, before the first device receives the out-of-band key of the second device sent by the configuration device, the method further includes:
所述第一设备接收所述配置设备发送的第二签名验证密钥,所述第二签名验证密钥由所述配置设备生成,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密;The first device receives a second signature verification key sent by the configuration device, the second signature verification key is generated by the configuration device, and the second signature verification key is used to sign the configuration device to decrypt the information;
所述第一设备生成第一网络密钥,所述第一网络密钥用于所述第二设备生成共享密钥; The first device generates a first network key, and the first network key is used by the second device to generate a shared key;
所述第一设备将所述第一网络密钥发送给所述配置设备,以使得所述配置设备至少根据所述第一网络密钥,生成并向所述第一设备发送第二连接信息。The first device sends the first network key to the configuration device, so that the configuration device generates and sends second connection information to the first device at least according to the first network key.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述第一设备将所述第一网络密钥发送给所述配置设备之后,还包括:With reference to the first possible implementation of the first aspect, in a second possible implementation of the first aspect, after the first device sends the first network key to the configuration device, further include: :
所述第一设备接收所述配置设备发送的所述第二连接信息,所述第二连接信息包括第二签名信息及所述第一网络密钥,所述第二签名信息由所述配置设备利用第二签名生成密钥对所述第一网络密钥进行签名得到,所述第二签名生成密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The first device receives the second connection information sent by the configuration device, the second connection information includes second signature information and the first network key, and the second signature information is provided by the configuration device Obtained by signing the first network key by using a second signature generation key, the second signature generation key is generated by the configuration device, and the second signature generation key is used by the configuration device to perform signature , the second signature generation key corresponds to the second signature verification key.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述第一设备向所述第二设备发送加密后的第一连接信息之后,还包括:With reference to the second possible implementation of the first aspect, in a third possible implementation of the first aspect, after the first device sends the encrypted first connection information to the second device, further include: :
所述第一设备发送第二消息,所述第二消息携带有所述第二连接信息,所述第二连接信息包括所述第二签名信息,所述第二签名信息包括所述第一网络密钥,以使得所述第二设备接收所述第一设备发送的第二消息,根据所述第二消息携带的所述第二签名信息,确定所述第一设备是否合法,并至少根据所述第二签名信息中的所述第一网络密钥生成第二共享密钥,所述第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The first device sends a second message, the second message carries the second connection information, the second connection information includes the second signature information, and the second signature information includes the first network key, so that the second device receives the second message sent by the first device, determines whether the first device is legitimate according to the second signature information carried in the second message, and at least according to the The first network key in the second signature information generates a second shared key, the second shared key is a pre-key between the first device and the second device, and the pre-shared key The key is used for handshake authentication between the first device and the second device.
结合第一方面的第二种可能的实现方式,或者第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述方法还包括:In combination with the second possible implementation of the first aspect, or the third possible implementation of the first aspect, in a fourth possible implementation of the first aspect, the method further includes:
所述第一设备生成第三网络密钥,所述第三网络密钥用于所述第二设备生成共享密钥;The first device generates a third network key, and the third network key is used by the second device to generate a shared key;
所述第一设备将所述第三网络密钥发送给所述配置设备; The first device sends the third network key to the configuration device;
所述第一设备接收所述配置设备发送的第三连接信息,所述第三连接信息包括第三签名信息及所述第三网络密钥,所述第三签名信息由所述配置设备利用所述第二签名生成密钥对所述第三网络密钥进行签名得到;The first device receives third connection information sent by the configuration device, the third connection information includes third signature information and the third network key, and the third signature information is used by the configuration device to The second signature generation key is obtained by signing the third network key;
所述第一设备向所述第二设备发送第三消息,所述第三消息携带有所述第三连接信息,以使得所述第二设备获取所述第三网络密钥,并至少根据所述第三网络密钥生成新的第二共享密钥,所述新的第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The first device sends a third message to the second device, where the third message carries the third connection information, so that the second device obtains the third network key, and at least according to the Using the third network key to generate a new second shared key, the new second shared key is a pre-key between the first device and the second device, and the pre-key is used for A handshake authentication is performed between the first device and the second device.
结合第一方面的第三种可能的实现方式,在第一方面的第五种可能的实现方式中,所述方法还包括:With reference to the third possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes:
所述第一设备向所述第二设备发送加密后的第二签名验证密钥,所述加密后的第二签名验证密钥由所述第一设备利用第二密钥对所述第二签名验证密钥进行加密得到,所述第二密钥由所述第一设备根据所述加密密钥得到,以使得所述第二设备接收所述第二签名验证密钥,并根据所述第二签名验证密钥,以及所述第二消息携带的所述第二签名信息,确定所述第一设备合法。The first device sends an encrypted second signature verification key to the second device, and the encrypted second signature verification key is used by the first device to sign the second signature with the second key. The verification key is obtained by encrypting the second key, and the second key is obtained by the first device according to the encryption key, so that the second device receives the second signature verification key, and according to the second The signature verification key and the second signature information carried in the second message determine that the first device is legal.
结合第一方面的第一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述第一设备向所述第二设备发送加密后的第一连接信息之后,还包括:With reference to the first possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, after the first device sends the encrypted first connection information to the second device, the method further includes: :
所述第一设备接收所述第二设备发送的第一消息,所述第一消息携带有所述第一连接信息;receiving, by the first device, a first message sent by the second device, where the first message carries the first connection information;
所述第一设备根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法。The first device determines, according to the first signature information carried in the first message, that the second device is legal.
结合第一方面的第六种可能的实现方式,在第一方面的第七种可能的实现方式中,所述第一设备根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法,具体包括:With reference to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, the first device determines, according to the first signature information carried in the first message, that the Second devices are legal, including:
所述第一设备根据所述第一消息携带的所述第一签名信息,确定签名 得到所述第一签名信息的设备为可信设备,所述可信设备包括所述第一设备或者所述配置设备。The first device determines the signature according to the first signature information carried in the first message The device that obtains the first signature information is a trusted device, and the trusted device includes the first device or the configuration device.
结合第一方面的第六种可能的实现方式,在第一方面的第八种可能的实现方式中,所述第一设备根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法,具体包括:With reference to the sixth possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, the first device determines, according to the first signature information carried in the first message, that the Second devices are legal, including:
所述第一设备利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The first device decrypts the first signature information by using the first signature verification key to obtain a decryption result;
所述第一设备将所述解密结果,与所述第一连接信息包括的所述第二网络密钥进行比对;The first device compares the decryption result with the second network key included in the first connection information;
若所述解密结果与所述第二网络密钥匹配,则所述第一设备确定所述第二设备合法。If the decryption result matches the second network key, the first device determines that the second device is legal.
结合第一方面的第六种可能的实现方式,或者第一方面的第七种可能的实现方式,或者第一方面的第八种可能的实现方式,在第一方面的第九种可能的实现方式中,所述第一设备根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法之后,还包括:In combination with the sixth possible implementation of the first aspect, or the seventh possible implementation of the first aspect, or the eighth possible implementation of the first aspect, the ninth possible implementation of the first aspect In the method, after the first device determines that the second device is legal according to the first signature information carried in the first message, it further includes:
若确定所述第二设备合法,则所述第一设备至少根据所述第二网络密钥,生成第一共享密钥,所述第一共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。If it is determined that the second device is legitimate, the first device generates a first shared key based on at least the second network key, and the first shared key is a shared key between the first device and the second network key. A pre-key between devices, where the pre-key is used for handshake authentication between the first device and the second device.
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现方式中,所述第一设备至少根据所述第二网络密钥,生成第一共享密钥,具体包括:With reference to the ninth possible implementation manner of the first aspect, in a tenth possible implementation manner of the first aspect, the first device generates a first shared key at least according to the second network key, specifically include:
所述第一设备按照迪菲赫尔曼DH密钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第一共享密钥;或者,The first device generates a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the first network key and the second network key, and sends the DH A shared key, or a key derived from the DH shared key, as the first shared key; or,
所述第一设备按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密 钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第一共享密钥。The first device uses Diffie-Hellman ECDH encryption based on elliptic curve cryptosystem A key generation algorithm, generating an ECDH shared key according to the private key corresponding to the first network key and the second network key, and deriving the ECDH shared key, or deriving it from the ECDH shared key The obtained key is used as the first shared key.
结合第一方面,在第一方面的第十一种可能的实现方式中,所述第一设备接收所述配置设备发送的第二设备带外密钥之后,还包括:With reference to the first aspect, in an eleventh possible implementation manner of the first aspect, after the first device receives the out-of-band key of the second device sent by the configuration device, the method further includes:
所述第一设备确定所述第二设备是否存储有所述第二设备带外密钥对应的私钥;The first device determines whether the second device stores a private key corresponding to the second device's out-of-band key;
若所述第二设备存储有所述第二设备带外密钥对应的私钥,则所述第一设备确定所述第二设备合法。If the second device stores a private key corresponding to the second device's out-of-band key, the first device determines that the second device is legal.
第二方面,本发明提供一种配置的装置,用于第一设备,所述第一设备位于配置系统,所述配置系统包括第一设备、第二设备及配置设备,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信;所述装置包括:In a second aspect, the present invention provides a device for configuration, which is used for a first device, the first device is located in a configuration system, and the configuration system includes a first device, a second device, and a configuration device, and the configuration device and the configuration device In-band communication is performed between the first device, and out-of-band communication is performed between the configuration device and the second device; the device includes:
接收单元,用于接收所述配置设备发送的第二设备带外密钥,所述第二设备带外密钥由所述配置设备通过与所述第二设备之间进行带外通信获得;a receiving unit, configured to receive the out-of-band key of the second device sent by the configuration device, the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device;
生成单元,用于根据所述接收单元接收的所述第二设备带外密钥,生成加密密钥,所述加密密钥用于对第一设备向第二设备发送的信息进行加密;a generating unit, configured to generate an encryption key according to the out-of-band key of the second device received by the receiving unit, and the encryption key is used to encrypt information sent by the first device to the second device;
所述生成单元,还用于生成第一签名生成密钥及第一签名验证密钥,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应;The generation unit is further configured to generate a first signature generation key and a first signature verification key, the first signature generation key is used for the first device to sign, and the first signature verification key is used for For decrypting the information signed by the first device, the first signature generation key and the first signature verification key correspond to each other;
所述接收单元,还用于接收所述第二设备发送的第二网络密钥,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备生成共享密钥;The receiving unit is further configured to receive a second network key sent by the second device, the second network key is generated by the second device, and the second network key is used for the first The device generates a shared key;
签名单元,用于利用第一签名生成密钥对所述接收单元接收的所述第 二网络密钥进行签名,得到第一签名信息;A signature unit, configured to use a first signature generation key to pair the first signature received by the receiving unit Sign with the second network key to obtain the first signature information;
发送单元,用于向所述第二设备发送加密后的第一连接信息,所述第一连接信息包括所述签名单元签名得到的所述第一签名信息及所述第二网络密钥,所述加密后的第一连接信息由所述第一设备利用第一密钥对所述第一连接信息进行加密得到,所述第一密钥由所述第一设备根据所述生成单元生成的所述加密密钥得到,以使得所述第二设备获取并向所述第一设备发送所述第一连接信息,所述第一连接信息用于所述第一设备确定所述第二设备是否合法。a sending unit, configured to send encrypted first connection information to the second device, where the first connection information includes the first signature information signed by the signature unit and the second network key, the The encrypted first connection information is obtained by the first device encrypting the first connection information with a first key, and the first key is obtained by the first device according to the generated by the generating unit obtain the encryption key, so that the second device acquires and sends the first connection information to the first device, and the first connection information is used by the first device to determine whether the second device is legitimate .
结合第二方面,在第二方面的第一种可能的实现方式中,In combination with the second aspect, in the first possible implementation of the second aspect,
所述接收单元,还用于在所述接收单元接收所述第二设备带外密钥之前,接收所述配置设备发送的第二签名验证密钥,所述第二签名验证密钥由所述配置设备生成,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密;The receiving unit is further configured to receive a second signature verification key sent by the configuration device before the receiving unit receives the out-of-band key of the second device, and the second signature verification key is provided by the Generated by the configuration device, the second signature verification key is used to decrypt the information signed by the configuration device;
所述生成单元,还用于生成第一网络密钥,所述第一网络密钥用于所述第二设备生成共享密钥;The generating unit is further configured to generate a first network key, and the first network key is used by the second device to generate a shared key;
所述发送单元,还用于将所述生成单元生成的所述第一网络密钥发送给所述配置设备,以使得所述配置设备至少根据所述第一网络密钥,生成并向所述第一设备发送第二连接信息。The sending unit is further configured to send the first network key generated by the generating unit to the configuration device, so that the configuration device generates and sends to the configuration device at least according to the first network key The first device sends second connection information.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,In combination with the first possible implementation of the second aspect, in the second possible implementation of the second aspect,
所述接收单元,还用于在所述发送单元发送所述第一网络密钥后,接收所述配置设备发送的所述第二连接信息,所述第二连接信息包括第二签名信息及所述第一网络密钥,所述第二签名信息由所述配置设备利用第二签名生成密钥对所述第一网络密钥进行签名得到,所述第二签名生成密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The receiving unit is further configured to receive the second connection information sent by the configuration device after the sending unit sends the first network key, the second connection information includes the second signature information and the the first network key, the second signature information is obtained by the configuration device signing the first network key with a second signature generation key, and the second signature generation key is obtained by the configuration device The second signature generation key is used for the configuration device to perform signature, and the second signature generation key and the second signature verification key correspond to each other.
结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的 实现方式中,In combination with the second possible implementation of the second aspect, the third possible implementation of the second aspect In the way of implementation,
所述发送单元,还用于发送加密后的第二消息,所述第二消息携带有所述第二连接信息,所述第二连接信息包括所述第二签名信息,所述第二签名信息包括所述第一网络密钥,以使得所述第二设备接收所述第一设备发送的第二消息,根据所述第二消息携带的所述第二签名信息,确定所述第一设备是否合法,并至少根据所述第二签名信息中的所述第一网络密钥生成第二共享密钥,所述第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The sending unit is further configured to send an encrypted second message, the second message carries the second connection information, the second connection information includes the second signature information, and the second signature information Including the first network key, so that the second device receives the second message sent by the first device, and determines whether the first device according to the second signature information carried in the second message legal, and generate a second shared key at least according to the first network key in the second signature information, where the second shared key is a pre-established agreement between the first device and the second device A key, where the pre-key is used for handshake authentication between the first device and the second device.
结合第二方面的第二种可能的实现方式,或者第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,In combination with the second possible implementation of the second aspect, or the third possible implementation of the second aspect, in the fourth possible implementation of the second aspect,
所述生成单元,还用于生成第三网络密钥,所述第三网络密钥用于所述第二设备生成共享密钥;The generating unit is further configured to generate a third network key, and the third network key is used by the second device to generate a shared key;
所述发送单元,还用于将所述第三网络密钥发送给所述配置设备;The sending unit is further configured to send the third network key to the configuration device;
所述接收单元,还用于接收所述配置设备发送的第三连接信息,所述第三连接信息包括第三签名信息及所述第三网络密钥,所述第三签名信息由所述配置设备利用所述第二签名生成密钥对所述第三网络密钥进行签名得到;The receiving unit is further configured to receive third connection information sent by the configuration device, the third connection information includes third signature information and the third network key, and the third signature information is provided by the configuration device. Obtained by signing the third network key by using the second signature generation key;
所述发送单元,还用于向所述第二设备发送第三消息,所述第三消息携带有所述第三连接信息,以使得所述第二设备获取所述第三网络密钥,并至少根据所述第三网络密钥生成新的第二共享密钥,所述新的第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The sending unit is further configured to send a third message to the second device, where the third message carries the third connection information, so that the second device acquires the third network key, and generate a new second shared key at least according to the third network key, the new second shared key is a pre-key between the first device and the second device, and the pre-encrypted The key is used for handshake authentication between the first device and the second device.
结合第二方面的第三种可能的实现方式,在第二方面的第五种可能的实现方式中,In combination with the third possible implementation of the second aspect, in the fifth possible implementation of the second aspect,
所述发送单元,还用于向所述第二设备发送加密后的第二签名验证密钥,所述加密后的第二签名验证密钥由所述第一设备利用第二密钥对所述 第二签名验证密钥进行加密得到,所述第二密钥由所述第一设备根据所述加密密钥得到,以使得所述第二设备接收所述第二签名验证密钥,并根据所述第二签名验证密钥,以及所述第二消息携带的所述第二签名信息,确定所述第一设备合法。The sending unit is further configured to send an encrypted second signature verification key to the second device, and the encrypted second signature verification key is paired by the first device with the second key to the The second signature verification key is encrypted, and the second key is obtained by the first device according to the encryption key, so that the second device receives the second signature verification key and The second signature verification key and the second signature information carried in the second message determine that the first device is legal.
结合第二方面的第一种可能的实现方式,在第二方面的第六种可能的实现方式中,In combination with the first possible implementation of the second aspect, in a sixth possible implementation of the second aspect,
所述接收单元,还用于接收所述第二设备发送的第一消息,所述第一消息携带有所述第一连接信息;The receiving unit is further configured to receive a first message sent by the second device, where the first message carries the first connection information;
所述装置还包括:确定单元;The device also includes: a determination unit;
所述确定单元,用于根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法。The determining unit is configured to determine that the second device is legal according to the first signature information carried in the first message.
结合第二方面的第六种可能的实现方式,在第二方面的第七种可能的实现方式中,In combination with the sixth possible implementation of the second aspect, in the seventh possible implementation of the second aspect,
所述确定单元,具体用于根据所述第一消息携带的所述第一签名信息,确定签名得到所述第一签名信息的设备是否为可信设备,所述可信设备为所述第一设备或者所述配置设备。The determining unit is specifically configured to, according to the first signature information carried in the first message, determine whether the device that signed the first signature information is a trusted device, and the trusted device is the first signature information. device or the configuration device.
结合第二方面的第六种可能的实现方式,在第二方面的第八种可能的实现方式中,所述装置还包括:解密单元、比对单元;With reference to the sixth possible implementation of the second aspect, in an eighth possible implementation of the second aspect, the device further includes: a decryption unit and a comparison unit;
所述解密单元,用于利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The decryption unit is configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result;
所述比对单元,用于将所述解密单元解密得到的所述解密结果,与所述第一连接信息包括的所述第二网络密钥进行比对;The comparison unit is configured to compare the decryption result obtained by decrypting the decryption unit with the second network key included in the first connection information;
所述确定单元,具体用于当所述比对单元比对所述解密结果与所述第二网络密钥匹配时,确定所述第二设备合法。The determining unit is specifically configured to determine that the second device is legal when the comparing unit compares that the decryption result matches the second network key.
结合第二方面的第六种可能的实现方式,或者第二方面的第七种可能的实现方式,或者第二方面的第八种可能的实现方式,在第二方面的第九种可能的实现方式中, In combination with the sixth possible implementation of the second aspect, or the seventh possible implementation of the second aspect, or the eighth possible implementation of the second aspect, the ninth possible implementation of the second aspect way,
所述生成单元,还用于当所述确定单元确定所述第二设备合法时,至少根据所述第二网络密钥,生成第一共享密钥,所述第一共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The generating unit is further configured to generate a first shared key at least according to the second network key when the determining unit determines that the second device is legitimate, and the first shared key is the second shared key. A pre-key between a device and the second device, where the pre-key is used for handshake authentication between the first device and the second device.
结合第二方面的第九种可能的实现方式,在第二方面的第十种可能的实现方式中,In combination with the ninth possible implementation of the second aspect, in the tenth possible implementation of the second aspect,
所述生成单元,具体用于按照迪菲赫尔曼DH密钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第一共享密钥;The generation unit is specifically configured to generate a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the first network key and the second network key, and The DH shared key, or a key derived from the DH shared key, is used as the first shared key;
所述生成单元,具体还用于按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第一共享密钥。The generating unit is specifically further configured to generate the key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, according to the private key corresponding to the first network key and the second network key, Generate an ECDH shared key, and use the ECDH shared key, or a key derived from the ECDH shared key, as the first shared key.
结合第二方面,在第二方面的第十一种可能的实现方式中,In combination with the second aspect, in an eleventh possible implementation manner of the second aspect,
所述确定单元,还用于确定所述第二设备是否存储有所述第二设备带外密钥对应的私钥;The determining unit is further configured to determine whether the second device stores a private key corresponding to the second device's out-of-band key;
所述确定单元,还用于当所述第二设备存储有所述第二设备带外密钥对应的私钥时,确定所述第二设备合法。The determining unit is further configured to determine that the second device is legal when the second device stores a private key corresponding to the second device out-of-band key.
第三方面,本发明提供一种设备,所述设备为第一设备,所述第一设备位于配置系统,所述配置系统包括第一设备、第二设备及配置设备,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信;所述第一设备包括:In a third aspect, the present invention provides a device, the device is a first device, the first device is located in a configuration system, the configuration system includes a first device, a second device, and a configuration device, and the configuration device and the In-band communication is performed between the first device, and out-of-band communication is performed between the configuration device and the second device; the first device includes:
接收器,用于接收所述配置设备发送的第二设备带外密钥,所述第二设备带外密钥由所述配置设备通过与所述第二设备之间进行带外通信获得;a receiver, configured to receive the out-of-band key of the second device sent by the configuration device, where the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device;
处理器,用于根据所述接收器接收的所述第二设备带外密钥,生成加 密密钥,所述加密密钥用于对第一设备向第二设备发送的信息进行加密;a processor, configured to generate an encrypted key according to the second device out-of-band key received by the receiver An encryption key, where the encryption key is used to encrypt information sent by the first device to the second device;
所述处理器,还用于生成第一签名生成密钥及第一签名验证密钥,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应;The processor is further configured to generate a first signature generation key and a first signature verification key, the first signature generation key is used for the first device to sign, and the first signature verification key is used to For decrypting the information signed by the first device, the first signature generation key and the first signature verification key correspond to each other;
所述接收器,还用于接收所述第二设备发送的第二网络密钥,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备生成共享密钥;The receiver is further configured to receive a second network key sent by the second device, the second network key is generated by the second device, and the second network key is used for the first The device generates a shared key;
所述处理器,还用于利用第一签名生成密钥对所述接收器接收的所述第二网络密钥进行签名,得到第一签名信息;The processor is further configured to use a first signature generation key to sign the second network key received by the receiver to obtain first signature information;
发送器,用于向所述第二设备发送加密后的第一连接信息,所述第一连接信息包括所述处理器签名得到的所述第一签名信息及所述第二网络密钥,所述加密后的第一连接信息由所述第一设备利用第一密钥对所述第一连接信息进行加密得到,所述第一密钥由所述第一设备根据所述处理器生成的所述加密密钥得到,以使得所述第二设备获取并向所述第一设备发送所述第一连接信息,所述第一连接信息用于所述第一设备确定所述第二设备是否合法。a sender, configured to send encrypted first connection information to the second device, where the first connection information includes the first signature information and the second network key signed by the processor, and The encrypted first connection information is obtained by the first device encrypting the first connection information with a first key, and the first key is obtained by the first device according to the obtain the encryption key, so that the second device acquires and sends the first connection information to the first device, and the first connection information is used by the first device to determine whether the second device is legitimate .
结合第三方面,在第三方面的第一种可能的实现方式中,In combination with the third aspect, in the first possible implementation of the third aspect,
所述接收器,还用于在所述接收器接收所述第二设备带外密钥之前,接收所述配置设备发送的第二签名验证密钥,所述第二签名验证密钥由所述配置设备生成,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密;The receiver is further configured to receive a second signature verification key sent by the configuration device before the receiver receives the out-of-band key of the second device, and the second signature verification key is determined by the Generated by the configuration device, the second signature verification key is used to decrypt the information signed by the configuration device;
所述处理器,还用于生成第一网络密钥,所述第一网络密钥用于所述第二设备生成共享密钥;The processor is further configured to generate a first network key, and the first network key is used by the second device to generate a shared key;
所述发送器,还用于将所述处理器生成的所述第一网络密钥发送给所述配置设备,以使得所述配置设备至少根据所述第一网络密钥,生成并向所述第一设备发送第二连接信息。 The transmitter is further configured to send the first network key generated by the processor to the configuration device, so that the configuration device generates and sends to the configuration device at least based on the first network key The first device sends second connection information.
结合第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,In combination with the first possible implementation of the third aspect, in the second possible implementation of the third aspect,
所述接收器,还用于在所述发送器发送所述第一网络密钥后,接收所述配置设备发送的所述第二连接信息,所述第二连接信息包括第二签名信息及所述第一网络密钥,所述第二签名信息由所述配置设备利用第二签名生成密钥对所述第一网络密钥进行签名得到,所述第二签名生成密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The receiver is further configured to receive the second connection information sent by the configuration device after the sender sends the first network key, where the second connection information includes the second signature information and the the first network key, the second signature information is obtained by the configuration device signing the first network key with a second signature generation key, and the second signature generation key is obtained by the configuration device The second signature generation key is used for the configuration device to perform signature, and the second signature generation key and the second signature verification key correspond to each other.
结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,In combination with the second possible implementation of the third aspect, in the third possible implementation of the third aspect,
所述发送器,还用于向所述第二设备发送加密后的第二消息,所述第二消息携带有所述第二连接信息,所述第二连接信息包括所述第二签名信息,所述第二签名信息包括所述第一网络密钥,所述加密后的第二消息由所述第一设备利用第四密钥对所述第二消息进行加密得到,所述第四密钥由所述第一设备根据所述加密密钥得到,以使得所述第二设备接收所述第一设备发送的第二消息,根据所述第二消息携带的所述第二签名信息,确定所述第一设备是否合法,并至少根据所述第二签名信息中的所述第一网络密钥生成第二共享密钥,所述第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The sender is further configured to send an encrypted second message to the second device, the second message carries the second connection information, and the second connection information includes the second signature information, The second signature information includes the first network key, and the encrypted second message is obtained by encrypting the second message by the first device using a fourth key, and the fourth key Obtained by the first device according to the encryption key, so that the second device receives the second message sent by the first device, and according to the second signature information carried in the second message, determines the Whether the first device is legitimate, and at least generate a second shared key based on the first network key in the second signature information, the second shared key is the first device and the second A pre-key between devices, where the pre-key is used for handshake authentication between the first device and the second device.
结合第三方面的第二种可能的实现方式,或者第三方面的第三种可能的实现方式,在第三方面的第四种可能的实现方式中,In combination with the second possible implementation of the third aspect, or the third possible implementation of the third aspect, in the fourth possible implementation of the third aspect,
所述处理器,还用于生成第三网络密钥,所述第三网络密钥用于所述第二设备生成共享密钥;The processor is further configured to generate a third network key, where the third network key is used by the second device to generate a shared key;
所述发送器,还用于将所述第三网络密钥发送给所述配置设备;The transmitter is further configured to send the third network key to the configuration device;
所述接收器,还用于接收所述配置设备发送的第三连接信息,所述第三连接信息包括第三签名信息及所述第三网络密钥,所述第三签名信息由 所述配置设备利用所述第二签名生成密钥对所述第三网络密钥进行签名得到;The receiver is further configured to receive third connection information sent by the configuration device, the third connection information includes third signature information and the third network key, and the third signature information is determined by Obtained by the configuration device signing the third network key by using the second signature generation key;
所述发送器,还用于向所述第二设备发送第三消息,所述第三消息携带有所述第三连接信息,以使得所述第二设备获取所述第三网络密钥,并至少根据所述第三网络密钥生成新的第二共享密钥,所述新的第二共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The sender is further configured to send a third message to the second device, where the third message carries the third connection information, so that the second device acquires the third network key, and generate a new second shared key at least according to the third network key, the new second shared key is a pre-key between the first device and the second device, and the pre-encrypted The key is used for handshake authentication between the first device and the second device.
结合第三方面的第三种可能的实现方式,在第三方面的第五种可能的实现方式中,In combination with the third possible implementation of the third aspect, in the fifth possible implementation of the third aspect,
所述发送器,还用于向所述第二设备发送加密后的第二签名验证密钥,所述加密后的第二签名验证密钥由所述第一设备利用第二密钥对所述第二签名验证密钥进行加密得到,所述第二密钥由所述第一设备根据所述加密密钥得到,以使得所述第二设备接收所述第二签名验证密钥,并根据所述第二签名验证密钥,以及所述第二消息携带的所述第二签名信息,确定所述第一设备合法。The sender is further configured to send an encrypted second signature verification key to the second device, and the encrypted second signature verification key is paired by the first device with the second key to the The second signature verification key is encrypted, and the second key is obtained by the first device according to the encryption key, so that the second device receives the second signature verification key and The second signature verification key and the second signature information carried in the second message determine that the first device is legal.
结合第三方面的第一种可能的实现方式,在第三方面的第六种可能的实现方式中,In combination with the first possible implementation of the third aspect, in the sixth possible implementation of the third aspect,
所述接收器,还用于接收所述第二设备发送的第一消息,所述第一消息携带有所述第一连接信息;The receiver is further configured to receive a first message sent by the second device, where the first message carries the first connection information;
所述处理器,还用于根据所述第一消息携带的所述第一签名信息,确定所述第二设备合法。The processor is further configured to determine that the second device is legal according to the first signature information carried in the first message.
结合第三方面的第六种可能的实现方式,在第三方面的第七种可能的实现方式中,In combination with the sixth possible implementation of the third aspect, in the seventh possible implementation of the third aspect,
所述处理器,具体用于根据所述第一消息携带的所述第一签名信息,确定签名得到所述第一签名信息的设备是否为可信设备,所述可信设备为所述第一设备或者所述配置设备。The processor is specifically configured to determine, according to the first signature information carried in the first message, whether the device that signed the first signature information is a trusted device, and the trusted device is the first device or the configuration device.
结合第三方面的第六种可能的实现方式,在第三方面的第八种可能的 实现方式中,In combination with the sixth possible implementation of the third aspect, the eighth possible implementation of the third aspect In the way of implementation,
所述处理器,还用于利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The processor is further configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result;
所述处理器,还用于将所述解密结果,与所述第一连接信息包括的所述第二网络密钥进行比对;The processor is further configured to compare the decryption result with the second network key included in the first connection information;
所述处理器,具体用于当所述解密结果与所述第二网络密钥匹配时,确定所述第二设备合法。The processor is specifically configured to determine that the second device is legal when the decryption result matches the second network key.
结合第三方面的第六种可能的实现方式,或者第三方面的第七种可能的实现方式,或者第三方面的第八种可能的实现方式,在第三方面的第九种可能的实现方式中,In combination with the sixth possible implementation of the third aspect, or the seventh possible implementation of the third aspect, or the eighth possible implementation of the third aspect, the ninth possible implementation of the third aspect way,
所述处理器,还用于当确定所述第二设备合法时,至少根据所述第二网络密钥,生成第一共享密钥,所述第一共享密钥为所述第一设备与所述第二设备之间的预先密钥,所述预先密钥用于所述第一设备与所述第二设备之间进行握手认证。The processor is further configured to, when it is determined that the second device is legal, generate a first shared key at least according to the second network key, and the first shared key is used by the first device and the A pre-key between the second device, where the pre-key is used for handshake authentication between the first device and the second device.
结合第三方面的第九种可能的实现方式,在第三方面的第十种可能的实现方式中,In combination with the ninth possible implementation of the third aspect, in the tenth possible implementation of the third aspect,
所述处理器,具体用于按照迪菲赫尔曼DH密钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第一共享密钥;The processor is specifically configured to generate a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the first network key and the second network key, and The DH shared key, or a key derived from the DH shared key, is used as the first shared key;
所述处理器,具体还用于按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据所述第一网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第一共享密钥。The processor is further configured to, according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, according to the private key corresponding to the first network key and the second network key, Generate an ECDH shared key, and use the ECDH shared key, or a key derived from the ECDH shared key, as the first shared key.
结合第三方面,在第三方面的第十一种可能的实现方式中,In combination with the third aspect, in the eleventh possible implementation manner of the third aspect,
所述处理器,还用于确定所述第二设备是否存储有所述第二设备带外密钥对应的私钥; The processor is further configured to determine whether the second device stores a private key corresponding to the out-of-band key of the second device;
所述处理器,还用于当所述第二设备存储有所述第二设备带外密钥对应的私钥时,确定所述第二设备合法。The processor is further configured to determine that the second device is legal when the second device stores a private key corresponding to the second device out-of-band key.
第四方面,本发明提供一种配置的方法,应用于配置系统中,所述配置系统包括第一设备、第二设备、配置设备及第三设备,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信,所述配置设备与所述第三设备之间进行带内通信,所述第一设备已配置所述第二设备;所述方法包括:In a fourth aspect, the present invention provides a configuration method, which is applied to a configuration system, the configuration system includes a first device, a second device, a configuration device, and a third device, the configuration device and the first device In-band communication between the configuration device and the second device, out-of-band communication between the configuration device and the third device, in-band communication between the configuration device and the third device, the first device has configured the second device Two devices; the method comprising:
所述第三设备接收所述配置设备发送的第一签名验证密钥及第一网络密钥,所述第一签名验证密钥由所述第一设备生成并发送给所述配置设备,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一网络密钥由所述第一设备生成并发送给所述配置设备,所述第一网络密钥用于所述第二设备生成共享密钥;The third device receives the first signature verification key and the first network key sent by the configuration device, the first signature verification key is generated by the first device and sent to the configuration device, the The first signature verification key is used to decrypt the information signed by the first device, the first network key is generated by the first device and sent to the configuration device, and the first network key is used to generating a shared key at the second device;
所述第三设备接收所述第二设备发送的第一消息,所述第一消息携带有第一连接信息,所述第一连接信息包括第一签名信息及对端网络密钥,所述第一签名信息由所述第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,所述第一签名生成密钥由所述第一设备生成,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备或所述第三设备生成共享密钥;The third device receives a first message sent by the second device, the first message carries first connection information, the first connection information includes first signature information and a peer network key, and the first Signature information is obtained by the first device using a first signature generation key to sign the second network key, the first signature generation key is generated by the first device, and the first signature generation key Used for the first device to sign, the first signature generation key and the first signature verification key correspond to each other, the second network key is generated by the second device, and the first The second network key is used by the first device or the third device to generate a shared key;
所述第三设备根据所述第一网络密钥,确定所述对端网络密钥是否合法;The third device determines whether the peer network key is valid according to the first network key;
若所述对端网络密钥合法,则所述第三设备根据所述第一签名信息,确定所述第二设备是否合法。If the peer network key is legal, the third device determines whether the second device is legal according to the first signature information.
结合第四方面,在第四方面的第一种可能的实现方式中,所述第三设备根据所述第一网络密钥,确定所述对端网络密钥是否合法,具体包括:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the third device determines whether the peer network key is legal according to the first network key, specifically including:
所述第三设备确定所述对端网络密钥是否为信任的网络密钥,所述信任的网络密钥包括所述第一网络密钥。 The third device determines whether the peer network key is a trusted network key, where the trusted network key includes the first network key.
结合第四方面,在第四方面的第二种可能的实现方式中,所述第一连接信息还包括第二网络密钥;With reference to the fourth aspect, in a second possible implementation manner of the fourth aspect, the first connection information further includes a second network key;
所述第三设备根据所述第一签名信息,确定所述第二设备是否合法,具体包括:The third device determines whether the second device is legitimate according to the first signature information, specifically including:
所述第三设备利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The third device decrypts the first signature information by using the first signature verification key to obtain a decryption result;
所述第三设备将所述解密结果,与所述第二网络密钥进行比对;The third device compares the decryption result with the second network key;
若所述解密结果与所述第二网络密钥匹配,则所述第三设备确定所述第二设备合法。If the decryption result matches the second network key, the third device determines that the second device is legal.
结合第四方面的第二种可能的实现方式,在第四方面的第三种可能的实现方式中,所述第三设备确定所述第二设备合法之后,还包括:With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, after the third device determines that the second device is legal, further includes:
所述第三设备至少根据所述第二网络密钥,生成第三共享密钥,所述第三共享密钥为所述第三设备与所述第二设备之间进行握手认证的预先密钥。The third device generates a third shared key at least according to the second network key, and the third shared key is a pre-key for handshake authentication between the third device and the second device .
结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,所述第三设备至少根据所述第二网络密钥,生成第三共享密钥,具体包括:With reference to the third possible implementation of the fourth aspect, in a fourth possible implementation of the fourth aspect, the third device generates a third shared key at least according to the second network key, specifically include:
所述第三设备按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第三共享密钥,所述第四网络密钥用于所述第二设备生成共享密钥;或者,The third device generates a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and uses the DH shared key key, or a key derived from the DH shared key as the third shared key, and the fourth network key is used by the second device to generate a shared key; or,
所述第三设备按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据所述第四网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第三共享密钥。The third device generates an ECDH shared secret according to the private key corresponding to the fourth network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem. key, and use the ECDH shared key, or a key derived from the ECDH shared key, as the third shared key.
结合第四方面,在第四方面的第五种可能的实现方式中,所述方法还包括: With reference to the fourth aspect, in a fifth possible implementation manner of the fourth aspect, the method further includes:
所述第三设备生成第四网络密钥,所述第四网络密钥用于所述第二设备生成共享密钥;The third device generates a fourth network key, and the fourth network key is used by the second device to generate a shared key;
所述第三设备将所述第四网络密钥发送给所述配置设备。The third device sends the fourth network key to the configuration device.
结合第四方面的第五种可能的实现方式,在第四方面的第六种可能的实现方式中,所述第三设备将所述第四网络密钥发送给所述配置设备之后,还包括:With reference to the fifth possible implementation of the fourth aspect, in a sixth possible implementation of the fourth aspect, after the third device sends the fourth network key to the configuration device, further include :
所述第三设备接收所述配置设备发送的第四连接信息,所述第四连接信息包括第四签名信息及所述第四网络密钥,所述第四签名信息由所述配置设备利用第二签名生成密钥对所述第四网络密钥进行签名得到,所述第二签名生成密钥及第二签名验证密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The third device receives fourth connection information sent by the configuration device, the fourth connection information includes fourth signature information and the fourth network key, and the fourth signature information is used by the configuration device to The second signature generation key is obtained by signing the fourth network key, the second signature generation key and the second signature verification key are generated by the configuration device, and the second signature generation key is used for the The configuration device performs signature, the second signature verification key is used to decrypt the information signed by the configuration device, and the second signature generation key corresponds to the second signature verification key.
结合第四方面的第六种可能的实现方式,在第四方面的第七种可能的实现方式中,所述第三设备接收所述配置设备发送的第四连接信息之后,还包括:With reference to the sixth possible implementation manner of the fourth aspect, in a seventh possible implementation manner of the fourth aspect, after the third device receives the fourth connection information sent by the configuration device, further include:
所述第三设备向所述第二设备发送第四消息,所述第四消息携带有所述第四连接信息,所述第四连接信息包括所述第四签名信息,以使得所述第二设备接收所述第三设备发送的第四消息,并根据所述第四消息携带的所述第四签名信息,以及所述第二签名验证密钥,确定所述第三设备是否合法,所述第二签名验证密钥由所述第一设备配置第二设备时,发送给第二设备。The third device sends a fourth message to the second device, the fourth message carries the fourth connection information, and the fourth connection information includes the fourth signature information, so that the second The device receives the fourth message sent by the third device, and determines whether the third device is legal according to the fourth signature information carried in the fourth message and the second signature verification key, and the The second signature verification key is sent to the second device when the first device configures the second device.
第五方面,本发明提供一种配置的装置,用于第三设备,所述第三设备位于配置系统,所述配置系统包括第一设备、第二设备、配置设备及第三设备,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信,所述配置设备与所述第三设备之间进行带内通信,所述第一设备已配置所述第二设备;所述装置包括: In a fifth aspect, the present invention provides a device for configuring a third device, the third device is located in a configuration system, and the configuration system includes a first device, a second device, a configuration device and a third device, the In-band communication is performed between the configuration device and the first device, out-of-band communication is performed between the configuration device and the second device, and in-band communication is performed between the configuration device and the third device. The first device has configured the second device; the apparatus includes:
接收单元,用于接收所述配置设备发送的第一签名验证密钥及第一网络密钥,所述第一签名验证密钥由所述第一设备生成并发送给所述配置设备,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一网络密钥由所述第一设备生成并发送给所述配置设备,所述第一网络密钥用于所述第二设备生成共享密钥;a receiving unit, configured to receive the first signature verification key and the first network key sent by the configuration device, the first signature verification key is generated by the first device and sent to the configuration device, the The first signature verification key is used to decrypt the information signed by the first device, the first network key is generated by the first device and sent to the configuration device, and the first network key is used to generating a shared key at the second device;
所述接收单元,还用于接收所述第二设备发送的第一消息,所述第一消息携带有第一连接信息,所述第一连接信息包括第一签名信息及对端网络密钥,所述第一签名信息由所述第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,所述第一签名生成密钥由所述第一设备生成,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备或所述第三设备生成共享密钥;The receiving unit is further configured to receive a first message sent by the second device, the first message carries first connection information, and the first connection information includes first signature information and a peer network key, The first signature information is obtained by the first device signing the second network key with a first signature generation key, the first signature generation key is generated by the first device, and the first signature generating a key for the first device to sign, the first signature generating key and the first signature verification key correspond to each other, the second network key is generated by the second device, The second network key is used by the first device or the third device to generate a shared key;
确定单元,用于根据所述接收单元接收的所述第一网络密钥,确定所述对端网络密钥是否合法;a determining unit, configured to determine whether the peer network key is legal according to the first network key received by the receiving unit;
所述确定单元,还用于当所述对端网络密钥合法时,根据所述接收单元接收的所述第一签名信息,确定所述第二设备是否合法。The determining unit is further configured to determine whether the second device is legal according to the first signature information received by the receiving unit when the peer network key is legal.
结合第五方面,在第五方面的第一种可能的实现方式中,In combination with the fifth aspect, in the first possible implementation of the fifth aspect,
所述确定单元,具体用于确定所述对端网络密钥是否为信任的网络密钥,所述信任的网络密钥包括所述第一网络密钥。The determining unit is specifically configured to determine whether the peer network key is a trusted network key, and the trusted network key includes the first network key.
结合第五方面,在第五方面的第二种可能的实现方式中,In combination with the fifth aspect, in the second possible implementation of the fifth aspect,
所述接收单元接收的所述第一连接信息还包括第二网络密钥;The first connection information received by the receiving unit further includes a second network key;
所述装置还包括:解密单元、比对单元;The device also includes: a decryption unit and a comparison unit;
所述解密单元,用于利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The decryption unit is configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result;
所述比对单元,用于将所述解密单元解密得到的所述解密结果,与所述第二网络密钥进行比对; The comparison unit is configured to compare the decryption result obtained by decrypting the decryption unit with the second network key;
所述确定单元,具体用于当所述比对单元比对所述解密结果与所述第二网络密钥匹配时,确定所述第二设备合法。The determining unit is specifically configured to determine that the second device is legal when the comparing unit compares that the decryption result matches the second network key.
结合第五方面的第二种可能的实现方式,在第五方面的第三种可能的实现方式中,所述装置还包括:生成单元;With reference to the second possible implementation manner of the fifth aspect, in a third possible implementation manner of the fifth aspect, the device further includes: a generating unit;
所述生成单元,用于至少根据所述接收单元接收的所述第二网络密钥,生成第三共享密钥,所述第三共享密钥为所述第三设备与所述第二设备之间进行握手认证的预先密钥。The generating unit is configured to generate a third shared key at least according to the second network key received by the receiving unit, and the third shared key is a link between the third device and the second device The pre-key for handshake authentication.
结合第五方面的第三种可能的实现方式,在第五方面的第四种可能的实现方式中,In combination with the third possible implementation of the fifth aspect, in the fourth possible implementation of the fifth aspect,
所述生成单元,具体包括按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第三共享密钥,所述第四网络密钥用于所述第二设备生成共享密钥;或者,The generating unit specifically includes generating a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and converting the DH A shared key, or a key derived from the DH shared key, is used as the third shared key, and the fourth network key is used by the second device to generate a shared key; or,
所述生成单元,具体包括按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据所述第四网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第三共享密钥。The generating unit specifically includes generating an ECDH key according to the private key corresponding to the fourth network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem. share a key, and use the ECDH shared key, or a key derived from the ECDH shared key, as the third shared key.
结合第五方面,在第五方面的第五种可能的实现方式中,In combination with the fifth aspect, in a fifth possible implementation of the fifth aspect,
所述生成单元,还用于生成第四网络密钥,所述第四网络密钥用于所述第二设备生成共享密钥;The generating unit is further configured to generate a fourth network key, where the fourth network key is used by the second device to generate a shared key;
所述装置还包括:发送单元;The device also includes: a sending unit;
所述发送单元,用于将所述生成单元生成的所述第四网络密钥发送给所述配置设备。The sending unit is configured to send the fourth network key generated by the generating unit to the configuration device.
结合第五方面的第五种可能的实现方式,在第五方面的第六种可能的实现方式中,In combination with the fifth possible implementation of the fifth aspect, in the sixth possible implementation of the fifth aspect,
所述接收单元,还用于接收所述配置设备发送的第四连接信息,所述第四连接信息包括第四签名信息及所述第四网络密钥,所述第四签名信息 由所述配置设备利用第二签名生成密钥对所述第四网络密钥进行签名得到,所述第二签名生成密钥及第二签名验证密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The receiving unit is further configured to receive fourth connection information sent by the configuration device, the fourth connection information includes fourth signature information and the fourth network key, and the fourth signature information obtained by the configuration device signing the fourth network key with a second signature generation key, the second signature generation key and the second signature verification key are generated by the configuration device, and the second The signature generation key is used for the configuration device to sign, the second signature verification key is used to decrypt the information signed by the configuration device, and the second signature generation key and the second signature verification key are used to decrypt the information signed by the configuration device. The keys correspond to each other.
结合第五方面的第六种可能的实现方式,在第五方面的第七种可能的实现方式中,In combination with the sixth possible implementation of the fifth aspect, in the seventh possible implementation of the fifth aspect,
所述发送单元,还用于向所述第二设备发送第四消息,所述第四消息携带有所述第四连接信息,所述第四连接信息包括所述第四签名信息,以使得所述第二设备接收所述第三设备发送的第四消息,并根据所述第四消息携带的所述第四签名信息,以及所述第二签名验证密钥,确定所述第三设备是否合法,所述第二签名验证密钥由所述第一设备配置第二设备时,发送给第二设备。The sending unit is further configured to send a fourth message to the second device, the fourth message carries the fourth connection information, and the fourth connection information includes the fourth signature information, so that the The second device receives the fourth message sent by the third device, and determines whether the third device is legitimate according to the fourth signature information carried in the fourth message and the second signature verification key , the second signature verification key is sent to the second device when the second device is configured by the first device.
第六方面,本发明提供一种设备,所述设备为第三设备,所述第三设备位于配置系统,所述配置系统包括第一设备、第二设备、配置设备及第三设备,其特征在于,所述配置设备与所述第一设备之间进行带内通信,所述配置设备与所述第二设备之间进行带外通信,所述配置设备与所述第三设备之间进行带内通信,所述第一设备已配置所述第二设备;所述第三设备包括:In a sixth aspect, the present invention provides a device, the device is a third device, and the third device is located in a configuration system, and the configuration system includes a first device, a second device, a configuration device and a third device, wherein The configuration device performs in-band communication with the first device, the configuration device performs out-of-band communication with the second device, and the configuration device performs out-of-band communication with the third device. Internal communication, the first device has configured the second device; the third device includes:
接收器,用于接收所述配置设备发送的第一签名验证密钥及第一网络密钥,所述第一签名验证密钥由所述第一设备生成并发送给所述配置设备,所述第一签名验证密钥用于对所述第一设备签名的信息进行解密,所述第一网络密钥由所述第一设备生成并发送给所述配置设备,所述第一网络密钥用于所述第二设备生成共享密钥;a receiver, configured to receive the first signature verification key and the first network key sent by the configuration device, the first signature verification key is generated by the first device and sent to the configuration device, the The first signature verification key is used to decrypt the information signed by the first device, the first network key is generated by the first device and sent to the configuration device, and the first network key is used to generating a shared key at the second device;
所述接收器,还用于接收所述第二设备发送的第一消息,所述第一消息携带有第一连接信息,所述第一连接信息包括第一签名信息及对端网络密钥,所述第一签名信息由所述第一设备利用第一签名生成密钥对第二网 络密钥进行签名得到,所述第一签名生成密钥由所述第一设备生成,所述第一签名生成密钥用于所述第一设备进行签名,所述第一签名生成密钥与所述第一签名验证密钥之间互相对应,所述第二网络密钥由所述第二设备生成,所述第二网络密钥用于所述第一设备或所述第三设备生成共享密钥;The receiver is further configured to receive a first message sent by the second device, the first message carries first connection information, and the first connection information includes first signature information and a peer network key, The first signature information is generated by the first device using the first signature to generate a key for the second network The first signature generation key is generated by the first device, the first signature generation key is used for the first device to perform signatures, and the first signature generation key is the same as The first signature verification keys correspond to each other, the second network key is generated by the second device, and the second network key is used by the first device or the third device to generate a shared key;
处理器,用于根据所述接收器接收的所述第一网络密钥,确定所述对端网络密钥是否合法;a processor, configured to determine whether the peer network key is legal according to the first network key received by the receiver;
所述处理器,还用于当所述对端网络密钥合法时,根据所述接收器接收的所述第一签名信息,确定所述第二设备是否合法。The processor is further configured to determine whether the second device is legal according to the first signature information received by the receiver when the peer network key is legal.
结合第六方面,在第六方面的第一种可能的实现方式中,In combination with the sixth aspect, in the first possible implementation of the sixth aspect,
所述处理器,具体用于确定所述对端网络密钥是否为信任的网络密钥,所述信任的网络密钥包括所述第一网络密钥。The processor is specifically configured to determine whether the peer network key is a trusted network key, where the trusted network key includes the first network key.
结合第六方面,在第六方面的第二种可能的实现方式中,In combination with the sixth aspect, in the second possible implementation of the sixth aspect,
所述接收器接收的所述第一连接信息还包括第二网络密钥;The first connection information received by the receiver further includes a second network key;
所述处理器,还用于利用所述第一签名验证密钥,对所述第一签名信息进行解密,得到解密结果;The processor is further configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result;
所述处理器,还用于将解密得到的所述解密结果,与所述第二网络密钥进行比对;The processor is further configured to compare the decryption result obtained by decryption with the second network key;
所述处理器,具体用于当所述解密结果与所述第二网络密钥匹配时,确定所述第二设备合法。The processor is specifically configured to determine that the second device is legal when the decryption result matches the second network key.
结合第六方面的第二种可能的实现方式,在第六方面的第三种可能的实现方式中,In combination with the second possible implementation of the sixth aspect, in the third possible implementation of the sixth aspect,
所述处理器,用于至少根据所述接收器接收的所述第二网络密钥,生成第三共享密钥,所述第三共享密钥为所述第三设备与所述第二设备之间进行握手认证的预先密钥。The processor is configured to generate a third shared key at least according to the second network key received by the receiver, and the third shared key is between the third device and the second device The pre-key for handshake authentication.
结合第六方面的第三种可能的实现方式,在第六方面的第四种可能的实现方式中, In combination with the third possible implementation of the sixth aspect, in the fourth possible implementation of the sixth aspect,
所述处理器,具体包括按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及所述第二网络密钥,生成DH共享密钥,并将所述DH共享密钥,或者由所述DH共享密钥衍生得到的密钥,作为所述第三共享密钥,所述第四网络密钥用于所述第二设备生成共享密;或者The processor specifically includes generating a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and converting the DH A shared key, or a key derived from the DH shared key, is used as the third shared key, and the fourth network key is used by the second device to generate a shared secret; or
所述处理器,具体包括按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据所述第四网络密钥对应的私钥,以及所述第二网络密钥,生成ECDH共享密钥,并将所述ECDH共享密钥,或者由所述ECDH共享密钥衍生得到的密钥,作为所述第三共享密钥。The processor specifically includes, according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, according to the private key corresponding to the fourth network key and the second network key, to generate an ECDH key. share a key, and use the ECDH shared key, or a key derived from the ECDH shared key, as the third shared key.
结合第六方面,在第六方面的第五种可能的实现方式中,In combination with the sixth aspect, in the fifth possible implementation of the sixth aspect,
所述处理器,还用于生成第四网络密钥,所述第四网络密钥用于所述第二设备生成共享密钥;The processor is further configured to generate a fourth network key, where the fourth network key is used by the second device to generate a shared key;
所述第三设备还包括:发送器;The third device also includes: a transmitter;
所述发送器,用于将所述处理器生成的所述第四网络密钥发送给所述配置设备。The sender is configured to send the fourth network key generated by the processor to the configuration device.
结合第六方面的第五种可能的实现方式,在第六方面的第六种可能的实现方式中,In combination with the fifth possible implementation of the sixth aspect, in the sixth possible implementation of the sixth aspect,
所述接收器,还用于接收所述配置设备发送的第四连接信息,所述第四连接信息包括第四签名信息及所述第四网络密钥,所述第四签名信息由所述配置设备利用第二签名生成密钥对所述第四网络密钥进行签名得到,所述第二签名生成密钥及第二签名验证密钥由所述配置设备生成,所述第二签名生成密钥用于所述配置设备进行签名,所述第二签名验证密钥用于对所述配置设备签名的信息进行解密,所述第二签名生成密钥与所述第二签名验证密钥之间互相对应。The receiver is further configured to receive fourth connection information sent by the configuration device, the fourth connection information includes fourth signature information and the fourth network key, and the fourth signature information is provided by the configuration device. The device signs the fourth network key by using a second signature generation key, the second signature generation key and the second signature verification key are generated by the configuration device, and the second signature generation key Used for the configuration device to sign, the second signature verification key is used to decrypt the information signed by the configuration device, and the second signature generation key and the second signature verification key are mutually correspond.
结合第六方面的第六种可能的实现方式,在第六方面的第七种可能的实现方式中,In combination with the sixth possible implementation of the sixth aspect, in the seventh possible implementation of the sixth aspect,
所述发送器,还用于向所述第二设备发送第四消息,所述第四消息携带有所述第四连接信息,所述第四连接信息包括所述第四签名信息,以使 得所述第二设备接收所述第三设备发送的第四消息,并根据所述第四消息携带的所述第四签名信息,以及所述第二签名验证密钥,确定所述第三设备是否合法,所述第二签名验证密钥由所述第一设备配置第二设备时,发送给第二设备。The sender is further configured to send a fourth message to the second device, where the fourth message carries the fourth connection information, and the fourth connection information includes the fourth signature information, so that The second device receives the fourth message sent by the third device, and according to the fourth signature information carried in the fourth message and the second signature verification key, determines that the third device Whether it is legal or not, the second signature verification key is sent to the second device when the first device configures the second device.
本发明提供的配置的方法、配置的装置及设备,首先配置设备与第二设备进行带外通信,获得第二设备带外密钥,并将第二设备带外密钥发送给第一设备,以使得第一设备根据第二设备带外密钥生成加密密钥,然后第一设备生成第一签名生成密钥及第一签名验证密钥,并接收第二设备发送的第二网络密钥,最后第一设备根据第一签名生成密钥,对第二网络密钥进行签名,得到第一签名信息,并向第二设备发送根据加密密钥加密后的第一连接信息,第一连接信息包括第一签名信息及第二网络密钥。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明通过配置设备与第二设备之间进行带外通信,获得第二设备带外密钥,并将该第二设备带外密钥发送给第一设备,能够使得第一设备与第二设备之间进行通信,从而可以实现第一设备对第二设备进行配置,即当配置设备与第二设备之间不能进行带内通信时,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,可以由第一设备对第二设备进行配置,进而可以提高设备进行配置的成功率。The configuration method, configuration device, and equipment provided by the present invention firstly configure the equipment to perform out-of-band communication with the second equipment, obtain the out-of-band key of the second equipment, and send the out-of-band key of the second equipment to the first equipment, so that the first device generates an encryption key according to the out-of-band key of the second device, and then the first device generates a first signature generation key and a first signature verification key, and receives the second network key sent by the second device, Finally, the first device generates a key according to the first signature, signs the second network key, obtains the first signature information, and sends the first connection information encrypted according to the encryption key to the second device. The first connection information includes The first signature information and the second network key. Compared with currently configuring the first device and the second device separately through the configuration device, the present invention obtains the out-of-band key of the second device through out-of-band communication between the configuration device and the second device, and transfers the second device The out-of-band key is sent to the first device, enabling communication between the first device and the second device, so that the first device can configure the second device, that is, when the configuration device and the second device cannot communicate with each other For in-band communication, for example, if a certain device does not support in-band communication, or the configuration device does not match the in-band communication mode supported by a certain device, the first device can configure the second device, thereby improving the configuration efficiency of the device. Success rate.
本发明提供的配置的方法、配置的装置及设备,当第一设备已配置第二设备时,首先配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第一签名验证密钥及第一网络密钥由第一设备生成并发送给配置设备,然后第二设备向第三设备发送携带有第一连接信息的第一消息,第一连接信息包括第一签名信息及对端网络密钥,最后第三设备根据第一网络密钥,确定对端网络密钥是否合法,若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明通过第一设备根据第二设备带外密钥对第二设备进行配置,该第二设备带外密钥由配置设备与第二设备之 间进行带外通信获得,并且配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第二设备向第三设备发送第一连接信息,能够实现第三设备根据第一网络密钥,确定第一连接信息中的对端网络密钥是否合法,并根据第一签名验证密钥,确定第一连接信息中的第一签名信息是否合法,从而可以将第一设备已配置的第二设备,配置给第三设备,即实现第三设备配置第二设备,进而可以提高设备进行配置的成功率。According to the configuration method, configuration device and equipment provided by the present invention, when the first device has configured the second device, the configuration device first sends the first signature verification key and the first network key to the third device, and the first signature verification key The key and the first network key are generated by the first device and sent to the configuration device, and then the second device sends a first message carrying the first connection information to the third device, and the first connection information includes the first signature information and the Finally, the third device determines whether the peer network key is legal according to the first network key. If the peer network key is legal, the third device determines whether the second device is legal according to the first signature information. Compared with currently configuring the first device and the second device separately through the configuration device, the present invention configures the second device through the first device according to the out-of-band key of the second device, and the out-of-band key of the second device is determined by the configuration between the device and the second device and the configuration device sends the first signature verification key and the first network key to the third device, and the second device sends the first connection information to the third device. Key to determine whether the peer network key in the first connection information is legal, and determine whether the first signature information in the first connection information is legal according to the first signature verification key, so that the configured The second device is configured to the third device, that is, the third device configures the second device, thereby improving the success rate of device configuration.
为了更清楚地说明本发明或现有技术中的技术方案,下面将对本发明或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the present invention or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only the present invention. For some embodiments of the present invention, those skilled in the art can also obtain other drawings according to these drawings without paying creative efforts.
图1为本发明实施例中配置系统的系统架构示意图;FIG. 1 is a schematic diagram of a system architecture of a configuration system in an embodiment of the present invention;
图2为本发明实施例中配置的方法流程图;FIG. 2 is a flowchart of a method configured in an embodiment of the present invention;
图3为本发明实施例中另一种配置的方法流程图;Fig. 3 is a method flow chart of another configuration in the embodiment of the present invention;
图4为本发明实施例中另一种配置系统的系统架构示意图;FIG. 4 is a schematic diagram of a system architecture of another configuration system in an embodiment of the present invention;
图5为本发明实施例中另一种配置的方法流程图;Fig. 5 is a method flow chart of another configuration in the embodiment of the present invention;
图6为本发明实施例中另一种配置的方法流程图;Fig. 6 is a method flow chart of another configuration in the embodiment of the present invention;
图7为本发明实施例中配置的装置结构示意图;FIG. 7 is a schematic structural diagram of a device configured in an embodiment of the present invention;
图8为本发明实施例中另一种配置的装置结构示意图;FIG. 8 is a schematic structural diagram of another configuration of the device in the embodiment of the present invention;
图9为本发明实施例中第一设备的结构示意图;Fig. 9 is a schematic structural diagram of the first device in the embodiment of the present invention;
图10为本发明实施例中另一种配置的装置结构示意图;FIG. 10 is a schematic structural diagram of another configuration of the device in the embodiment of the present invention;
图11为本发明实施例中另一种配置的装置结构示意图;Fig. 11 is a schematic structural diagram of another configuration of the device in the embodiment of the present invention;
图12为本发明实施例中第三设备的结构示意图。Fig. 12 is a schematic structural diagram of a third device in an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没 有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, those of ordinary skill in the art All other embodiments obtained under the premise of making creative work belong to the protection scope of the present invention.
本发明实施例提供的技术方案,应用于配置系统中,本发明的系统架构如图1所示,该配置系统包括第一设备、第二设备及配置设备。其中,配置设备与第一设备之间可以进行带内通信,配置设备与第二设备之间可以进行带外通信。The technical solutions provided by the embodiments of the present invention are applied to a configuration system. The system architecture of the present invention is shown in FIG. 1 , and the configuration system includes a first device, a second device, and a configuration device. Wherein, in-band communication can be performed between the configuration device and the first device, and out-of-band communication can be performed between the configuration device and the second device.
本发明实施例提供一种配置的方法,能够提高设备进行配置的成功率,如图2所示,所述方法包括:The embodiment of the present invention provides a configuration method, which can improve the success rate of device configuration. As shown in FIG. 2, the method includes:
201、第一设备接收配置设备发送的第二设备带外密钥。201. The first device receives the out-of-band key of the second device sent by the configuration device.
其中,第二设备带外密钥由配置设备通过与第二设备之间进行带外通信获得。Wherein, the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device.
对于本发明实施例,第一设备支持带内通信,可以与配置设备之间进行带内通信,也可以与第二设备之间进行带内通信。在本发明实施例中,第一设备具体可以为:无线接入点(英文全称:Access Point,英文缩写:AP)、智能终端、可穿戴设备或智能家居设备等。其中,智能终端包括手机、手机平板、平板及电脑等,可穿戴设备包括智能眼镜、智能手表、智能手环、智能戒指、智能项链、智能鞋子、智能帽子、智能头盔、智能衣服及智能护膝等,智能家居包括智能电视、智能音响、智能冰箱、智能洗衣机、智能空调、智能灯具、智能窗帘及智能报警器等。For the embodiment of the present invention, the first device supports in-band communication, and can perform in-band communication with the configuration device, and can also perform in-band communication with the second device. In the embodiment of the present invention, the first device may specifically be: a wireless access point (English full name: Access Point, English abbreviation: AP), a smart terminal, a wearable device, or a smart home device. Among them, smart terminals include mobile phones, mobile tablets, tablets and computers, etc., and wearable devices include smart glasses, smart watches, smart bracelets, smart rings, smart necklaces, smart shoes, smart hats, smart helmets, smart clothes and smart knee pads, etc. , smart homes include smart TVs, smart speakers, smart refrigerators, smart washing machines, smart air conditioners, smart lamps, smart curtains and smart alarms.
对于本发明实施例,配置设备用于对设备进行配置,或者协助设备对其他设备进行配置。在本发明实施例中,配置设备可以为外部配置设备,也可以为内部配置设备,本发明实施例不做限定。其中,外部配置设备可以为具有丰富UI及较强大的计算能力的无线设备,例如,外部配置设备可以为智能手机、智能平板、智能眼镜或智能手表等,也可以为安装有相关应用程序单元的其他设备;内部配置设备也可以为一套应用程序模块,集成在硬件单元内,并可以通过该硬件单元提供的UI与其他设备进行交互,例如,内部配置设备可以为集成在无线AP中的配置单元,此时,该配置 单元可以通过无线AP的输入模块实现配置过程中的输入,通过无线AP的输出模块实现配置过程中的输出,即认为配置单元的输入模块为无线AP的输入模块,配置单元的输出模块为无线AP的输出模块。For the embodiment of the present invention, the configuration device is used to configure the device, or assist the device to configure other devices. In this embodiment of the present invention, the configuration device may be an external configuration device or an internal configuration device, which is not limited in this embodiment of the present invention. Wherein, the external configuration device can be a wireless device with a rich UI and relatively powerful computing capability, for example, the external configuration device can be a smart phone, a smart tablet, smart glasses or a smart watch, etc., or it can be a Other devices; the internal configuration device can also be a set of application modules integrated in the hardware unit, and can interact with other devices through the UI provided by the hardware unit. For example, the internal configuration device can be a configuration integrated in the wireless AP unit, at this time, the configuration The unit can realize the input during the configuration process through the input module of the wireless AP, and realize the output during the configuration process through the output module of the wireless AP, that is, the input module of the configuration unit is considered to be the input module of the wireless AP, and the output module of the configuration unit is the wireless AP output module.
对于本发明实施例,带内通信是指通信距离相对较长的通信方式,带外通信是指通信距离相对较短的通信方式。具体地,带内通信可以为:蓝牙、蓝牙低功耗、无线保真(英文全称:Wireless Fidelity,英文缩写:Wi-Fi)、ZigBee(基于IEEE802.15.4标准的低功耗局域网协议)、超宽带(英文全称:Ultra Wide Band,英文缩写:UWB)或无线千兆比特(英文全称:Wireless Gigabit,英文缩写:WiGig)等;带外通信可以为:射频识别(英文全称:Radio Frequency Identification,英文缩写:RFID)、近场通信(英文全称:Near Field Communication,英文缩写:NFC)、红外、激光、超声波、电容屏短距传输、光学识别或声学识别等。For the embodiment of the present invention, in-band communication refers to a communication method with a relatively long communication distance, and out-of-band communication refers to a communication method with a relatively short communication distance. Specifically, the in-band communication can be: Bluetooth, Bluetooth Low Energy, Wireless Fidelity (English full name: Wireless Fidelity, English abbreviation: Wi-Fi), ZigBee (a low-power LAN protocol based on the IEEE802.15.4 standard), Ultra Broadband (English full name: Ultra Wide Band, English abbreviation: UWB) or wireless gigabit (English full name: Wireless Gigabit, English abbreviation: WiGig), etc.; out-of-band communication can be: radio frequency identification (English full name: Radio Frequency Identification, English Abbreviation: RFID), near field communication (English full name: Near Field Communication, English abbreviation: NFC), infrared, laser, ultrasonic, capacitive screen short-distance transmission, optical identification or acoustic identification, etc.
例如,当配置设备与第二设备之间进行带外通信的方式为光学识别时,首先第二设备提供一个包含第二设备带外密钥的二维码;然后配置设备通过自身的摄像头模块扫描该二维码,并进行解码获得验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For example, when the way of out-of-band communication between the configuration device and the second device is optical identification, the second device first provides a QR code containing the second device’s out-of-band key; then the configuration device scans the The two-dimensional code is decoded to obtain the verification information material; finally, the configuration device obtains the verification information according to the verification information material and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that The first device acquires verification information according to the verification information material.
再例如,当配置设备与第二设备之间进行带外通信的方式为声学识别时,首先第二设备通过自身的声学模块播放验证信息材料,然后配置设备收听该验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For another example, when the way of out-of-band communication between the configured device and the second device is acoustic recognition, the second device first plays the verification information material through its own acoustic module, and then configures the device to listen to the verification information material; finally configures the device according to The verification information material obtains verification information and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that the first device obtains verification information according to the verification information material.
对于本发明实施例,带外通信与带内通信均为相对概念,并不限于上述对带外通信及带内通信的举例,其他任何相对距离较短的通信方式均可以认为是带外通信,相对距离较长的通信方式均可以认为是带内通信,例如,蓝牙相对于Wi-Fi的通信距离较短,因此,当Wi-Fi作为带内通信时, 蓝牙可以作为带外通信。For the embodiment of the present invention, both out-of-band communication and in-band communication are relative concepts, and are not limited to the above-mentioned examples of out-of-band communication and in-band communication. Any other communication methods with relatively short distances can be considered as out-of-band communication. Communication methods with a relatively long distance can be considered as in-band communication. For example, Bluetooth has a shorter communication distance than Wi-Fi. Therefore, when Wi-Fi is used as in-band communication, Bluetooth can be used as out-of-band communication.
需要说明的是,本发明实施例不限于上述配置设备与第二设备之间进行带外通信,其他任何可以实现配置设备与第二设备之间进行通信的方式,均适用本发明实施例,例如,配置设备与第二设备之间可以进行带内通信。It should be noted that the embodiment of the present invention is not limited to the out-of-band communication between the above-mentioned configuration device and the second device, and any other method that can realize the communication between the configuration device and the second device is applicable to the embodiment of the present invention, for example , in-band communication can be performed between the configuration device and the second device.
对于本发明实施例,验证信息材料与验证信息之间,可以通过特定的编解码方式进行互相转换,也可以为相同的信息,本发明实施例不做限定。其中,当验证信息材料与验证信息之间需要进行互相转换时,可以直接通过base64/32/16(64/32/16进制)编码方式,实现互相转换;也可以首先通过base64/32/16进行编码,然后通过抽象语法标记(英文全称:Abstract Syntax Notation One,英文缩写:ASN.1)编码方式,实现互相转换。For the embodiment of the present invention, the verification information material and the verification information may be mutually converted through a specific encoding and decoding method, or may be the same information, which is not limited in the embodiment of the present invention. Among them, when the mutual conversion between the verification information material and the verification information is required, the mutual conversion can be realized directly through base64/32/16 (64/32/16 hexadecimal) encoding; or first through base64/32/16 Coding, and then through the abstract syntax notation (English full name: Abstract Syntax Notation One, English abbreviation: ASN.1) coding method, to achieve mutual conversion.
可选地,步骤201之后,还可以包括:第一设备确定第二设备带外密钥是否合法。Optionally, after step 201, the method may further include: the first device determines whether the out-of-band key of the second device is valid.
可选地,第一设备可以通过确定第二设备是否存储有第二设备带外密钥对应的私钥,从而确定第二设备带外密钥是否合法。具体地,若第二设备存储有第二设备带外密钥对应的私钥,则第一设备确定第二设备合法。其中,第二设备带外密钥对应的私钥与第二设备带外密钥之间互相对应。Optionally, the first device may determine whether the second device's out-of-band key is legitimate by determining whether the second device stores a private key corresponding to the second device's out-of-band key. Specifically, if the second device stores a private key corresponding to the second device's out-of-band key, the first device determines that the second device is legal. Wherein, the private key corresponding to the out-of-band key of the second device corresponds to the out-of-band key of the second device.
对于本发明实施例,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为非对称密钥时,第二设备带外密钥对应的私钥为私钥,第二设备带外密钥为公钥;或者,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为对称密钥时,第二设备带外密钥对应的私钥与第二设备带外密钥相同。For the embodiment of the present invention, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are asymmetric keys, the private key corresponding to the out-of-band key of the second device is a private key, The out-of-band key of the second device is a public key; or, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are symmetric keys, the corresponding The private key is the same as the second device out-of-band key.
202、第一设备根据第二设备带外密钥,生成加密密钥。202. The first device generates an encryption key according to the out-of-band key of the second device.
对于本发明实施例,第二设备带外密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。For this embodiment of the present invention, the out-of-band key of the second device may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention.
可选地,当第二设备带外密钥为对称密钥时,第一设备可以直接将该第二设备带外密钥,作为加密密钥。 Optionally, when the out-of-band key of the second device is a symmetric key, the first device may directly use the out-of-band key of the second device as an encryption key.
可替换地,当第二设备带外密钥为非对称密钥时,第一设备首先生成一对非对称的临时密钥,分别为第一设备临时私钥及第一设备临时公钥,然后根据第一设备临时私钥及第二设备带外密钥,生成加密密钥。Alternatively, when the second device's out-of-band key is an asymmetric key, the first device first generates a pair of asymmetric temporary keys, which are the first device's temporary private key and the first device's temporary public key, and then An encryption key is generated according to the temporary private key of the first device and the out-of-band key of the second device.
对于本发明实施例,第一设备生成第一设备临时私钥及第一设备临时公钥后,可以将第一设备临时公钥发送给第二设备,以使得第二设备获取第一设备临时公钥,并根据该第一设备临时公钥,及本地存储的第二设备带外密钥对应的私钥,生成第二加密密钥。其中,第二加密密钥用于对第一设备加密后的信息进行解密。For the embodiment of the present invention, after the first device generates the temporary private key of the first device and the temporary public key of the first device, it can send the temporary public key of the first device to the second device, so that the second device can obtain the temporary public key of the first device. key, and generate a second encryption key according to the temporary public key of the first device and the private key corresponding to the locally stored out-of-band key of the second device. Wherein, the second encryption key is used to decrypt the encrypted information of the first device.
需要说明的是,本领域技术人员能够理解,第一设备根据第一设备临时私钥及第二设备带外密钥生成的加密密钥,与第二设备根据第一设备临时公钥及第二设备带外密钥对应的私钥生成的第二加密密钥相同。It should be noted that those skilled in the art can understand that the encryption key generated by the first device based on the temporary private key of the first device and the out-of-band key of the second device, and the encryption key generated by the second device based on the temporary public key of the first device and the second The second encryption key generated by the private key corresponding to the out-of-band key of the device is the same.
对于本发明实施例,加密密钥用于对第一设备向第二设备发送的信息进行加密。For this embodiment of the present invention, the encryption key is used to encrypt information sent by the first device to the second device.
具体地,第一设备可以直接根据加密密钥,对需要发送给第二设备的信息进行加密;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,然后根据转换后的加密密钥,对需要发送给第二设备的信息进行加密。Specifically, the first device can directly encrypt the information to be sent to the second device according to the encryption key; the first device can also first convert the encryption key to obtain the converted encryption key, and then according to The encryption key for encrypting the information to be sent to the second device.
对于本发明实施例,第一设备对加密密钥进行转换的方式,可以为直接通过base64/32/16编码方式,对加密密钥进行转换,得到转换后的加密密钥;也可以首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对加密密钥进行转换,得到转换后的加密密钥。For the embodiment of the present invention, the way the first device converts the encryption key may be to convert the encryption key directly through the base64/32/16 encoding method to obtain the converted encryption key; it may also first pass the base64 /32/16 to encode, and then convert the encryption key through the ASN.1 encoding method to obtain the converted encryption key.
对于本发明实施例,当第一设备根据转换后的加密密钥,对需要发送给第二设备的信息进行加密时,第二设备按照转换后的第二加密密钥,对第一设备加密后的信息进行解密。具体地,第二设备首先按照与第一设备同样的转换方式,将第二加密密钥进行转换,得到转换后的第二加密密钥,然后按照转换后的第二加密密钥,对第一设备加密后的信息进行解密。For the embodiment of the present invention, when the first device encrypts the information to be sent to the second device according to the converted encryption key, the second device encrypts the first device according to the converted second encryption key. information is decrypted. Specifically, the second device first converts the second encryption key in the same conversion manner as that of the first device to obtain the converted second encryption key, and then according to the converted second encryption key, converts the first The encrypted information of the device is decrypted.
203、第一设备生成第一签名生成密钥及第一签名验证密钥。 203. The first device generates a first signature generation key and a first signature verification key.
其中,第一签名生成密钥及第一签名验证密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名验证密钥用于对第一设备签名的信息进行解密,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key and the first signature verification key are generated by the first device, the first signature generation key is used for the first device to sign, and the first signature verification key is used for signing information of the first device For decryption, the first signature generation key and the first signature verification key correspond to each other.
可选地,步骤203之后,还可以包括:第一设备向第二设备发送加密后的第一签名验证密钥。其中,加密后的第一签名验证密钥由第一设备利用第三密钥对第一签名验证密钥进行加密得到,第三密钥由第一设备根据加密密钥得到。Optionally, after step 203, the method may further include: the first device sends the encrypted first signature verification key to the second device. Wherein, the encrypted first signature verification key is obtained by the first device by encrypting the first signature verification key with a third key, and the third key is obtained by the first device according to the encryption key.
对于本发明实施例,第一设备可以直接将加密密钥作为第三密钥,并根据该第三密钥对第一签名验证密钥进行加密,得到加密后的第一签名验证密钥;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第三密钥,并根据该第三密钥对第一签名验证密钥进行加密,得到加密后的第一签名验证密钥。For this embodiment of the present invention, the first device may directly use the encryption key as the third key, and encrypt the first signature verification key according to the third key to obtain the encrypted first signature verification key; A device may first convert the encryption key to obtain the converted encryption key as the third key, and encrypt the first signature verification key according to the third key to obtain the encrypted first signature Verify key.
对于本发明实施例,第一设备生成一对签名密钥,分别为第一签名验证密钥及第一签名生成密钥。其中,第一签名验证密钥用于发送给其他设备,以使得其他设备可以通过该第一签名验证密钥,对第一设备签名的信息进行解密;第一签名生成密钥用于第一设备进行签名。For this embodiment of the present invention, the first device generates a pair of signature keys, which are respectively the first signature verification key and the first signature generation key. Wherein, the first signature verification key is used to send to other devices, so that other devices can decrypt the information signed by the first device through the first signature verification key; the first signature generation key is used by the first device to sign.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
204、第一设备接收第二设备发送的第二网络密钥。204. The first device receives the second network key sent by the second device.
其中,第二网络密钥由第二设备生成,第二网络密钥用于第一设备生成共享密钥。Wherein, the second network key is generated by the second device, and the second network key is used by the first device to generate a shared key.
需要说明的是,本发明实施例不限于上述第一设备根据第二网络密钥生成共享密钥,其他任何可以与第二设备进行通信的设备,均可以根据第二网络密钥生成共享密钥。 It should be noted that this embodiment of the present invention is not limited to the first device generating a shared key based on the second network key, and any other device that can communicate with the second device can generate a shared key based on the second network key .
对于本发明实施例,第二网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第二网络密钥为非对称密钥时,第二网络密钥可以为迪菲赫尔曼(英文全称:Diffie-Hellman,英文缩写:DH)公钥;也可以为基于椭圆曲线密码体制(英文全称:Elliptic Curve Cryptosystems,英文缩写:ECC)的迪菲赫尔曼(英文缩写:ECDH)公钥;还可以为ECDH公钥的X坐标或Y坐标。For this embodiment of the present invention, the second network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the second network key is an asymmetric key, the second network key may be a Diffie-Hellman (English full name: Diffie-Hellman, English abbreviation: DH) public key; It is the Diffie Herman (English abbreviation: ECDH) public key based on Elliptic Curve Cryptosystems (English full name: Elliptic Curve Cryptosystems, English abbreviation: ECC); it can also be the X coordinate or Y coordinate of the ECDH public key.
对于本发明实施例,第二网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第二网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the second network key may also be a result obtained by further encoding the key. For example, the second network key is the result obtained by directly encoding the DH key through base64/32/16, or it can also be obtained by first encoding the DH key through base64/32/16 and then encoding it through ASN.1 The result can also be the result obtained by directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key can be first encoded through base64/32/16, and then through ASN. 1 to encode the result.
205、第一设备利用第一签名生成密钥对第二网络密钥进行签名,得到第一签名信息。205. The first device signs the second network key by using the first signature generation key to obtain first signature information.
其中,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, and the first signature generation key and the first signature verification key correspond to each other.
206、第一设备向第二设备发送加密后的第一连接信息。206. The first device sends the encrypted first connection information to the second device.
其中,第一连接信息包括第一签名信息及第二网络密钥,加密后的第一连接信息由第一设备利用第一密钥对第一连接信息进行加密得到,第一密钥由第一设备根据加密密钥得到。Wherein, the first connection information includes the first signature information and the second network key, and the encrypted first connection information is obtained by encrypting the first connection information by the first device using the first key, and the first key is obtained by the first The device is derived from the encryption key.
对于本发明实施例,第一设备可以直接将加密密钥作为第一密钥,并根据该第一密钥对第一连接信息进行加密,得到加密后的第一签名验证密钥;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第一密钥,并根据该第一密钥对第一连接信息进行加密,得到加密后的第一签名验证密钥。For the embodiment of the present invention, the first device may directly use the encryption key as the first key, and encrypt the first connection information according to the first key to obtain the encrypted first signature verification key; the first device Alternatively, the encryption key may be converted first to obtain the converted encryption key as the first key, and the first connection information may be encrypted according to the first key to obtain the encrypted first signature verification key.
对于本发明实施例,连接信息具体可以包括:网络标识信息、对端网络密钥信息、待配置网络密钥信息、配置设备标识信息及配置设备的签名 信息。For the embodiment of the present invention, the connection information may specifically include: network identification information, peer network key information, network key information to be configured, configuration device identification information, and configuration device signature information.
进一步地,通过第一设备向第二设备发送第一连接信息,以使得第二设备获取并向第一设备发送第一连接信息,第一连接信息用于第一设备确定第二设备是否合法。Further, the first device sends the first connection information to the second device, so that the second device obtains and sends the first connection information to the first device, and the first connection information is used by the first device to determine whether the second device is legitimate.
本发明实施例提供的配置的方法,首先配置设备与第二设备进行带外通信,获得第二设备带外密钥,并将第二设备带外密钥发送给第一设备,以使得第一设备根据第二设备带外密钥生成加密密钥,然后第一设备生成第一签名生成密钥及第一签名验证密钥,并接收第二设备发送的第二网络密钥,最后第一设备根据第一签名生成密钥,对第二网络密钥进行签名,得到第一签名信息,并向第二设备发送根据加密密钥加密后的第一连接信息,第一连接信息包括第一签名信息及第二网络密钥。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过配置设备与第二设备之间进行带外通信,获得第二设备带外密钥,并将该第二设备带外密钥发送给第一设备,能够使得第一设备与第二设备之间进行通信,从而可以实现第一设备对第二设备进行配置,即当配置设备与第二设备之间不能进行带内通信时,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,可以由第一设备对第二设备进行配置,进而可以提高设备进行配置的成功率。The configuration method provided by the embodiment of the present invention firstly configures the device to perform out-of-band communication with the second device, obtains the out-of-band key of the second device, and sends the out-of-band key of the second device to the first device, so that the first device The device generates an encryption key according to the out-of-band key of the second device, then the first device generates a first signature generation key and a first signature verification key, and receives the second network key sent by the second device, and finally the first device Generate a key according to the first signature, sign the second network key, obtain the first signature information, and send the first connection information encrypted according to the encryption key to the second device, the first connection information includes the first signature information and a second network key. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention obtains the out-of-band key of the second device through out-of-band communication between the configuration device and the second device, and transfers the second device The two-device out-of-band key is sent to the first device, enabling communication between the first device and the second device, so that the first device can configure the second device, that is, when the configuration device and the second device cannot When performing in-band communication, for example, if a certain device does not support in-band communication, or the configured device does not match the in-band communication mode supported by a certain device, the first device can configure the second device to improve the performance of the device. configuration success rate.
作为对图2所示方法的具体说明,本发明实施例提供另一种配置的方法,如图3所示,所述方法包括:As a specific description of the method shown in Figure 2, the embodiment of the present invention provides another configuration method, as shown in Figure 3, the method includes:
301、第一设备接收配置设备发送的第二签名验证密钥。301. The first device receives the second signature verification key sent by the configuration device.
对于本发明实施例,第一设备支持带内通信,可以与配置设备之间进行带内通信,也可以与第二设备之间进行带内通信。在本发明实施例中,第一设备具体可以为:无线AP、智能终端、可穿戴设备或智能家居设备等。其中,智能终端包括手机、手机平板、平板及电脑等,可穿戴设备包括智能眼镜、智能手表、智能手环、智能戒指、智能项链、智能鞋子、智能帽子、智能头盔、智能衣服及智能护膝等,智能家居包括智能电视、智 能音响、智能冰箱、智能洗衣机、智能空调、智能灯具、智能窗帘及智能报警器等。For the embodiment of the present invention, the first device supports in-band communication, and can perform in-band communication with the configuration device, and can also perform in-band communication with the second device. In the embodiment of the present invention, the first device may specifically be: a wireless AP, a smart terminal, a wearable device, or a smart home device, and the like. Among them, smart terminals include mobile phones, mobile tablets, tablets and computers, etc., and wearable devices include smart glasses, smart watches, smart bracelets, smart rings, smart necklaces, smart shoes, smart hats, smart helmets, smart clothes and smart knee pads, etc. , smart home includes smart TV, smart Smart speakers, smart refrigerators, smart washing machines, smart air conditioners, smart lamps, smart curtains and smart alarms, etc.
对于本发明实施例,配置设备用于对设备进行配置,或者协助设备对其他设备进行配置。在本发明实施例中,配置设备可以为外部配置设备,也可以为内部配置设备,本发明实施例不做限定。其中,外部配置设备可以为具有丰富用户界面(英文全称:User Interface,英文缩写:UI)及较强大的计算能力的无线设备,例如,外部配置设备可以为智能手机、智能平板、智能眼镜或智能手表等,也可以为安装有相关应用程序单元的其他设备;内部配置设备也可以为一套应用程序模块,集成在硬件单元内,并可以通过该硬件单元提供的UI与其他设备进行交互,例如,内部配置设备可以为集成在无线AP中的配置单元,该配置单元可以通过无线AP的输入单元实现配置过程中的输入,通过无线AP的输出单元实现配置过程中的输出。For the embodiment of the present invention, the configuration device is used to configure the device, or assist the device to configure other devices. In this embodiment of the present invention, the configuration device may be an external configuration device or an internal configuration device, which is not limited in this embodiment of the present invention. Among them, the external configuration device can be a wireless device with a rich user interface (English full name: User Interface, English abbreviation: UI) and relatively powerful computing capabilities. For example, the external configuration device can be a smart phone, a smart tablet, smart glasses or a smart phone. Watches, etc., can also be other devices with related application units installed; internal configuration devices can also be a set of application modules integrated in the hardware unit, and can interact with other devices through the UI provided by the hardware unit, for example , the internal configuration device can be a configuration unit integrated in the wireless AP, the configuration unit can realize the input during the configuration process through the input unit of the wireless AP, and realize the output during the configuration process through the output unit of the wireless AP.
其中,第二签名验证密钥由配置设备生成,第二签名验证密钥用于对配置设备签名的信息进行解密。在本发明实施例中,配置设备生成一对签名密钥,分别为第二签名验证密钥及第二签名生成密钥。其中,第二签名验证密钥用于发送给其他设备,以使得其他设备可以通过该第二签名验证密钥,对第二设备签名的信息进行解密;第二签名生成密钥用于配置设备进行签名。Wherein, the second signature verification key is generated by the configuration device, and the second signature verification key is used to decrypt the information signed by the configuration device. In the embodiment of the present invention, the configuration device generates a pair of signature keys, which are respectively the second signature verification key and the second signature generation key. Wherein, the second signature verification key is used to send to other devices, so that other devices can decrypt the information signed by the second device through the second signature verification key; the second signature generation key is used to configure the device to perform sign.
对于本发明实施例,第二签名验证密钥可以用C-sign-key1来指代,第二签名生成密钥可以用C-sign-key2来指代。在本发明实施例中,A用于标识第一设备,B用于标识第二设备,C用于标识配置设备,sign用于表示签名(Signature),key用于表示密钥,key1用于表示验证密钥,key2用于表示生成密钥,net用于表示网络(network),pub用于表示公共(public),priv用于表示私有(private)。For this embodiment of the present invention, the second signature verification key may be referred to by C-sign-key1, and the second signature generation key may be referred to by C-sign-key2. In this embodiment of the present invention, A is used to identify the first device, B is used to identify the second device, C is used to identify the configuration device, sign is used to indicate a signature (Signature), key is used to indicate a key, and key1 is used to indicate The verification key, key2 is used to represent the generated key, net is used to represent the network (network), pub is used to represent the public (public), and priv is used to represent the private (private).
需要说明的是,本发明实施例不限于上述对各设备的标识方式,及对各密钥的标识方式,其他任何可以用于标识设备或密钥的方式,均适用本 发明实施例。It should be noted that the embodiments of the present invention are not limited to the above-mentioned identification methods for each device and each key, and any other methods that can be used to identify devices or keys are applicable to this Invention Example.
302、第一设备生成第一网络密钥。302. The first device generates a first network key.
其中,第一网络密钥用于第二设备生成共享密钥。在本发明实施例中,第一网络密钥可以用A-net-pub来指代。Wherein, the first network key is used by the second device to generate a shared key. In this embodiment of the present invention, the first network key may be referred to as A-net-pub.
需要说明的是,本发明实施例不限于上述第二设备根据第一网络密钥生成共享密钥,其他任何可以与第一设备进行通信的设备,均可以根据第一网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the second device generating a shared key based on the first network key, and any other device that can communicate with the first device can generate a shared key based on the first network key .
对于本发明实施例,第一网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第一网络密钥为非对称密钥时,第一网络密钥可以为DH;也可以为ECDH公钥;还可以为ECDH公钥的X坐标或Y坐标。For this embodiment of the present invention, the first network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the first network key is an asymmetric key, the first network key may be DH; it may also be an ECDH public key; it may also be the X coordinate or Y coordinate of the ECDH public key.
对于本发明实施例,第一网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第一网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the first network key may also be a result obtained by further encoding the key. For example, the first network key is the result obtained by directly encoding the DH key through base64/32/16, or it can also be obtained by first encoding the DH key through base64/32/16 and then encoding it through ASN.1 The result can also be the result obtained by directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key can be first encoded through base64/32/16, and then through ASN. 1 to encode the result.
303、第一设备将第一网络密钥发送给配置设备。303. The first device sends the first network key to the configuration device.
进一步地,通过第一设备将第一网络密钥发送给配置设备,以使得配置设备至少根据第一网络密钥,生成并向第一设备发送第二连接信息。Further, the first device sends the first network key to the configuration device, so that the configuration device generates and sends the second connection information to the first device at least according to the first network key.
304、第一设备接收配置设备发送的第二连接信息。304. The first device receives the second connection information sent by the configuration device.
其中,第二连接信息包括第二签名信息及第一网络密钥,第二签名信息由配置设备利用第二签名生成密钥对第一网络密钥进行签名得到,第二签名生成密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名生成密钥与第二签名验证密钥之间互相对应。在本发明实施例中,第二连接信息可以用Connector2来指代,第二签名信息可以用signature2来指代。 Wherein, the second connection information includes the second signature information and the first network key, the second signature information is obtained by the configuration device signing the first network key with the second signature generation key, and the second signature generation key is obtained by the configuration Generated by the device, the second signature generation key is used to configure the device for signing, and the second signature generation key corresponds to the second signature verification key. In this embodiment of the present invention, the second connection information may be referred to as Connector2, and the second signature information may be referred to as signature2.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对应的公钥;或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are asymmetric keys, the second signature generation key is the corresponding private key, and the second signature verification key is the corresponding public key; or, when the second signature generation key and the second signature verification key are symmetric keys, the second signature generation key is the same as the second signature verification key.
对于本发明实施例,连接信息具体可以包括:网络标识、对端网络密钥、待配置网络密钥、配置设备标识及配置设备的签名。在本发明实施例中,连接信息的具体表现形式可以为:For the embodiment of the present invention, the connection information may specifically include: a network identifier, a peer network key, a network key to be configured, a configuration device identifier, and a signature of the configuration device. In the embodiment of the present invention, the specific form of connection information may be:
其中,netID用于表示待配置设备被配置加入或被配置创建的网络的网络标识;PeerKey用于表示待配置设备被配置连接的的对端设备的网络密钥。在本发明实施例中,当PeerKey为Wildcard(通配符)时,表示待配置设备可以与网络中的所有设备连接。Among them, netID is used to represent the network identifier of the network that the device to be configured is configured to join or to be configured to create; PeerKey is used to represent the network key of the peer device to which the device to be configured is configured to connect. In the embodiment of the present invention, when the PeerKey is Wildcard (wildcard), it means that the device to be configured can be connected to all devices in the network.
对于本发明实施例,配置设备构造的第二连接信息具体可以为:For this embodiment of the present invention, the second connection information constructed by the configuration device may specifically be:
其中,服务集标识符(英文全称:Service Set Identifier,英文缩写:SSID)为网络标识,当第一设备为无线AP时,netID为该无线AP的SSID;wildcard为通配符,当peerKey为wildcard时,表示第一设备可以与网络中 的所有设备连接;C-id为配置设备的标识信息。Wherein, the Service Set Identifier (English full name: Service Set Identifier, English abbreviation: SSID) is a network identifier, and when the first device is a wireless AP, netID is the SSID of the wireless AP; wildcard is a wildcard, and when peerKey is wildcard, Indicates that the first device can communicate with the network All devices connected; C-id is the identification information of the configuration device.
对于本发明实施例,配置设备可以按照数字签名算法(英文全称:Digital Signature Algorithm,英文缩写:DSA)、椭圆曲线数字签名算法(英文全称:Elliptic Curve Digital Signature Algorithm,英文缩写:ECDSA)或RSA(Rivest-Shamir-Adleman)等签名算法,根据C-sign-key2,对A-net-pub进行签名,得到signature2。For the embodiment of the present invention, the device can be configured according to Digital Signature Algorithm (English full name: Digital Signature Algorithm, English abbreviation: DSA), Elliptic Curve Digital Signature Algorithm (English full name: Elliptic Curve Digital Signature Algorithm, English abbreviation: ECDSA) or RSA (English abbreviation: ECDSA) Rivest-Shamir-Adleman) and other signature algorithms, according to C-sign-key2, A-net-pub is signed to obtain signature2.
对于本发明实施例,配置设备还可以按照DSA、ECDSA或RSA等签名算法,根据C-sign-key2,对A-net-pub以及其他项,进行签名,得到signature2。其中,其他项可以为SSID、wildcard及C-id中的任一项或者任意组合。For this embodiment of the present invention, the configuration device may also sign A-net-pub and other items according to C-sign-key2 according to signature algorithms such as DSA, ECDSA, or RSA, to obtain signature2. Wherein, other items may be any one or any combination of SSID, wildcard and C-id.
对于本发明实施例,配置设备还可以首先将C-sign-key2进行转换,然后按照DSA、ECDSA或RSA等签名算法,根据转换后的C-sign-key2,对A-net-pub,或者A-net-pub以及其他项,进行签名,得到signature2。For this embodiment of the present invention, the configuration device can also first convert C-sign-key2, and then according to DSA, ECDSA or RSA and other signature algorithms, according to the converted C-sign-key2, to A-net-pub, or A-net-pub -net-pub and other items are signed to get signature2.
对于本发明实施例,当配置设备通过与第二设备进行带外通信,获取到第二设备带外密钥时,可以构造对应的连接信息,并发送给第一设备,以使得第一设备获取第二设备带外密钥。此时,配置设备构造的连接信息具体可以为:For the embodiment of the present invention, when the configuration device acquires the out-of-band key of the second device through out-of-band communication with the second device, it can construct the corresponding connection information and send it to the first device, so that the first device can obtain Second device out-of-band key. At this point, the connection information for configuring the device structure can be as follows:
其中,Connector2’的peerKey为B-id-pub,即第二设备带外密钥。Among them, the peerKey of Connector2' is B-id-pub, which is the out-of-band key of the second device.
需要说明的是,本发明实施例不限于上述配置设备通过Connector2’,向第一设备发送第二设备带外密钥的方式,其他任何能够实现配置设备向第一设备发送第二设备带外密钥的方式,均适用本发明实 施例。It should be noted that the embodiment of the present invention is not limited to the above-mentioned method in which the configuration device sends the second device out-of-band key to the first device through Connector2', any other method that can realize the configuration device sending the second device out-of-band key to the first device The mode of the key is applicable to the implementation of the present invention Example.
例如,配置设备可以直接对第二设备带外密钥进行加密,并将加密后的第二设备带外密钥发送给第一设备。具体地,配置设备可以在发送给第一设备的消息中,携带指示信息,该指示信息用于第一设备指示消息中携带有第二设备带外密钥,以使得第一设备接收第二设备带外密钥,并执行相应流程。For example, the configuration device may directly encrypt the out-of-band key of the second device, and send the encrypted out-of-band key of the second device to the first device. Specifically, the configuration device may carry indication information in the message sent to the first device, and the indication information is used for the first device to indicate that the message carries the out-of-band key of the second device, so that the first device receives the second device out-of-band key and execute the corresponding process.
305、第一设备接收配置设备发送的第二设备带外密钥。305. The first device receives the out-of-band key of the second device sent by the configuration device.
其中,第二设备带外密钥由配置设备通过与第二设备之间进行带外通信获得。在本发明实施例中,第二设备带外密钥可以用B-id-pub来指代。Wherein, the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device. In this embodiment of the present invention, the out-of-band key of the second device may be referred to by B-id-pub.
对于本发明实施例,带外通信是指通信距离相对较短的通信方式,带内通信是指通信距离相对较长的通信方式。具体地,带内通信可以为:蓝牙、蓝牙低功耗、Wi-Fi、ZigBee、UWB、WiGig等;带外通信可以为:RFID、NFC、红外、激光、超声波、电容屏传输、光学识别或声学识别等。For the embodiment of the present invention, out-of-band communication refers to a communication method with a relatively short communication distance, and in-band communication refers to a communication method with a relatively long communication distance. Specifically, in-band communication can be: Bluetooth, Bluetooth low energy consumption, Wi-Fi, ZigBee, UWB, WiGig, etc.; out-of-band communication can be: RFID, NFC, infrared, laser, ultrasonic, capacitive screen transmission, optical identification or Acoustic identification, etc.
例如,当配置设备与第二设备之间进行带外通信的方式为光学识别时,首先第二设备提供一个包含第二设备带外密钥的二维码;然后配置设备通过自身的摄像头模块扫描该二维码,并进行解码获得验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For example, when the way of out-of-band communication between the configuration device and the second device is optical identification, the second device first provides a QR code containing the second device’s out-of-band key; then the configuration device scans the The two-dimensional code is decoded to obtain the verification information material; finally, the configuration device obtains the verification information according to the verification information material and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that The first device acquires verification information according to the verification information material.
再例如,当配置设备与第二设备之间进行带外通信的方式为声学识别时,首先第二设备通过自身的声学模块播放验证信息材料,然后配置设备收听该验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For another example, when the way of out-of-band communication between the configured device and the second device is acoustic recognition, the second device first plays the verification information material through its own acoustic module, and then configures the device to listen to the verification information material; finally configures the device according to The verification information material obtains verification information and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that the first device obtains verification information according to the verification information material.
对于本发明实施例,验证信息材料与验证信息之间,可以通过特定的编解码方式进行互相转换,也可以为相同的信息,本发明实施例不做限定。 其中,当验证信息材料与验证信息之间需要进行互相转换时,可以直接通过base64/32/16编码方式,实现互相转换;也可以首先通过base64/32/16进行编码,然后通过ASN.1编码方式,实现互相转换。For the embodiment of the present invention, the verification information material and the verification information may be mutually converted through a specific encoding and decoding method, or may be the same information, which is not limited in the embodiment of the present invention. Among them, when the mutual conversion between the verification information material and the verification information is required, the mutual conversion can be realized directly through the base64/32/16 encoding method; it can also be first encoded through base64/32/16, and then encoded through ASN.1 way to achieve mutual conversion.
对于本发明实施例,第二设备带外密钥可以为DH公钥,也可以为ECDH公钥,还可以为ECDH公钥的X坐标或Y坐标,还可以为ECDH公钥的X坐标或Y坐标。For the embodiment of the present invention, the out-of-band key of the second device may be a DH public key, or an ECDH public key, or it may be the X coordinate or Y coordinate of the ECDH public key, or it may be the X coordinate or Y of the ECDH public key coordinate.
对于本发明实施例,第二设备带外密钥还可以为对公钥进行进一步编码得到的结果。例如,第二设备带外密钥可以为对DH公钥直接通过base64/32/16进行编码得到的结果,还可以为对DH公钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH公钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH公钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the out-of-band key of the second device may also be a result obtained by further encoding the public key. For example, the out-of-band key of the second device can be the result of directly encoding the DH public key through base64/32/16, or it can be the result of first encoding the DH public key through base64/32/16 and then through ASN.1 The result obtained by encoding can also be the result obtained by directly encoding the X coordinate of the ECDH public key through base64/32/16, or the Y coordinate of the ECDH public key is first encoded through base64/32/16, and then The result of encoding via ASN.1.
可选地,步骤305之后,还可以包括:第一设备确定第二设备带外密钥是否合法。Optionally, after step 305, the method may further include: the first device determines whether the out-of-band key of the second device is valid.
具体地,第一设备确定第二设备是否存储有第二设备带外密钥对应的私钥,若第二设备存储有第二设备带外密钥对应的私钥,则第一设备确定第二设备合法第二设备带外密钥对应的私钥与第二设备带外密钥之间互相对应。在本发明实施例中,第二设备带外密钥对应的私钥可以用B-id-priv来指代。Specifically, the first device determines whether the second device stores the private key corresponding to the second device's out-of-band key, and if the second device stores the private key corresponding to the second device's out-of-band key, the first device determines that the second The private key corresponding to the legitimate second device out-of-band key of the device corresponds to the second device out-of-band key. In this embodiment of the present invention, the private key corresponding to the out-of-band key of the second device may be referred to by B-id-priv.
对于本发明实施例,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为非对称密钥时,第二设备带外密钥对应的私钥为私钥,第二设备带外密钥为公钥;或者,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为对称密钥时,第二设备带外密钥对应的私钥与第二设备带外密钥相同。For the embodiment of the present invention, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are asymmetric keys, the private key corresponding to the out-of-band key of the second device is a private key, The out-of-band key of the second device is a public key; or, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are symmetric keys, the corresponding The private key is the same as the second device out-of-band key.
306、第一设备根据第二设备带外密钥,生成加密密钥。306. The first device generates an encryption key according to the out-of-band key of the second device.
对于本发明实施例,第二设备带外密钥可以为对称密钥,也可以为非 对称密钥,本发明实施例不做限定。For this embodiment of the present invention, the out-of-band key of the second device can be a symmetric key, or a The symmetric key is not limited in this embodiment of the present invention.
可选地,当第二设备带外密钥为对称密钥时,第一设备可以直接将该第二设备带外密钥,作为加密密钥。Optionally, when the out-of-band key of the second device is a symmetric key, the first device may directly use the out-of-band key of the second device as an encryption key.
可替换地,当第二设备带外密钥为非对称密钥时,第一设备首先生成一对非对称的临时密钥,分别为第一设备临时私钥及第一设备临时公钥,然后根据第一设备临时私钥及第二设备带外密钥,生成加密密钥。Alternatively, when the second device's out-of-band key is an asymmetric key, the first device first generates a pair of asymmetric temporary keys, which are the first device's temporary private key and the first device's temporary public key, and then An encryption key is generated according to the temporary private key of the first device and the out-of-band key of the second device.
对于本发明实施例,第一设备生成第一设备临时私钥及第一设备临时公钥后,可以将第一设备临时公钥发送给第二设备,以使得第二设备获取第一设备临时公钥,并根据该第一设备临时公钥,及本地存储的第二设备带外密钥对应的私钥,生成第二加密密钥。其中,第二加密密钥用于对第一设备加密后的信息进行解密。For the embodiment of the present invention, after the first device generates the temporary private key of the first device and the temporary public key of the first device, it can send the temporary public key of the first device to the second device, so that the second device can obtain the temporary public key of the first device. key, and generate a second encryption key according to the temporary public key of the first device and the private key corresponding to the locally stored out-of-band key of the second device. Wherein, the second encryption key is used to decrypt the encrypted information of the first device.
需要说明的是,本领域技术人员能够理解,第一设备根据第一设备临时私钥及第二设备带外密钥生成的加密密钥,与第二设备根据第一设备临时公钥及第二设备带外密钥对应的私钥生成的第二加密密钥相同。It should be noted that those skilled in the art can understand that the encryption key generated by the first device based on the temporary private key of the first device and the out-of-band key of the second device, and the encryption key generated by the second device based on the temporary public key of the first device and the second The second encryption key generated by the private key corresponding to the out-of-band key of the device is the same.
对于本发明实施例,加密密钥用于对第一设备向第二设备发送的信息进行加密。For this embodiment of the present invention, the encryption key is used to encrypt information sent by the first device to the second device.
具体地,第一设备可以直接根据加密密钥,对需要发送给第二设备的信息进行加密;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,然后根据转换后的加密密钥,对需要发送给第二设备的信息进行加密。Specifically, the first device can directly encrypt the information to be sent to the second device according to the encryption key; the first device can also first convert the encryption key to obtain the converted encryption key, and then according to The encryption key for encrypting the information to be sent to the second device.
对于本发明实施例,第一设备对加密密钥进行转换的方式,可以为直接通过base64/32/16编码方式,对加密密钥进行转换,得到转换后的加密密钥;也可以首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对加密密钥进行转换,得到转换后的加密密钥。For the embodiment of the present invention, the way the first device converts the encryption key may be to convert the encryption key directly through the base64/32/16 encoding method to obtain the converted encryption key; it may also first pass the base64 /32/16 to encode, and then convert the encryption key through the ASN.1 encoding method to obtain the converted encryption key.
对于本发明实施例,当第一设备根据转换后的加密密钥,对需要发送给第二设备的信息进行加密时,第二设备按照转换后的第二加密密钥,对第一设备加密后的信息进行解密。具体地,第二设备首先按照与第一设备 同样的转换方式,将第二加密密钥进行转换,得到转换后的第二加密密钥,然后按照转换后的第二加密密钥,对第一设备加密后的信息进行解密。For the embodiment of the present invention, when the first device encrypts the information to be sent to the second device according to the converted encryption key, the second device encrypts the first device according to the converted second encryption key. information is decrypted. Specifically, the second device first follows the same In the same conversion manner, the second encryption key is converted to obtain a converted second encryption key, and then the encrypted information of the first device is decrypted according to the converted second encryption key.
307、第一设备生成第一签名生成密钥及第一签名验证密钥。307. The first device generates a first signature generation key and a first signature verification key.
其中,第一签名生成密钥及第一签名验证密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名验证密钥用于对第一设备签名的信息进行解密,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key and the first signature verification key are generated by the first device, the first signature generation key is used for the first device to sign, and the first signature verification key is used for signing information of the first device For decryption, the first signature generation key and the first signature verification key correspond to each other.
可选地,步骤307之后,还可以包括:第一设备向第二设备发送加密后的第一签名验证密钥。其中,加密后的第一签名验证密钥由第一设备利用第三密钥对第一签名验证密钥进行加密得到,第三密钥由第一设备根据加密密钥得到。Optionally, after step 307, the method may further include: the first device sends the encrypted first signature verification key to the second device. Wherein, the encrypted first signature verification key is obtained by the first device by encrypting the first signature verification key with a third key, and the third key is obtained by the first device according to the encryption key.
对于本发明实施例,第一设备可以直接将加密密钥作为第三密钥,并根据该第三密钥对第一签名验证密钥进行加密,得到加密后的第一签名验证密钥;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第三密钥,并根据该第三密钥对第一签名验证密钥进行加密,得到加密后的第一签名验证密钥。For this embodiment of the present invention, the first device may directly use the encryption key as the third key, and encrypt the first signature verification key according to the third key to obtain the encrypted first signature verification key; A device may first convert the encryption key to obtain the converted encryption key as the third key, and encrypt the first signature verification key according to the third key to obtain the encrypted first signature Verify key.
对于本发明实施例,第一设备生成一对签名密钥,分别为第一签名验证密钥及第一签名生成密钥。其中,第一签名验证密钥用于发送给其他设备,以使得其他设备可以通过该第一签名验证密钥,对第一设备签名的信息进行解密;第一签名生成密钥用于第一设备进行签名。在本发明实施例中,第一签名验证密钥可以用A-sign-key1来指代,第一签名生成密钥可以用A-sign-key2来指代。For this embodiment of the present invention, the first device generates a pair of signature keys, which are respectively the first signature verification key and the first signature generation key. Wherein, the first signature verification key is used to send to other devices, so that other devices can decrypt the information signed by the first device through the first signature verification key; the first signature generation key is used by the first device to sign. In this embodiment of the present invention, the first signature verification key may be referred to by A-sign-key1, and the first signature generation key may be referred to by A-sign-key2.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
可选地,步骤307之后,还可以包括:第一设备向第二设备发送加密 后的第二签名验证密钥。其中,加密后的第二签名验证密钥由第一设备利用第二密钥对第二签名验证密钥进行加密得到,第二密钥由第一设备根据加密密钥得到。Optionally, after step 307, it may further include: the first device sends the encrypted After the second signature verification key. Wherein, the encrypted second signature verification key is obtained by the first device by using the second key to encrypt the second signature verification key, and the second key is obtained by the first device according to the encryption key.
对于本发明实施例,第一设备可以直接将加密密钥作为第二密钥,并根据该第二密钥对第二签名验证密钥进行加密,得到加密后的第一签名验证密钥;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第二密钥,并根据该第二密钥对第二签名验证密钥进行加密,得到加密后的第一签名验证密钥。For this embodiment of the present invention, the first device may directly use the encryption key as the second key, and encrypt the second signature verification key according to the second key to obtain the encrypted first signature verification key; A device may first convert the encryption key to obtain the converted encryption key as the second key, and encrypt the second signature verification key according to the second key to obtain the encrypted first signature Verify key.
需要说明的是,第一设备根据加密密钥得到的第二密钥,与第一设备根据加密密钥得到的第三密钥之间,可以相同,也可以不同,本发明实施例不做限定。It should be noted that the second key obtained by the first device according to the encryption key may be the same as or different from the third key obtained by the first device according to the encryption key, which is not limited in this embodiment of the present invention. .
进一步地,通过第一设备向第二设备发送第二签名验证密钥,以使得第二设备接收第二签名验证密钥,并根据第二签名验证密钥,以及第二消息携带的第二签名信息,确定第一设备合法。Further, the first device sends the second signature verification key to the second device, so that the second device receives the second signature verification key, and verifies the key according to the second signature and the second signature carried in the second message information to determine that the first device is legitimate.
308、第一设备接收第二设备发送的第二网络密钥。308. The first device receives the second network key sent by the second device.
其中,第二网络密钥由第二设备生成,第二网络密钥用于第一设备生成共享密钥。在本发明实施例中,第二网络密钥可以用B-net-pub来指代。Wherein, the second network key is generated by the second device, and the second network key is used by the first device to generate a shared key. In this embodiment of the present invention, the second network key may be referred to by B-net-pub.
需要说明的是,本发明实施例不限于上述第一设备根据第二网络密钥生成共享密钥,其他任何可以与第二设备进行通信的设备,均可以根据第二网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the first device generating a shared key based on the second network key, and any other device that can communicate with the second device can generate a shared key based on the second network key .
对于本发明实施例,第二网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第二网络密钥为非对称密钥时,第二网络密钥可以为DH公钥;也可以为ECDH公钥;还可以为ECDH公钥的X坐标或Y坐标。For this embodiment of the present invention, the second network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the second network key is an asymmetric key, the second network key can be a DH public key; it can also be an ECDH public key; it can also be the X coordinate or Y coordinate of the ECDH public key .
对于本发明实施例,第二网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第二网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后 通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the second network key may also be a result obtained by further encoding the key. For example, the second network key is the result of directly encoding the DH key through base64/32/16, or it can also be the result of first encoding the DH key through base64/32/16, and then The result of encoding through ASN.1 can also be the result of directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key first through base64/32/16 Encode and then encode the result through ASN.1.
309、第一设备利用第一签名生成密钥对第二网络密钥进行签名,得到第一签名信息。309. The first device signs the second network key by using the first signature generation key to obtain first signature information.
其中,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, and the first signature generation key and the first signature verification key correspond to each other.
对于本发明实施例,第一签名信息可以用signature1来指代。具体地,配置设备可以按照DSA、ECDSA或RSA等签名算法,根据A-sign-key2,对B-net-pub进行签名,得到signature1。For this embodiment of the present invention, the first signature information may be referred to by signature1. Specifically, the configuration device can sign B-net-pub according to A-sign-key2 according to signature algorithms such as DSA, ECDSA, or RSA, and obtain signature1.
310、第一设备向第二设备发送加密后的第一连接信息。310. The first device sends encrypted first connection information to the second device.
其中,第一连接信息包括第一签名信息及第二网络密钥,加密后的第一连接信息由第一设备利用第一密钥对第一连接信息进行加密得到,第一密钥由第一设备根据加密密钥得到。在本发明实施例中,第一连接信息可以用Connector1来指代。Wherein, the first connection information includes the first signature information and the second network key, and the encrypted first connection information is obtained by encrypting the first connection information by the first device using the first key, and the first key is obtained by the first The device is derived from the encryption key. In this embodiment of the present invention, the first connection information may be referred to by Connector1.
对于本发明实施例,第一设备可以直接将加密密钥作为第一密钥,并根据该第一密钥对第一连接信息进行加密,得到加密后的第一签名验证密钥;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第一密钥,并根据该第一密钥对第一连接信息进行加密,得到加密后的第一签名验证密钥。For the embodiment of the present invention, the first device may directly use the encryption key as the first key, and encrypt the first connection information according to the first key to obtain the encrypted first signature verification key; the first device Alternatively, the encryption key may be converted first to obtain the converted encryption key as the first key, and the first connection information may be encrypted according to the first key to obtain the encrypted first signature verification key.
需要说明的是,第一设备根据加密密钥得到的第一密钥,与第一设备根据加密密钥得到的第三密钥之间,或者与第一设备根据加密密钥得到的第二密钥之间,可以相同,也可以不同,本发明实施例不做限定。It should be noted that, between the first key obtained by the first device based on the encryption key, the third key obtained by the first device based on the encryption key, or the second key obtained by the first device based on the encryption key The keys may be the same or different, which is not limited in this embodiment of the present invention.
进一步地,通过第一设备向第二设备发送加密后的第一连接信息,以使得第二设备获取并向第一设备发送第一连接信息。其中,第一连接信息用于第一设备确定第二设备是否合法。Further, the first device sends the encrypted first connection information to the second device, so that the second device obtains and sends the first connection information to the first device. Wherein, the first connection information is used by the first device to determine whether the second device is legitimate.
对于本发明实施例,第一设备构造的第一连接信息具体可以为: For this embodiment of the present invention, the first connection information constructed by the first device may specifically be:
进一步地,通过第一设备向第二设备发送第一连接信息,以使得第二设备获取第一连接信息中的第一网络密钥,并根据第一网络密钥生成第二共享密钥。其中,第二共享密钥为第二设备与第一设备之间进行握手认证的预先密钥。Further, the first device sends the first connection information to the second device, so that the second device obtains the first network key in the first connection information, and generates a second shared key according to the first network key. Wherein, the second shared key is a pre-key for handshake authentication between the second device and the first device.
可选地,第二设备可以按照DH密钥生成算法,根据第二网络密钥对应的私钥,以及第一网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第二共享密钥。在本发明实施例中,第二共享密钥可以为DH(B-net-priv,A-net-pub)。其中,第二网络密钥对应的私钥可以用B-net-priv来指代。Optionally, the second device may generate a DH shared key according to the DH key generation algorithm according to the private key corresponding to the second network key and the first network key, and share the key with the DH, or share the key with the DH The key derived from the key is used as the second shared key. In this embodiment of the present invention, the second shared key may be DH (B-net-priv, A-net-pub). Wherein, the private key corresponding to the second network key may be referred to by B-net-priv.
可替换地,第二设备还可以按照ECDH密钥生成算法,根据第二网络密钥对应的私钥,以及第一网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第二共享密钥。在本发明实施例中,第二共享密钥可以为ECDH(B-net-priv,A-net-pub)。Alternatively, the second device can also generate an ECDH shared key according to the ECDH key generation algorithm, according to the private key corresponding to the second network key, and the first network key, and use the ECDH shared key, or use the ECDH A key derived from the shared key is used as the second shared key. In this embodiment of the present invention, the second shared key may be ECDH (B-net-priv, A-net-pub).
311、第一设备接收第二设备发送的第一消息。311. The first device receives the first message sent by the second device.
其中,第一消息携带有第一连接信息。在本发明实施例中,第一消息可以用M1来指代。Wherein, the first message carries the first connection information. In this embodiment of the present invention, the first message may be referred to by M1.
对于本发明实施例,第二设备将第一连接信息携带在第一消息中,发送给第一设备,以使得第一设备根据第一消息携带的第一签名信息,确定第二设备是否合法。For the embodiment of the present invention, the second device carries the first connection information in the first message and sends it to the first device, so that the first device determines whether the second device is legal according to the first signature information carried in the first message.
312、第一设备根据第一消息携带的第一签名信息,确定第二设备合法。 312. The first device determines that the second device is legal according to the first signature information carried in the first message.
可选地,步骤312可以为,第一设备根据第一消息携带的第一签名信息,确定签名得到第一签名信息的设备为可信设备。其中,可信设备包括第一设备或者配置设备。Optionally, step 312 may be that the first device determines, according to the first signature information carried in the first message, that the device that obtained the first signature information by signing is an authentic device. Wherein, the trusted device includes the first device or the configuration device.
可替换地,步骤312还可以为,第一设备首先利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果,然后将解密结果,与第一连接信息包括的第二网络密钥进行比对,若解密结果与第二网络密钥匹配,则第一设备确定第二设备合法。Alternatively, step 312 may also be that the first device first uses the first signature verification key to decrypt the first signature information to obtain a decryption result, and then combines the decryption result with the second network encryption key included in the first connection information. The key is compared, and if the decryption result matches the second network key, the first device determines that the second device is legal.
对于本发明实施例,解密结果与第二网络密钥匹配,是指解密结果与第二网络密钥相同;或者,对解密结果进行转换后,与第二网络密钥相同;或者,对第二网络密钥进行转换后,与解密结果相同;或者,转换后的解密结果,与转换后的第二网络密钥相同。For this embodiment of the present invention, the decryption result matches the second network key, which means that the decryption result is the same as the second network key; or, after the decryption result is converted, it is the same as the second network key; or, the second network key After the network key is converted, it is the same as the decryption result; or, the converted decryption result is the same as the converted second network key.
对于本发明实施例,对解密结果或者第二网络密钥转换的方式,可以为直接通过base64/32/16编码方式,对解密结果或者第二网络密钥进行转换;也可以为首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对解密结果或者第二网络密钥进行转换。For the embodiment of the present invention, the way to convert the decryption result or the second network key may be to convert the decryption result or the second network key directly through base64/32/16 encoding; 32/16, and then use the ASN.1 encoding method to convert the decryption result or the second network key.
对于本发明实施例,第一签名信息还可以由第一设备根据第一签名生成密钥,对第一连接信息中的待配置网络密钥及其他项,进行签名得到。其中,其他项为第一连接信息中的网络标识、对端网络密钥及配置设备标识中的任一项或者任意组合。此时,解密结果与第二网络密钥匹配,是指第二网络密钥及其他项,与解密结果相同;或者,对第二网络密钥及其他项进行转换后,与解密结果相同;或者,对解密结果进行转换后,与第二网络密钥及其他项相同;或者,转换后的第二网络密钥及其他项,与转换后的解密结果相同。For the embodiment of the present invention, the first signature information may also be obtained by the first device signing the network key to be configured and other items in the first connection information according to the first signature generation key. Wherein, the other item is any one or any combination of the network identifier, the peer network key, and the configured device identifier in the first connection information. At this time, the decryption result matches the second network key, which means that the second network key and other items are the same as the decryption result; or, after conversion of the second network key and other items, it is the same as the decryption result; or , after converting the decryption result, it is the same as the second network key and other items; or, the converted second network key and other items are the same as the converted decryption result.
例如,当signature1由第一设备根据A-sign-key2,对B-net-pub、SSID、A-net-pub及A-id进行签名得到时,第一设备根据A-sign-key1,对signature1进行解密,得到解密结果,该解密结果与B-net-pub、SSID、A-net-pub及A-id相同;或者,转换后的解密结果,与B-net-pub、SSID、A-net-pub及 A-id相同;或者,解密结果,与转换后的B-net-pub、SSID、A-net-pub及A-id相同;或者,转换后的解密结果,与转换后的B-net-pub、SSID、A-net-pub及A-id相同。具体地,若转换方式为哈希转换,当signature1由第一设备根据A-sign-key2,对B-net-pub、SSID、A-net-pub及A-id进行哈希后进行签名得到时,第一设备根据A-sign-key1,对signature1进行解密,得到解密结果,该解密结果与对B-net-pub、SSID、A-net-pub及A-id进行哈希后的结果相同。For example, when signature1 is obtained by the first device signing B-net-pub, SSID, A-net-pub and A-id according to A-sign-key2, the first device signs signature1 according to A-sign-key1 Perform decryption to obtain the decryption result, which is the same as B-net-pub, SSID, A-net-pub and A-id; or, the converted decryption result is the same as B-net-pub, SSID, A-net -pub and A-id is the same; or, the decryption result is the same as the converted B-net-pub, SSID, A-net-pub and A-id; or, the converted decryption result is the same as the converted B-net-pub , SSID, A-net-pub and A-id are the same. Specifically, if the conversion method is hash conversion, when signature1 is obtained by signing B-net-pub, SSID, A-net-pub and A-id according to A-sign-key2 by the first device , the first device decrypts signature1 according to A-sign-key1 to obtain a decryption result, which is the same as the hashed result of B-net-pub, SSID, A-net-pub and A-id.
对于本发明实施例,第一设备接收到的第一消息携带的第一连接信息具体可以为:For this embodiment of the present invention, the first connection information carried in the first message received by the first device may specifically be:
可选地,第一设备验证Connector1的具体过程可以为:首先,第一设备验证Connector1中的netID,是否与Connector2中的netID匹配,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector1中的netID与Connector2中的netID均为SSID,二者匹配;然后,第一设备验证Connector1中的peerKey是否为自身生成的网络密钥或wildcard,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector1中的peerKey为自身生成的网络密钥,故而peerKey匹配;其次,第一设备验证Connector1中的introducer是否为信任设备,若是则继续验证Connector1,若不是则放弃验证,在本发明实施例中,Connector1中的introducer为A-id,即自身的标识信息,故而为信任设备;最后,第一设备根据A-sign-key1,验证signature1是否合法,若合法则确定Connector1合法,若不合法则放弃验证,在本发明实施例中,signature1 由第一设备根据A-sign-key2进行签名得到,故而signature1合法,因此,第一设备确定Connector1合法,即第一设备确定第二设备合法。Optionally, the specific process for the first device to verify Connector1 can be as follows: First, the first device verifies whether the netID in Connector1 matches the netID in Connector2, if it matches, then continues to verify Connector1, and if it does not match, then abandons the verification. In the embodiment of the invention, the netID in Connector1 and the netID in Connector2 are both SSIDs, and the two match; then, the first device verifies whether the peerKey in Connector1 is a network key or wildcard generated by itself, and if it matches, continues to verify Connector1, If it does not match, the verification is abandoned. In the embodiment of the present invention, the peerKey in Connector1 is the network key generated by itself, so the peerKey matches; secondly, the first device verifies whether the introducer in Connector1 is a trusted device, and if so, continues to verify Connector1 , if not, give up the verification. In the embodiment of the present invention, the introducer in Connector1 is A-id, that is, its own identification information, so it is a trusted device; finally, the first device verifies whether signature1 is legal according to A-sign-key1 , if it is legal, it is determined that Connector1 is legal, and if it is not legal, the verification is given up. In the embodiment of the present invention, signature1 It is signed by the first device according to A-sign-key2, so signature1 is legal. Therefore, the first device determines that Connector1 is legal, that is, the first device determines that the second device is legal.
313、若确定第二设备合法,则第一设备至少根据第二网络密钥,生成第一共享密钥。313. If it is determined that the second device is legal, the first device generates a first shared key at least according to the second network key.
其中,第一共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Wherein, the first shared key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
对于本发明实施例,第一设备可以首先根据预先密钥,生成预共享密钥(英文全称:Pre-Shared Key,英文缩写:PSK),或者成对主密钥(英文全称:Pairwise Master Key,英文缩写:PMK),然后根据该PSK或PMK,与第二设备之间进行握手认证。For the embodiment of the present invention, the first device can first generate a pre-shared key (English full name: Pre-Shared Key, English abbreviation: PSK) or a pairwise master key (English full name: Pairwise Master Key, English abbreviation: PMK), and then perform handshake authentication with the second device according to the PSK or PMK.
可选地,第一设备可以按照DH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第一共享密钥。在本发明实施例中,第一共享密钥可以为DH(A-net-priv,B-net-pub)。其中,第一网络密钥对应的私钥可以用A-net-priv来指代。Optionally, the first device may generate a DH shared key according to the DH key generation algorithm, according to the private key corresponding to the first network key, and the second network key, and share the key with the DH, or share the key with the DH The key derived from the key is used as the first shared key. In this embodiment of the present invention, the first shared key may be DH (A-net-priv, B-net-pub). Wherein, the private key corresponding to the first network key may be referred to as A-net-priv.
可替换地,第一设备还可以按照ECDH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第一共享密钥。在本发明实施例中,第一共享密钥可以为ECDH(A-net-priv,B-net-pub)。Alternatively, the first device can also generate an ECDH shared key according to the ECDH key generation algorithm according to the private key corresponding to the first network key and the second network key, and use the ECDH shared key, or the ECDH A key derived from the shared key is used as the first shared key. In this embodiment of the present invention, the first shared key may be ECDH (A-net-priv, B-net-pub).
需要说明的是,本领域技术人员能够理解,第一设备根据第一网络密钥对应的私钥以及第二网络密钥生成的第一共享密钥,与第二设备根据第二网络密钥对应的私钥以及第一网络密钥生成的第二共享密钥相同。It should be noted that those skilled in the art can understand that the first shared key generated by the first device according to the private key corresponding to the first network key and the second network key corresponds to the shared key generated by the second device according to the second network key. The private key and the second shared key generated by the first network key are the same.
对于本发明实施例,通过第一设备生成的第一共享密钥,与第二设备生成的第二共享密钥相同,能够实现第一设备与第二设备之间的握手认证。For the embodiment of the present invention, the first shared key generated by the first device is the same as the second shared key generated by the second device, so that handshake authentication between the first device and the second device can be implemented.
314、第一设备发送第二消息。314. The first device sends a second message.
其中,第二消息携带有第二连接信息,第二连接信息包括第二签名信 息。在本发明实施例中,第二消息可以用M2来指代。Wherein, the second message carries the second connection information, and the second connection information includes the second signature information interest. In this embodiment of the present invention, the second message may be referred to by M2.
对于本发明实施例,步骤314可以为:第一设备发送加密后的第二消息。其中,加密后的第二消息由第一设备利用第四密钥对第二消息进行加密得到,第四密钥由第一设备根据加密密钥得到。For this embodiment of the present invention, step 314 may be: the first device sends the encrypted second message. Wherein, the encrypted second message is obtained by the first device by encrypting the second message with a fourth key, and the fourth key is obtained by the first device according to the encryption key.
对于本发明实施例,第一设备可以直接将加密密钥作为第四密钥,并根据该第四密钥对第二消息进行加密,得到加密后的第二消息;第一设备也可以首先对加密密钥进行转换,得到转换后的加密密钥,作为第四密钥,并根据该第四密钥对第二消息进行加密,得到加密后的第二消息。For the embodiment of the present invention, the first device may directly use the encryption key as the fourth key, and encrypt the second message according to the fourth key to obtain the encrypted second message; The encryption key is converted to obtain the converted encryption key as the fourth key, and the second message is encrypted according to the fourth key to obtain the encrypted second message.
需要说明的是,第一设备根据加密密钥得到的第四密钥,与第一设备根据加密密钥得到的第三密钥之间,或者与第一设备根据加密密钥得到的第二密钥之间,或者与第一设备根据加密密钥得到的第一密钥之间,可以相同,也可以不同,本发明实施例不做限定。It should be noted that between the fourth key obtained by the first device based on the encryption key, the third key obtained by the first device based on the encryption key, or the second key obtained by the first device based on the encryption key The keys may be the same or different from the first key obtained by the first device according to the encryption key, which is not limited in this embodiment of the present invention.
进一步地,通过第一设备向第二设备发送第二消息,以使得第二设备接收第一设备发送的第二消息,并根据第二消息携带的第二签名信息,确定第一设备是否合法。Further, the first device sends the second message to the second device, so that the second device receives the second message sent by the first device, and determines whether the first device is legal according to the second signature information carried in the second message.
对于本发明实施例,第二设备接收到的第二消息携带的第二连接信息具体可以为:For this embodiment of the present invention, the second connection information carried in the second message received by the second device may specifically be:
可选地,第二设备验证Connector2的具体过程可以为:首先,第二设备验证Connector2中的netID,是否与Connector1中的netID匹配,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector2中的netID与Connector1中的netID均为SSID,二者匹配;然后, 第二设备验证Connector2中的peerKey是否为自身生成的网络密钥或wildcard,若匹配则继续验证Connector2,若不匹配则放弃验证,在本发明实施例中,Connector2中的peerKey为wildcard,故而peerKey匹配;其次,第二设备验证Connector2中的introducer是否为信任设备,若是则继续验证Connector2,若不是则放弃验证,在本发明实施例中,Connector2中的introducer为C-id,即配置设备的标识信息,故而为信任设备;最后,第二设备根据C-sign-key1,验证signature2是否合法,若合法则确定Connector2合法,若不合法则放弃验证,在本发明实施例中,signature2由配置设备根据C-sign-key2进行签名得到,故而signature2合法,因此,第二设备确定Connector2合法,即第二设备确定第一设备合法。Optionally, the specific process for the second device to verify Connector2 can be as follows: First, the second device verifies whether the netID in Connector2 matches the netID in Connector1, if it matches, continues to verify Connector1, and if it does not match, then abandons the verification. In the embodiment of the invention, the netID in Connector2 and the netID in Connector1 are both SSIDs, and the two match; then, The second device verifies whether the peerKey in Connector2 is the network key or wildcard generated by itself. If it matches, it continues to verify Connector2. If it does not match, it abandons the verification. In the embodiment of the present invention, the peerKey in Connector2 is wildcard, so the peerKey matches Secondly, the second device verifies whether the introducer in Connector2 is a trusted device, if so, continues to verify Connector2, if not then abandons the verification, in the embodiment of the present invention, the introducer in Connector2 is C-id, that is, the identification information of the configuration device , so it is a trusted device; finally, the second device verifies whether signature2 is legal according to C-sign-key1, if it is legal, it determines that Connector2 is legal, and if it is not legal, it abandons the verification. In the embodiment of the present invention, signature2 is configured by the device according to C- The sign-key2 is obtained by signing, so signature2 is legal. Therefore, the second device determines that Connector2 is legal, that is, the second device determines that the first device is legal.
对于本发明实施例,第二设备根据C-sign-key1验证signature2是否合法具体可以为:第二设备首先根据第二签名验证密钥,对第二签名信息进行解密,得到解密结果,然后将解密结果,与第二连接信息包括的第一网络密钥进行比对,若解密结果与第一网络密钥匹配,则第二设备确定第一设备合法。For the embodiment of the present invention, the second device verifies whether signature2 is legal according to C-sign-key1. Specifically, the second device first decrypts the second signature information according to the second signature verification key to obtain the decryption result, and then decrypts the decrypted As a result, it is compared with the first network key included in the second connection information, and if the decryption result matches the first network key, the second device determines that the first device is legal.
对于本发明实施例,解密结果与第一网络密钥匹配,是指解密结果与第一网络密钥相同;或者,对解密结果进行转换后,与第一网络密钥相同;或者,对第一网络密钥进行转换后,与解密结果相同;或者,转换后的解密结果,与转换后的第一网络密钥相同。For this embodiment of the present invention, the decryption result matches the first network key, which means that the decryption result is the same as the first network key; or, after the decryption result is converted, it is the same as the first network key; or, the first After the network key is converted, it is the same as the decryption result; or, the converted decryption result is the same as the converted first network key.
对于本发明实施例,对解密结果或者第一网络密钥转换的方式,可以为直接通过base64/32/16编码方式,对解密结果或者第一网络密钥进行转换;也可以为首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对解密结果或者第一网络密钥进行转换。For the embodiment of the present invention, the way to convert the decryption result or the first network key may be to convert the decryption result or the first network key directly through base64/32/16 encoding; 32/16, and then use the ASN.1 encoding method to convert the decryption result or the first network key.
对于本发明实施例,第二签名信息还可以由配置设备根据第二签名生成密钥,对第二连接信息中的待配置网络密钥及其他项,进行签名得到。其中,其他项为第二连接信息中的网络标识、对端网络密钥及配置设备标识中的任一项或者任意组合。此时,解密结果与第一网络密钥匹配,是指 第一网络密钥及其他项,与解密结果相同;或者,对第一网络密钥及其他项进行转换后,与解密结果相同;或者,对解密结果进行转换后,与第一网络密钥及其他项相同;或者,转换后的第一网络密钥及其他项,与转换后的解密结果相同。For the embodiment of the present invention, the second signature information may also be obtained by the configuration device signing the network key to be configured and other items in the second connection information according to the second signature generation key. Wherein, the other items are any one or any combination of the network identifier, the peer network key, and the configured device identifier in the second connection information. At this point, the decryption result matches the first network key, which means The first network key and other items are the same as the decryption result; or, after converting the first network key and other items, it is the same as the decryption result; or, after converting the decryption result, it is the same as the first network key and The other items are the same; or, the converted first network key and other items are the same as the converted decryption result.
例如,当signature2由配置设备根据C-sign-key2,对A-net-pub、SSID、wildcard及C-id进行签名得到时,第二设备根据C-sign-key1,对signature2进行解密,得到解密结果,该解密结果与A-net-pub、SSID、wildcard及C-id相同;或者,转换后的解密结果,与A-net-pub、SSID、wildcard及C-id相同;或者,解密结果,与转换后的A-net-pub、SSID、wildcard及C-id相同;或者,转换后的解密结果,与转换后的A-net-pub、SSID、wildcard及C-id相同。具体地,若转换方式为哈希转换,当signature2由配置设备根据C-sign-key2,对A-net-pub、SSID、wildcard及A-id进行哈希后进行签名得到时,第二设备根据C-sign-key1,对signature2进行解密,得到解密结果,该解密结果与对A-net-pub、SSID、wildcard及A-id进行哈希后的结果相同。For example, when signature2 is obtained by the configuration device signing A-net-pub, SSID, wildcard and C-id according to C-sign-key2, the second device decrypts signature2 according to C-sign-key1 to obtain the decryption As a result, the decryption result is the same as A-net-pub, SSID, wildcard and C-id; or, the converted decryption result is the same as A-net-pub, SSID, wildcard and C-id; or, the decryption result, It is the same as the converted A-net-pub, SSID, wildcard and C-id; or, the converted decryption result is the same as the converted A-net-pub, SSID, wildcard and C-id. Specifically, if the conversion method is hash conversion, when signature2 is obtained by the configuration device after hashing A-net-pub, SSID, wildcard, and A-id according to C-sign-key2, the second device according to C-sign-key1 decrypts signature2 to obtain the decryption result, which is the same as the hashed result of A-net-pub, SSID, wildcard and A-id.
对于本发明实施例,若第二设备确定第一设备合法,则第二设备获取第二连接信息中的第一网络密钥,并根据第一网络密钥生成第二共享密钥。For this embodiment of the present invention, if the second device determines that the first device is legal, the second device obtains the first network key in the second connection information, and generates a second shared key according to the first network key.
对于本发明实施例,当第一设备需要对第一网络密钥进行更新时,可以执行下述步骤315至318。For this embodiment of the present invention, when the first device needs to update the first network key, the following steps 315 to 318 may be performed.
315、第一设备生成第三网络密钥。315. The first device generates a third network key.
其中,第三网络密钥用于第二设备生成共享密钥。在本发明实施例中,第三网络密钥可以用A-net-pub’来指代。Wherein, the third network key is used by the second device to generate a shared key. In the embodiment of the present invention, the third network key may be referred to as A-net-pub'.
需要说明的是,本发明实施例不限于上述第二设备根据第三网络密钥生成共享密钥,其他任何可以与第一设备进行通信的设备,均可以根据第一网络密钥生成共享密钥。It should be noted that the embodiment of the present invention is not limited to the second device generating a shared key based on the third network key, and any other device that can communicate with the first device can generate a shared key based on the first network key .
对于本发明实施例,第三网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第三网络密钥为非 对称密钥时,第三网络密钥可以为DH公钥;也可以为ECDH公钥;还可以为ECDH公钥的X坐标或Y坐标。For this embodiment of the present invention, the third network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the third network key is not In the case of a symmetric key, the third network key may be a DH public key; it may also be an ECDH public key; it may also be the X coordinate or the Y coordinate of the ECDH public key.
对于本发明实施例,第二网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第二网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the second network key may also be a result obtained by further encoding the key. For example, the second network key is the result obtained by directly encoding the DH key through base64/32/16, or it can also be obtained by first encoding the DH key through base64/32/16 and then encoding it through ASN.1 The result can also be the result obtained by directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key can be first encoded through base64/32/16, and then through ASN. 1 to encode the result.
对于本发明实施例,第三网络密钥为第一设备重新生成的网络密钥。在本发明实施例中,第一设备完成对第二设备的配置后,可以按照预置周期更新自身的网络密钥,并将更新后的网络密钥发送给第二设备,从而可以提高第一设备与第二设备之间的共享密钥的安全性。For this embodiment of the present invention, the third network key is a network key regenerated by the first device. In this embodiment of the present invention, after the first device completes the configuration of the second device, it can update its own network key according to a preset period, and send the updated network key to the second device, thereby improving the network key of the first device. Security of the shared key between the device and the second device.
对于本发明实施例,步骤315之后,还可以包括:第一设备根据第二网络密钥,生成新的第一共享密钥。其中,新的第一共享密钥为第一设备与第二设备之间再次进行握手认证的预先密钥。For this embodiment of the present invention, after step 315, the method may further include: the first device generates a new first shared key according to the second network key. Wherein, the new first shared key is a pre-key for re-handshake authentication between the first device and the second device.
可选地,第一设备可以按照DH密钥生成算法,根据第三网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为新的第一共享密钥。在本发明实施例中,新的第一共享密钥可以为DH(A-net-priv’,B-net-pub)。Optionally, the first device may generate a DH shared key according to the DH key generation algorithm, according to the private key corresponding to the third network key, and the second network key, and share the key with the DH, or share the key with the DH A key derived from the key is used as a new first shared key. In this embodiment of the present invention, the new first shared key may be DH (A-net-priv', B-net-pub).
可替换地,第一设备还可以按照ECDH密钥生成算法,根据第三网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为新的第一共享密钥。在本发明实施例中,新的第一共享密钥可以为ECDH(A-net-priv’,B-net-pub)。Alternatively, the first device can also generate an ECDH shared key according to the ECDH key generation algorithm according to the private key corresponding to the third network key and the second network key, and use the ECDH shared key, or use the ECDH A key derived from the shared key is used as a new first shared key. In this embodiment of the present invention, the new first shared key may be ECDH (A-net-priv', B-net-pub).
316、第一设备将第三网络密钥发送给配置设备。316. The first device sends the third network key to the configuration device.
进一步地,通过第一设备将第三网络密钥发送给配置设备,以使得配置设备根据第三网络密钥重新构造第三连接信息,并将第三连接信息发送 给第一设备。Further, the first device sends the third network key to the configuration device, so that the configuration device reconstructs the third connection information according to the third network key, and sends the third connection information to to the first device.
317、第一设备接收配置设备发送的第三连接信息。317. The first device receives third connection information sent by the configuration device.
其中,第三连接信息包括第三签名信息及第三网络密钥,第三签名信息由配置设备利用第二签名生成密钥对第三网络密钥进行签名得到。在本发明实施例中,第三连接信息可以用Connector3来指代,第三签名信息可以用signature3来指代,第三网络密钥可以用A-net-pub’来指代。Wherein, the third connection information includes third signature information and a third network key, and the third signature information is obtained by the configuration device signing the third network key by using the second signature generation key. In the embodiment of the present invention, the third connection information may be referred to as Connector3, the third signature information may be referred to as signature3, and the third network key may be referred to as A-net-pub'.
具体地,配置设备可以按照DSA、ECDSA或RSA等签名算法,根据C-sign-key2,对A-net-pub’进行签名,得到signature3。Specifically, the configuration device can sign A-net-pub' according to DSA, ECDSA or RSA and other signature algorithms according to C-sign-key2 to obtain signature3.
对于本发明实施例,配置设备构造的第三连接信息具体可以为:For this embodiment of the present invention, the third connection information constructed by the configuration device may specifically be:
其中,Connector3中的netKey为A-net-pub’,Connector3中的signature3为对A-net-pub’进行签名得到的。Among them, the netKey in Connector3 is A-net-pub', and the signature3 in Connector3 is obtained by signing A-net-pub'.
318、第一设备向第二设备发送第三消息。318. The first device sends a third message to the second device.
其中,第三消息携带有第三连接信息。在本发明实施例中,第三消息可以用M3来指代。Wherein, the third message carries the third connection information. In this embodiment of the present invention, the third message may be referred to as M3.
进一步地,通过第一设备向第二设备发送第三消息,以使得第二设备获取第三网络密钥,并至少根据第三网络密钥生成新的第二共享密钥,新的第二共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Further, the first device sends a third message to the second device, so that the second device obtains the third network key, and at least generates a new second shared key according to the third network key, and the new second shared key The key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
对于本发明实施例,第二设备接收到的第三消息携带的第三连接信息具体可以为:For this embodiment of the present invention, the third connection information carried in the third message received by the second device may specifically be:
可选地,第二设备验证Connector3的具体过程可以为:首先,第二设备验证Connector3中的netID,是否与Connector1中的netID匹配,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector3中的netID与Connector1中的netID均为SSID,二者匹配;然后,第二设备验证Connector3中的peerKey是否为自身生成的网络密钥或wildcard,若匹配则继续验证Connector3,若不匹配则放弃验证,在本发明实施例中,Connector3中的peerKey为wildcard,故而peerKey匹配;其次,第二设备验证Connector3中的introducer是否为信任设备,若是则继续验证Connector3,若不是则放弃验证,在本发明实施例中,Connector3中的introducer为C-id,即配置设备的标识信息,故而为信任设备;最后,第二设备根据C-sign-key1,验证signature3是否合法,若合法则确定Connector3合法,若不合法则放弃验证,在本发明实施例中,signature3由配置设备根据C-sign-key2进行签名得到,故而signature3合法,因此,第二设备确定Connector3合法,即第二设备确定第一设备合法。Optionally, the specific process for the second device to verify Connector3 can be as follows: First, the second device verifies whether the netID in Connector3 matches the netID in Connector1, if it matches, continues to verify Connector1, and if it does not match, then abandons the verification. In the embodiment of the invention, the netID in Connector3 and the netID in Connector1 are both SSIDs, and the two match; then, the second device verifies whether the peerKey in Connector3 is a network key or wildcard generated by itself, and if it matches, continues to verify Connector3, If it does not match, the verification will be abandoned. In the embodiment of the present invention, the peerKey in Connector3 is wildcard, so the peerKey matches; secondly, the second device verifies whether the introducer in Connector3 is a trusted device, if so, continue to verify Connector3, if not then give up Verification, in the embodiment of the present invention, the introducer in Connector3 is C-id, that is, the identification information of the configuration device, so it is a trusted device; finally, the second device verifies whether signature3 is legal according to C-sign-key1, and if it is legal, then Determine that Connector3 is legal, and if it is not legal, then give up the verification. In the embodiment of the present invention, signature3 is obtained by the configuration device signing according to C-sign-key2, so signature3 is legal. Therefore, the second device determines that Connector3 is legal, that is, the second device determines that the first One device is legal.
对于本发明实施例,若第二设备确定Connector3合法,并且Connector3中的netKey与Connector1中的netKey不同,则第二设备认为Connector3中的netKey为第一设备更新后的网络密钥,并且根据A-net-pub’,重新生成共享密钥。For this embodiment of the present invention, if the second device determines that Connector3 is legal, and the netKey in Connector3 is different from the netKey in Connector1, then the second device considers the netKey in Connector3 to be the updated network key of the first device, and according to A- net-pub', to regenerate the shared secret.
对于本发明实施例,第二设备根据第三网络密钥生成新的第二共享密钥。其中,新的第二共享密钥为第二设备与第一设备之间再次进行握手认证的预先密钥。For this embodiment of the present invention, the second device generates a new second shared key according to the third network key. Wherein, the new second shared key is a pre-key for re-handshake authentication between the second device and the first device.
可选地,第二设备可以按照DH密钥生成算法,根据第二网络密钥对 应的私钥,以及第三网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为新的第二共享密钥。在本发明实施例中,新的第二共享密钥可以为DH(B-net-priv,A-net-pub’)。Optionally, the second device may generate the algorithm according to the DH key, and according to the second network key pair The corresponding private key and the third network key are used to generate a DH shared key, and the DH shared key or a key derived from the DH shared key is used as a new second shared key. In this embodiment of the present invention, the new second shared key may be DH(B-net-priv, A-net-pub').
可替换地,第二设备还可以按照ECDH密钥生成算法,根据第二网络密钥对应的私钥,以及第三网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为新的第二共享密钥。在本发明实施例中,新的第二共享密钥可以为ECDH(B-net-priv,A-net-pub’)。Alternatively, the second device can also generate an ECDH shared key according to the ECDH key generation algorithm, according to the private key corresponding to the second network key, and the third network key, and use the ECDH shared key, or use the ECDH A key derived from the shared key is used as a new second shared key. In this embodiment of the present invention, the new second shared key may be ECDH (B-net-priv, A-net-pub').
需要说明的是,本领域技术人员能够理解,第一设备根据第三网络密钥对应的私钥以及第二网络密钥生成的新的第一共享密钥,与第二设备根据第二网络密钥对应的私钥以及第三网络密钥生成的新的第二共享密钥相同。It should be noted that those skilled in the art can understand that the new first shared key generated by the first device according to the private key corresponding to the third network key and the second network key is shared with the second device according to the second network key. The private key corresponding to the key and the new second shared key generated by the third network key are the same.
对于本发明实施例,通过第一设备生成的新的第一共享密钥,与第二设备生成的新的第二共享密钥相同,能够实现第一设备与第二设备之间的再次握手认证。For the embodiment of the present invention, the new first shared key generated by the first device is the same as the new second shared key generated by the second device, and the re-handshake authentication between the first device and the second device can be realized .
需要说明的是,在本发明实施例中,步骤315至步骤318为可选步骤。It should be noted that, in this embodiment of the present invention, step 315 to step 318 are optional steps.
本发明实施例提供的配置的方法,首先配置设备与第二设备进行带外通信,获得第二设备带外密钥,并将第二设备带外密钥发送给第一设备,以使得第一设备根据第二设备带外密钥生成加密密钥,然后第一设备生成第一签名生成密钥及第一签名验证密钥,并接收第二设备发送的第二网络密钥,最后第一设备根据第一签名生成密钥,对第二网络密钥进行签名,得到第一签名信息,并向第二设备发送根据加密密钥加密后的第一连接信息,第一连接信息包括第一签名信息及第二网络密钥。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过配置设备与第二设备之间进行带外通信,获得第二设备带外密钥,并将该第二设备带外密钥发送给第一设备,能够使得第一设备与第二设备之间进行通信,从而可以实现第一设备对第二设备进行配置,即当配置设备与第二设备之 间不能进行带内通信时,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,可以由第一设备对第二设备进行配置,进而可以提高设备进行配置的成功率。The configuration method provided by the embodiment of the present invention firstly configures the device to perform out-of-band communication with the second device, obtains the out-of-band key of the second device, and sends the out-of-band key of the second device to the first device, so that the first device The device generates an encryption key according to the out-of-band key of the second device, then the first device generates a first signature generation key and a first signature verification key, and receives the second network key sent by the second device, and finally the first device Generate a key according to the first signature, sign the second network key, obtain the first signature information, and send the first connection information encrypted according to the encryption key to the second device, the first connection information includes the first signature information and a second network key. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention obtains the out-of-band key of the second device through out-of-band communication between the configuration device and the second device, and transfers the second device The two-device out-of-band key is sent to the first device, enabling communication between the first device and the second device, so that the first device can configure the second device, that is, when the configuration device and the second device When in-band communication cannot be performed between devices, for example, a certain device does not support in-band communication, or the configuration device does not match the in-band communication mode supported by a certain device, the first device can configure the second device, which can improve The success rate of device configuration.
本发明实施例提供的技术方案,应用于配置系统中,本发明的系统架构如图4所示,该配置系统包括第一设备、第二设备、配置设备及第三设备,配置设备与第一设备之间进行带内通信,配置设备与第二设备之间进行带外通信,配置设备与第三设备之间进行带内通信,第一设备已配置第二设备。The technical solutions provided by the embodiments of the present invention are applied to configuration systems. The system architecture of the present invention is shown in Figure 4. The configuration system includes a first device, a second device, a configuration device, and a third device. In-band communication between devices, out-of-band communication between the configuration device and the second device, in-band communication between the configuration device and the third device, the first device has configured the second device.
本发明实施例提供一种配置的方法,能够提高设备进行配置的成功率,如图5所示,所述方法包括:An embodiment of the present invention provides a configuration method that can improve the success rate of device configuration. As shown in FIG. 5, the method includes:
501、第三设备接收配置设备发送的第一签名验证密钥及第一网络密钥。501. The third device receives the first signature verification key and the first network key sent by the configuration device.
对于本发明实施例,第三设备支持带内通信,可以与配置设备之间进行带内通信,也可以与第二设备之间进行带内通信。在本发明实施例中,第三设备具体可以为:无线AP、智能终端、可穿戴设备或智能家居设备等。其中,智能终端包括手机、手机平板、平板及电脑等,可穿戴设备包括智能眼镜、智能手表、智能手环、智能戒指、智能项链、智能鞋子、智能帽子、智能头盔、智能衣服及智能护膝等,智能家居包括智能电视、智能音响、智能冰箱、智能洗衣机、智能空调、智能灯具、智能窗帘及智能报警器等。For the embodiment of the present invention, the third device supports in-band communication, and can perform in-band communication with the configuration device, and can also perform in-band communication with the second device. In the embodiment of the present invention, the third device may specifically be: a wireless AP, a smart terminal, a wearable device, or a smart home device, and the like. Among them, smart terminals include mobile phones, mobile tablets, tablets and computers, etc., and wearable devices include smart glasses, smart watches, smart bracelets, smart rings, smart necklaces, smart shoes, smart hats, smart helmets, smart clothes and smart knee pads, etc. , smart homes include smart TVs, smart speakers, smart refrigerators, smart washing machines, smart air conditioners, smart lamps, smart curtains and smart alarms.
对于本发明实施例,配置设备用于对设备进行配置,或者协助设备对其他设备进行配置。在本发明实施例中,配置设备可以为外部配置设备,也可以为内部配置设备,本发明实施例不做限定。其中,外部配置设备可以为具有丰富UI及较强大的计算能力的无线设备,例如,外部配置设备可以为智能手机、智能平板、智能眼镜或智能手表等,也可以为安装有相关应用程序单元的其他设备;内部配置设备也可以为一套应用程序模块,集成在硬件单元内,并可以通过该硬件单元提供的UI与其他设备进行交互, 例如,内部配置设备可以为集成在无线AP中的配置单元,该配置单元可以通过无线AP的输入单元实现配置过程中的输入,通过无线AP的输出单元实现配置过程中的输出。For the embodiment of the present invention, the configuration device is used to configure the device, or assist the device to configure other devices. In this embodiment of the present invention, the configuration device may be an external configuration device or an internal configuration device, which is not limited in this embodiment of the present invention. Wherein, the external configuration device can be a wireless device with a rich UI and relatively powerful computing capability, for example, the external configuration device can be a smart phone, a smart tablet, smart glasses or a smart watch, etc., or it can be a Other devices; the internal configuration device can also be a set of application modules, integrated in the hardware unit, and can interact with other devices through the UI provided by the hardware unit, For example, the internal configuration device can be a configuration unit integrated in the wireless AP. The configuration unit can realize input during the configuration process through the input unit of the wireless AP, and realize output during the configuration process through the output unit of the wireless AP.
对于本发明实施例,第一设备已配置第二设备。具体地,首先配置设备通过与第二设备之间进行带外通信,获取第二设备带外密钥,并发送给第一设备;然后第一设备与第二设备之间进行带内通信,实现第一设备配置第二设备。For this embodiment of the present invention, the first device has configured the second device. Specifically, first configure the device to obtain the out-of-band key of the second device through out-of-band communication with the second device, and send it to the first device; then perform in-band communication between the first device and the second device to realize The first device configures the second device.
对于本发明实施例,带外通信是指通信距离相对较短的通信方式,带内通信是指通信距离相对较长的通信方式。具体地,带内通信可以为:蓝牙、蓝牙低功耗、Wi-Fi、ZigBee、UWB、WiGig等;带外通信可以为:RFID、NFC、红外、激光、超声波、电容屏短距传输、光学识别或声学识别等。For the embodiment of the present invention, out-of-band communication refers to a communication method with a relatively short communication distance, and in-band communication refers to a communication method with a relatively long communication distance. Specifically, in-band communication can be: Bluetooth, Bluetooth Low Energy, Wi-Fi, ZigBee, UWB, WiGig, etc.; out-of-band communication can be: RFID, NFC, infrared, laser, ultrasonic, capacitive screen short-distance transmission, optical identification or acoustic identification, etc.
例如,当配置设备与第二设备之间进行带外通信的方式为光学识别时,首先第二设备提供一个包含第二设备带外密钥的二维码;然后配置设备通过自身的摄像头模块扫描该二维码,并进行解码获得验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For example, when the way of out-of-band communication between the configuration device and the second device is optical identification, the second device first provides a QR code containing the second device’s out-of-band key; then the configuration device scans the The two-dimensional code is decoded to obtain the verification information material; finally, the configuration device obtains the verification information according to the verification information material and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that The first device acquires verification information according to the verification information material.
再例如,当配置设备与第二设备之间进行带外通信的方式为声学识别时,首先第二设备通过自身的声学模块播放验证信息材料,然后配置设备收听该验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For another example, when the way of out-of-band communication between the configured device and the second device is acoustic recognition, the second device first plays the verification information material through its own acoustic module, and then configures the device to listen to the verification information material; finally configures the device according to The verification information material obtains verification information and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that the first device obtains verification information according to the verification information material.
需要说明的是,本发明实施例不限于上述配置设备与第二设备之间进行带外通信,其他任何可以实现配置设备与第二设备之间进行通信的方式,均适用本发明实施例,例如,配置设备与第二设备之间可以进行带内通信。 It should be noted that the embodiment of the present invention is not limited to the out-of-band communication between the above-mentioned configuration device and the second device, and any other method that can realize the communication between the configuration device and the second device is applicable to the embodiment of the present invention, for example , in-band communication can be performed between the configuration device and the second device.
对于本发明实施例,验证信息材料与验证信息之间,可以通过特定的编解码方式进行互相转换,也可以为相同的信息,本发明实施例不做限定。其中,当验证信息材料与验证信息之间需要进行互相转换时,可以直接通过base64/32/16编码方式,实现互相转换;也可以首先通过base64/32/16进行编码,然后通过ASN.1编码方式,实现互相转换。For the embodiment of the present invention, the verification information material and the verification information may be mutually converted through a specific encoding and decoding method, or may be the same information, which is not limited in the embodiment of the present invention. Among them, when the mutual conversion between the verification information material and the verification information is required, the mutual conversion can be realized directly through the base64/32/16 encoding method; it can also be first encoded through base64/32/16, and then encoded through ASN.1 way to achieve mutual conversion.
对于本发明实施例,第一签名验证密钥由第一设备生成并发送给配置设备,第一签名验证密钥用于对第一设备签名的信息进行解密,第一网络密钥由第一设备生成并发送给所述配置设备,第一网络密钥用于第二设备生成共享密钥。For the embodiment of the present invention, the first signature verification key is generated by the first device and sent to the configuration device, the first signature verification key is used to decrypt the information signed by the first device, and the first network key is generated by the first device Generated and sent to the configuration device, the first network key is used by the second device to generate a shared key.
需要说明的是,本发明实施例不限于上述第二设备根据第一网络密钥生成共享密钥,其他任何可以与第一设备进行通信的设备,均可以根据第一网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the second device generating a shared key based on the first network key, and any other device that can communicate with the first device can generate a shared key based on the first network key .
对于本发明实施例,第一网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第一网络密钥为非对称密钥时,第二网络密钥可以为DH公钥;也可以为ECDH公钥;还可以为ECDH公钥的X坐标或Y坐标。For this embodiment of the present invention, the first network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the first network key is an asymmetric key, the second network key can be a DH public key; it can also be an ECDH public key; it can also be the X coordinate or Y coordinate of the ECDH public key .
对于本发明实施例,第二网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第二网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the second network key may also be a result obtained by further encoding the key. For example, the second network key is the result obtained by directly encoding the DH key through base64/32/16, or it can also be obtained by first encoding the DH key through base64/32/16 and then encoding it through ASN.1 The result can also be the result obtained by directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key can be first encoded through base64/32/16, and then through ASN. 1 to encode the result.
502、第三设备接收第二设备发送的第一消息。502. The third device receives the first message sent by the second device.
其中,第一消息携带有第一连接信息,第一连接信息包括第一签名信息及对端网络密钥,第一签名信息由第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥 之间互相对应,第二网络密钥由第二设备生成,第二网络密钥用于第一设备或第三设备生成共享密钥。Wherein, the first message carries the first connection information, and the first connection information includes the first signature information and the peer network key, and the first signature information is generated by the first device using the first signature generation key to the second network key. The signature is obtained, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, the first signature generation key and the first signature verification key correspond to each other, the second network key is generated by the second device, and the second network key is used by the first device or the third device to generate a shared key.
需要说明的是,本发明实施例不限于上述第一设备或第三设备根据第二网络密钥生成共享密钥,其他任何可以与第二设备进行通信的设备,均可以根据第二网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the above-mentioned first device or third device generating a shared key according to the second network key, and any other device that can communicate with the second device can Generate a shared secret.
503、第三设备根据第一网络密钥,确定对端网络密钥是否合法。503. The third device determines whether the peer network key is valid according to the first network key.
其中,第四网络密钥由第三设备生成。Wherein, the fourth network key is generated by the third device.
具体地,第三设备可以确定对端网络密钥是否为信任网络密钥,从而确定对端网络密钥是否合法。其中,信任网络密钥为第一网络密钥或第四网络密钥。Specifically, the third device may determine whether the peer network key is a trusted network key, thereby determining whether the peer network key is legal. Wherein, the trusted network key is the first network key or the fourth network key.
对于本发明实施例,当第一设备已配置第二设备时,信任网络密钥为第一网络密钥;或者,当第三设备配置第二设备时,信任网络密钥为第四网络密钥。For this embodiment of the present invention, when the first device has configured the second device, the trusted network key is the first network key; or, when the third device configures the second device, the trusted network key is the fourth network key .
504、若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。504. If the peer network key is legal, the third device determines whether the second device is legal according to the first signature information.
对于本发明实施例,第一连接信息还可以包括第二网络密钥。For this embodiment of the present invention, the first connection information may further include the second network key.
具体地,第三设备可以根据第一签名验证密钥,对第一签名信息进行解密,得到解密结果,并将解密结果,与第二网络密钥进行比对,若解密结果与第二网络密钥匹配,则第三设备确定第二设备合法。Specifically, the third device may decrypt the first signature information according to the first signature verification key to obtain a decryption result, and compare the decryption result with the second network key. If the keys match, the third device determines that the second device is legitimate.
本发明实施例提供的配置的方法,当第一设备已配置第二设备时,首先配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第一签名验证密钥及第一网络密钥由第一设备生成并发送给配置设备,然后第二设备向第三设备发送携带有第一连接信息的第一消息,第一连接信息包括第一签名信息及对端网络密钥,最后第三设备根据第一网络密钥,确定对端网络密钥是否合法,若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过第一设备根据第二设备带外密钥对第二 设备进行配置,该第二设备带外密钥由配置设备与第二设备之间进行带外通信获得,并且配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第二设备向第三设备发送第一连接信息,能够实现第三设备根据第一网络密钥,确定第一连接信息中的对端网络密钥是否合法,并根据第一签名验证密钥,确定第一连接信息中的第一签名信息是否合法,从而可以将第一设备已配置的第二设备,配置给第三设备,即实现第三设备配置第二设备,进而可以提高设备进行配置的成功率。In the configuration method provided by the embodiment of the present invention, when the first device has configured the second device, the configuration device first sends the first signature verification key and the first network key, the first signature verification key and the second device to the third device. A network key is generated by the first device and sent to the configuration device, and then the second device sends the first message carrying the first connection information to the third device, and the first connection information includes the first signature information and the peer network key , and finally the third device determines whether the peer network key is legal according to the first network key, and if the peer network key is legal, the third device determines whether the second device is legal according to the first signature information. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention uses the first device to configure the second device according to the second device's out-of-band key. The device performs configuration, and the out-of-band key of the second device is obtained through out-of-band communication between the configuration device and the second device, and the configuration device sends the first signature verification key and the first network key to the third device, and the second The device sends the first connection information to the third device, so that the third device can determine whether the peer network key in the first connection information is legal according to the first network key, and determine the first Whether the first signature information in the connection information is legal, so that the second device that has been configured by the first device can be configured to the third device, that is, the third device can configure the second device, and the success rate of device configuration can be improved.
作为对图5所示方法的具体说明,本发明实施例提供另一种配置的方法,如图6所示,所述方法包括:As a specific description of the method shown in Figure 5, the embodiment of the present invention provides another configuration method, as shown in Figure 6, the method includes:
601、第三设备接收配置设备发送的第一签名验证密钥及第一网络密钥。601. The third device receives the first signature verification key and the first network key sent by the configuration device.
对于本发明实施例,第三设备支持带内通信,可以与配置设备之间进行带内通信,也可以与第二设备之间进行带内通信。在本发明实施例中,第三设备具体可以为:无线AP、智能终端、可穿戴设备或智能家居设备等。其中,智能终端包括手机、手机平板、平板及电脑等,可穿戴设备包括智能眼镜、智能手表、智能手环、智能戒指、智能项链、智能鞋子、智能帽子、智能头盔、智能衣服及智能护膝等,智能家居包括智能电视、智能音响、智能冰箱、智能洗衣机、智能空调、智能灯具、智能窗帘及智能报警器等。For the embodiment of the present invention, the third device supports in-band communication, and can perform in-band communication with the configuration device, and can also perform in-band communication with the second device. In the embodiment of the present invention, the third device may specifically be: a wireless AP, a smart terminal, a wearable device, or a smart home device, and the like. Among them, smart terminals include mobile phones, mobile tablets, tablets and computers, etc., and wearable devices include smart glasses, smart watches, smart bracelets, smart rings, smart necklaces, smart shoes, smart hats, smart helmets, smart clothes and smart knee pads, etc. , smart homes include smart TVs, smart speakers, smart refrigerators, smart washing machines, smart air conditioners, smart lamps, smart curtains and smart alarms.
对于本发明实施例,配置设备用于对设备进行配置,或者协助设备对其他设备进行配置。在本发明实施例中,配置设备可以为外部配置设备,也可以为内部配置设备,本发明实施例不做限定。其中,外部配置设备可以为具有丰富UI及较强大的计算能力的无线设备,例如,外部配置设备可以为智能手机、智能平板、智能眼镜或智能手表等,也可以为安装有相关应用程序单元的其他设备;内部配置设备也可以为一套应用程序模块,集成在硬件单元内,并可以通过该硬件单元提供的UI与其他设备进行交互,例如,内部配置设备可以为集成在无线AP中的配置单元,该配置单元可 以通过无线AP的输入单元实现配置过程中的输入,通过无线AP的输出单元实现配置过程中的输出。For the embodiment of the present invention, the configuration device is used to configure the device, or assist the device to configure other devices. In this embodiment of the present invention, the configuration device may be an external configuration device or an internal configuration device, which is not limited in this embodiment of the present invention. Wherein, the external configuration device can be a wireless device with a rich UI and relatively powerful computing capability, for example, the external configuration device can be a smart phone, a smart tablet, smart glasses or a smart watch, etc., or it can be a Other devices; the internal configuration device can also be a set of application modules integrated in the hardware unit, and can interact with other devices through the UI provided by the hardware unit. For example, the internal configuration device can be a configuration integrated in the wireless AP unit, the configuration unit can be The input in the configuration process can be realized through the input unit of the wireless AP, and the output in the configuration process can be realized through the output unit of the wireless AP.
对于本发明实施例,第一设备已配置第二设备。具体地,首先配置设备通过与第二设备之间进行带外通信,获取第二设备带外密钥,并发送给第一设备;然后第一设备与第二设备之间进行带内通信,实现第一设备配置第二设备。For this embodiment of the present invention, the first device has configured the second device. Specifically, first configure the device to obtain the out-of-band key of the second device through out-of-band communication with the second device, and send it to the first device; then perform in-band communication between the first device and the second device to realize The first device configures the second device.
对于本发明实施例,带外通信是指通信距离相对较短的通信方式,带内通信是指通信距离相对较长的通信方式。具体地,带内通信可以为:蓝牙、蓝牙低功耗、Wi-Fi、ZigBee、UWB、WiGig等;带外通信可以为:RFID、NFC、红外、激光、超声波、电容屏短距传输、光学识别或声学识别等。For the embodiment of the present invention, out-of-band communication refers to a communication method with a relatively short communication distance, and in-band communication refers to a communication method with a relatively long communication distance. Specifically, in-band communication can be: Bluetooth, Bluetooth Low Energy, Wi-Fi, ZigBee, UWB, WiGig, etc.; out-of-band communication can be: RFID, NFC, infrared, laser, ultrasonic, capacitive screen short-distance transmission, optical identification or acoustic identification, etc.
例如,当配置设备与第二设备之间进行带外通信的方式为光学识别时,首先第二设备提供一个包含第二设备带外密钥的二维码;然后配置设备通过自身的摄像头模块扫描该二维码,并进行解码获得验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For example, when the way of out-of-band communication between the configuration device and the second device is optical identification, the second device first provides a QR code containing the second device’s out-of-band key; then the configuration device scans the The two-dimensional code is decoded to obtain the verification information material; finally, the configuration device obtains the verification information according to the verification information material and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that The first device acquires verification information according to the verification information material.
再例如,当配置设备与第二设备之间进行带外通信的方式为声学识别时,首先第二设备通过自身的声学模块播放验证信息材料,然后配置设备收听该验证信息材料;最后配置设备根据该验证信息材料获取验证信息,并发送给第一设备,或者,配置设备直接将该验证信息材料发送给第一设备,以使得第一设备根据该验证信息材料获取验证信息。For another example, when the way of out-of-band communication between the configured device and the second device is acoustic recognition, the second device first plays the verification information material through its own acoustic module, and then configures the device to listen to the verification information material; finally configures the device according to The verification information material obtains verification information and sends it to the first device, or the configuration device directly sends the verification information material to the first device, so that the first device obtains verification information according to the verification information material.
需要说明的是,本发明实施例不限于上述配置设备与第二设备之间进行带外通信,其他任何可以实现配置设备与第二设备之间进行通信的方式,均适用本发明实施例,例如,配置设备与第二设备之间可以进行带内通信。It should be noted that the embodiment of the present invention is not limited to the out-of-band communication between the above-mentioned configuration device and the second device, and any other method that can realize the communication between the configuration device and the second device is applicable to the embodiment of the present invention, for example , in-band communication can be performed between the configuration device and the second device.
对于本发明实施例,验证信息材料与验证信息之间,可以通过特定的 编解码方式进行互相转换,也可以为相同的信息,本发明实施例不做限定。其中,当验证信息材料与验证信息之间需要进行互相转换时,可以直接通过base64/32/16编码方式,实现互相转换;也可以首先通过base64/32/16进行编码,然后通过ASN.1编码方式,实现互相转换。For the embodiment of the present invention, between the verification information material and the verification information, a specific The encoding and decoding modes are mutually converted, and may also be the same information, which is not limited in this embodiment of the present invention. Among them, when the mutual conversion between the verification information material and the verification information is required, the mutual conversion can be realized directly through the base64/32/16 encoding method; it can also be first encoded through base64/32/16, and then encoded through ASN.1 way to achieve mutual conversion.
其中,第一签名验证密钥由第一设备生成并发送给配置设备,第一签名验证密钥用于对第一设备签名的信息进行解密,第一网络密钥由第一设备生成并发送给配置设备,第一网络密钥用于第二设备生成共享密钥。Wherein, the first signature verification key is generated by the first device and sent to the configuration device, the first signature verification key is used to decrypt the information signed by the first device, and the first network key is generated by the first device and sent to the The device is configured, and the first network key is used by the second device to generate a shared key.
需要说明的是,本发明实施例不限于上述第二设备根据第一网络密钥生成共享密钥,其他任何可以与第一设备进行通信的设备,均可以根据第一网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the second device generating a shared key based on the first network key, and any other device that can communicate with the first device can generate a shared key based on the first network key .
对于本发明实施例,第一签名验证密钥可以用A-sign-key1来指代,第一网络密钥可以用A-net-pub来指代。在本发明实施例中,A用于标识第一设备,B用于标识第二设备,C用于标识配置设备,D用于标识第三设备,sign用于表示签名(Signature),key用于表示密钥,key1用于表示验证密钥,key2用于表示生成密钥,net用于表示网络(network),pub用于表示公共(public),priv用于表示私有(private)。For this embodiment of the present invention, the first signature verification key may be referred to by A-sign-key1, and the first network key may be referred to by A-net-pub. In this embodiment of the present invention, A is used to identify the first device, B is used to identify the second device, C is used to identify the configuration device, D is used to identify the third device, sign is used to indicate a signature (Signature), and key is used to Represents the key, key1 is used to represent the verification key, key2 is used to represent the generated key, net is used to represent the network (network), pub is used to represent the public (public), and priv is used to represent the private (private).
需要说明的是,本发明实施例不限于上述对各设备的标识方式,及对各密钥的标识方式,其他任何可以用于标识设备或密钥的方式,均适用本发明实施例。It should be noted that the embodiments of the present invention are not limited to the above-mentioned identification methods for each device and each key, and any other methods that can be used to identify devices or keys are applicable to the embodiments of the present invention.
对于本发明实施例,第一设备生成一对签名密钥,分别为第一签名验证密钥及第一签名生成密钥。其中,第一签名验证密钥用于发送给其他设备,以使得其他设备可以通过该第一签名验证密钥,对第一设备签名的信息进行解密;第一签名生成密钥用于配置设备进行签名。For this embodiment of the present invention, the first device generates a pair of signature keys, which are respectively the first signature verification key and the first signature generation key. Wherein, the first signature verification key is used to send to other devices, so that other devices can decrypt the information signed by the first device through the first signature verification key; the first signature generation key is used to configure the device to perform sign.
对于本发明实施例,第一网络密钥可以为对称密钥,也可以为非对称密钥,本发明实施例不做限定。在本发明实施例中,当第一网络密钥为非对称密钥时,第一网络密钥可以为DH公钥;也可以为ECDH公钥;还可以为ECDH公钥的X坐标或Y坐标。 For this embodiment of the present invention, the first network key may be a symmetric key or an asymmetric key, which is not limited in this embodiment of the present invention. In the embodiment of the present invention, when the first network key is an asymmetric key, the first network key can be a DH public key; it can also be an ECDH public key; it can also be the X coordinate or Y coordinate of the ECDH public key .
对于本发明实施例,第一网络密钥还可以为对密钥进行进一步编码得到的结果。例如,第一网络密钥为对DH密钥直接通过base64/32/16进行编码得到的结果,还可以为对DH密钥首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果,还可以为对ECDH密钥的X坐标直接通过base64/32/16进行编码得到的结果,还可以为对ECDH密钥的Y坐标首先通过base64/32/16进行编码,然后通过ASN.1进行编码得到的结果。For this embodiment of the present invention, the first network key may also be a result obtained by further encoding the key. For example, the first network key is the result obtained by directly encoding the DH key through base64/32/16, or it can also be obtained by first encoding the DH key through base64/32/16 and then encoding it through ASN.1 The result can also be the result obtained by directly encoding the X coordinate of the ECDH key through base64/32/16, or the Y coordinate of the ECDH key can be first encoded through base64/32/16, and then through ASN. 1 to encode the result.
602、第三设备生成第四网络密钥。602. The third device generates a fourth network key.
其中,第四网络密钥用于第二设备生成共享密钥。在本发明实施例中,第四网络密钥可以用D-net-pub来指代。Wherein, the fourth network key is used by the second device to generate a shared key. In this embodiment of the present invention, the fourth network key may be referred to as D-net-pub.
需要说明的是,本发明实施例不限于上述第二设备根据第四网络密钥生成共享密钥,其他任何可以与第三设备进行通信的设备,均可以根据第四网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the second device generating a shared key based on the fourth network key, and any other device that can communicate with the third device can generate a shared key based on the fourth network key .
603、第三设备将第四网络密钥发送给配置设备。603. The third device sends the fourth network key to the configuration device.
604、第三设备接收配置设备发送的第四连接信息。604. The third device receives fourth connection information sent by the configuration device.
其中,第四连接信息包括第四签名信息及第四网络密钥,第四签名信息由配置设备利用第二签名生成密钥对第四网络密钥进行签名得到,第二签名生成密钥及第二签名验证密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名验证密钥用于对配置设备签名的信息进行解密,第二签名生成密钥与第二签名验证密钥之间互相对应。在本发明实施例中,第四连接信息可以用Connector4来指代,第四签名信息可以用signature4来指代,第二签名验证密钥可以用C-sign-key1来指代,第二签名生成密钥可以用C-sign-key2来指代。Wherein, the fourth connection information includes the fourth signature information and the fourth network key, the fourth signature information is obtained by the configuration device using the second signature generation key to sign the fourth network key, the second signature generation key and the The second signature verification key is generated by the configuration device. The second signature generation key is used to configure the device to sign. The second signature verification key is used to decrypt the information signed by the configuration device. The second signature generation key is the same as the second signature The verification keys correspond to each other. In the embodiment of the present invention, the fourth connection information can be referred to as Connector4, the fourth signature information can be referred to as signature4, the second signature verification key can be referred to as C-sign-key1, and the second signature generation The key can be referred to by C-sign-key2.
对于本发明实施例,配置设备生成一对签名密钥,分别为第二签名验证密钥及第二签名生成密钥。其中,第二签名验证密钥用于发送给其他设备,以使得其他设备可以通过该第二签名验证密钥,对第二设备签名的信息进行解密;第二签名生成密钥用于配置设备进行签名。For the embodiment of the present invention, the configuration device generates a pair of signature keys, which are respectively the second signature verification key and the second signature generation key. Wherein, the second signature verification key is used to send to other devices, so that other devices can decrypt the information signed by the second device through the second signature verification key; the second signature generation key is used to configure the device to perform sign.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为 非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对应的公钥;或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are When using an asymmetric key, the second signature generation key is the corresponding private key, and the second signature verification key is the corresponding public key; or, when the second signature generation key and the second signature verification key are symmetric key, the second signature generation key is the same as the second signature verification key.
对于本发明实施例,连接信息具体可以包括:网络标识信息、对端网络密钥信息、待配置网络密钥信息、配置设备标识信息及配置设备的签名信息。在本发明实施例中,连接信息的具体表现形式可以为:For the embodiment of the present invention, the connection information may specifically include: network identification information, peer network key information, network key information to be configured, configuration device identification information, and configuration device signature information. In the embodiment of the present invention, the specific form of connection information may be:
其中,netID用于表示待配置设备被配置加入或被配置创建的网络的网络标识;PeerKey用于表示待配置设备被配置连接的的对端设备的网络密钥。在本发明实施例中,当PeerKey为Wildcard(通配符)时,表示待配置设备可以与网络中的所有设备连接。Among them, netID is used to represent the network identifier of the network that the device to be configured is configured to join or to be configured to create; PeerKey is used to represent the network key of the peer device to which the device to be configured is configured to connect. In the embodiment of the present invention, when the PeerKey is Wildcard (wildcard), it means that the device to be configured can be connected to all devices in the network.
对于本发明实施例,配置设备构造的第四连接信息具体可以为:For this embodiment of the present invention, the fourth connection information constructed by the configuration device may specifically be:
其中,SSID为网络标识,当第一设备为无线AP时,netID为该无线AP的SSID;wildcard为通配符,当peerKey为wildcard时,表示第一设备可以与网络中的所有设备连接;C-id为配置设备的标识信息。Wherein, SSID is a network identifier, and when the first device is a wireless AP, netID is the SSID of the wireless AP; wildcard is a wildcard, and when peerKey is wildcard, it means that the first device can be connected to all devices in the network; C-id To configure the identification information of the device.
具体地,配置设备可以按照DSA、ECDSA或RSA等签名算法,根据 C-sign-key2,对D-net-pub进行签名,得到signature4。Specifically, the configuration device can use signature algorithms such as DSA, ECDSA, or RSA, according to C-sign-key2, sign D-net-pub to get signature4.
对于本发明实施例,配置设备还可以按照DSA、ECDSA或RSA等签名算法,根据C-sign-key2,对D-net-pub以及其他项,进行签名,得到signature4。其中,其他项可以为SSID、wildcard及C-id中的任一项或者任意组合。For the embodiment of the present invention, the configuration device can also sign D-net-pub and other items according to DSA, ECDSA or RSA and other signature algorithms according to C-sign-key2 to obtain signature4. Wherein, other items may be any one or any combination of SSID, wildcard and C-id.
对于本发明实施例,配置设备还可以首先将C-sign-key2进行转换,然后按照DSA、ECDSA或RSA等签名算法,根据转换后的C-sign-key2,对A-net-pub,或者A-net-pub以及其他项,进行签名,得到signature4。For this embodiment of the present invention, the configuration device can also first convert C-sign-key2, and then according to DSA, ECDSA or RSA and other signature algorithms, according to the converted C-sign-key2, to A-net-pub, or A-net-pub -net-pub and other items are signed to get signature4.
605、第三设备向第二设备发送第四消息。605. The third device sends a fourth message to the second device.
其中,第四消息携带有第四连接信息,第四连接信息包括第四签名信息。在本发明实施例中,第四消息可以用M4来指代。Wherein, the fourth message carries fourth connection information, and the fourth connection information includes fourth signature information. In this embodiment of the present invention, the fourth message may be referred to by M4.
进一步地,通过第三设备向第二设备发送第四消息,以使得第二设备接收第三设备发送的第四消息,并根据第四消息携带的第四签名信息,以及第二签名验证密钥,确定第三设备是否合法,第二签名验证密钥由第一设备配置第二设备时,发送给第二设备。Further, the third device sends a fourth message to the second device, so that the second device receives the fourth message sent by the third device, and according to the fourth signature information carried in the fourth message and the second signature verification key , to determine whether the third device is legitimate, and send the second signature verification key to the second device when the first device configures the second device.
对于本发明实施例,第二设备接收到的第四消息携带的第四连接信息具体可以为:For this embodiment of the present invention, the fourth connection information carried in the fourth message received by the second device may specifically be:
可选地,第二设备验证Connector4的具体过程可以为:首先,第二设备验证Connector4中的netID,是否与Connector1中的netID匹配,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector4中的netID与Connector1中的netID均为SSID,二者匹配;然后, 第二设备验证Connector4中的peerKey是否为自身生成的网络密钥或wildcard,若匹配则继续验证Connector4,若不匹配则放弃验证,在本发明实施例中,Connector4中的peerKey为wildcard,故而peerKey匹配;其次,第二设备验证Connector4中的introducer是否为信任设备,若是则继续验证Connector4,若不是则放弃验证,在本发明实施例中,Connector4中的introducer为C-id,即配置设备的标识信息,故而为信任设备;最后,第二设备根据C-sign-key1,验证signature4是否合法,若合法则确定Connector4合法,若不合法则放弃验证,在本发明实施例中,signature2由配置设备根据C-sign-key2进行签名得到,故而signature4合法,因此,第二设备确定Connector4合法,即第二设备确定第一设备合法。Optionally, the specific process for the second device to verify Connector4 can be as follows: First, the second device verifies the netID in Connector4, whether it matches the netID in Connector1, if it matches, then continue to verify Connector1, if it does not match, then give up verification, in this In the embodiment of the invention, the netID in Connector4 and the netID in Connector1 are both SSIDs, and the two match; then, The second device verifies whether the peerKey in Connector4 is the network key or wildcard generated by itself, if it matches, then continue to verify Connector4, if it does not match, then give up verification, in the embodiment of the present invention, the peerKey in Connector4 is wildcard, so peerKey matches Secondly, whether the introducer in the second device verification Connector4 is a trusted device, if so, continue to verify Connector4, if not then give up the verification, in the embodiment of the present invention, the introducer in Connector4 is C-id, that is, the identification information of the configuration device , so it is a trusted device; finally, the second device verifies whether signature4 is legal according to C-sign-key1, if it is legal, it determines that Connector4 is legal, and if it is not legal, it abandons the verification. In the embodiment of the present invention, signature2 is configured by the device according to C- The sign-key2 is obtained by signing, so signature4 is legal. Therefore, the second device determines that Connector4 is legal, that is, the second device determines that the first device is legal.
对于本发明实施例,第二设备根据C-sign-key1验证signature4是否合法具体可以为:第二设备首先根据第二签名验证密钥,对第四签名信息进行解密,得到解密结果,然后将解密结果,与第四连接信息包括的第四网络密钥进行比对,若解密结果与第四网络密钥匹配,则第二设备确定第三设备合法。For this embodiment of the present invention, the second device verifies whether signature4 is legal according to C-sign-key1. Specifically, the second device first decrypts the fourth signature information according to the second signature verification key to obtain the decryption result, and then decrypts the decrypted As a result, it is compared with the fourth network key included in the fourth connection information, and if the decryption result matches the fourth network key, the second device determines that the third device is legal.
对于本发明实施例,解密结果与第四网络密钥匹配,是指解密结果与第四网络密钥相同;或者,对解密结果进行转换后,与第四网络密钥相同;或者,对第四网络密钥进行转换后,与解密结果相同;或者,转换后的解密结果,与转换后的第四网络密钥相同。For this embodiment of the present invention, the decryption result matches the fourth network key, which means that the decryption result is the same as the fourth network key; or, after the decryption result is converted, it is the same as the fourth network key; or, the fourth network key After the network key is converted, it is the same as the decryption result; or, the converted decryption result is the same as the converted fourth network key.
对于本发明实施例,对解密结果或者第四网络密钥转换的方式,可以为直接通过base64/32/16编码方式,对解密结果或者第四网络密钥进行转换;也可以为首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对解密结果或者第四网络密钥进行转换。For the embodiment of the present invention, the way to convert the decryption result or the fourth network key may be to convert the decryption result or the fourth network key directly through base64/32/16 encoding; 32/16, and then use the ASN.1 encoding method to convert the decryption result or the fourth network key.
对于本发明实施例,第四签名信息还可以由配置设备根据第二签名生成密钥,对第四连接信息中的待配置网络密钥及其他项,进行签名得到。其中,其他项为第四连接信息中的网络标识、对端网络密钥及配置设备标识中的任一项或者任意组合。此时,解密结果与第四网络密钥匹配,是指 第四网络密钥及其他项,与解密结果相同;或者,对第四网络密钥及其他项进行转换后,与解密结果相同;或者,对解密结果进行转换后,与第四网络密钥及其他项相同;或者,转换后的第四网络密钥及其他项,与转换后的解密结果相同。For the embodiment of the present invention, the fourth signature information may also be obtained by the configuration device signing the network key to be configured and other items in the fourth connection information according to the second signature generation key. Wherein, the other items are any one or any combination of the network identifier, the peer network key, and the configured device identifier in the fourth connection information. At this time, the decryption result matches the fourth network key, which means The fourth network key and other items are the same as the decryption result; or, after converting the fourth network key and other items, it is the same as the decryption result; or, after converting the decryption result, it is the same as the fourth network key and Other items are the same; or, the converted fourth network key and other items are the same as the converted decryption result.
例如,当signature4由配置设备根据C-sign-key2,对D-net-pub、SSID、wildcard及C-id进行签名得到时,第二设备根据C-sign-key1,对signature4进行解密,得到解密结果,该解密结果与D-net-pub、SSID、wildcard及C-id相同;或者,转换后的解密结果,与D-net-pub、SSID、wildcard及C-id相同;或者,解密结果,与转换后的D-net-pub、SSID、wildcard及C-id相同;或者,转换后的解密结果,与转换后的D-net-pub、SSID、wildcard及C-id相同。具体地,若转换方式为哈希转换,当signature4由配置设备根据C-sign-key2,对D-net-pub、SSID、wildcard及C-id进行哈希后进行签名得到时,第二设备根据C-sign-key1,对signature4进行解密,得到解密结果,该解密结果与对D-net-pub、SSID、wildcard及C-id进行哈希后的结果相同。For example, when signature4 is obtained by the configuration device signing D-net-pub, SSID, wildcard and C-id according to C-sign-key2, the second device decrypts signature4 according to C-sign-key1 to obtain the decryption As a result, the decryption result is the same as D-net-pub, SSID, wildcard and C-id; or, the converted decryption result is the same as D-net-pub, SSID, wildcard and C-id; or, the decryption result, It is the same as the converted D-net-pub, SSID, wildcard and C-id; or, the converted decryption result is the same as the converted D-net-pub, SSID, wildcard and C-id. Specifically, if the conversion method is hash conversion, when signature4 is obtained by the configuration device after hashing D-net-pub, SSID, wildcard, and C-id according to C-sign-key2, the second device obtains it according to C-sign-key1 decrypts signature4 to obtain the decryption result, which is the same as the hashed result of D-net-pub, SSID, wildcard and C-id.
对于本发明实施例,若第二设备确定Connector4合法,并且Connector4中的netKey与Connector1中的netKey不同,则第二设备认为Connector4中的netKey为更新后的网络密钥,并且根据D-net-pub,重新生成共享密钥。For this embodiment of the present invention, if the second device determines that Connector4 is legal, and the netKey in Connector4 is different from the netKey in Connector1, then the second device considers the netKey in Connector4 to be an updated network key, and according to D-net-pub , to regenerate the shared secret.
对于本发明实施例,第二设备根据第四网络密钥生成第四共享密钥。其中,第四共享密钥为第三设备与第一设备之间进行握手认证的预先密钥。For this embodiment of the present invention, the second device generates the fourth shared key according to the fourth network key. Wherein, the fourth shared key is a pre-key for handshake authentication between the third device and the first device.
可选地,第二设备可以按照DH密钥生成算法,根据第二网络密钥对应的私钥,以及第四网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第四共享密钥。在本发明实施例中,第四共享密钥可以为DH(B-net-priv,D-net-pub)。Optionally, the second device may generate a DH shared key according to the DH key generation algorithm, according to the private key corresponding to the second network key, and the fourth network key, and share the key with DH, or share the key with DH A key derived from the key is used as the fourth shared key. In this embodiment of the present invention, the fourth shared key may be DH (B-net-priv, D-net-pub).
可替换地,第二设备还可以按照ECDH密钥生成算法,根据第二网络密钥对应的私钥,以及第四网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第四共享密钥。 在本发明实施例中,第四共享密钥可以为ECDH(B-net-priv,D-net-pub)。Alternatively, the second device can also generate an ECDH shared key according to the ECDH key generation algorithm according to the private key corresponding to the second network key and the fourth network key, and use the ECDH shared key, or use the ECDH A key derived from the shared key is used as the fourth shared key. In this embodiment of the present invention, the fourth shared key may be ECDH (B-net-priv, D-net-pub).
606、第三设备接收第二设备发送的第一消息。606. The third device receives the first message sent by the second device.
其中,第一消息携带有第一连接信息,第一连接信息包括第一签名信息及对端网络密钥,第一签名信息由第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应,第二网络密钥由第二设备生成,第二网络密钥用于第一设备或第三设备生成共享密钥。在本发明实施例中,第一消息可以用M1来指代,第一连接信息可以用Connector1来指代,第一签名信息可以用signature1来指代,第二网络密钥可以用B-net-pub来指代。Wherein, the first message carries the first connection information, and the first connection information includes the first signature information and the peer network key, and the first signature information is generated by the first device using the first signature generation key to the second network key. The signature is obtained, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, the first signature generation key and the first signature verification key correspond to each other, the second network The key is generated by the second device, and the second network key is used by the first device or the third device to generate a shared key. In this embodiment of the present invention, the first message can be referred to by M1, the first connection information can be referred to by Connector1, the first signature information can be referred to by signature1, and the second network key can be referred to by B-net- pub to refer to.
对于本发明实施例,第一设备构造的第一连接信息具体可以为:For this embodiment of the present invention, the first connection information constructed by the first device may specifically be:
可选地,步骤606之后,还可以包括:首先,第三设备验证Connector1中的netID,是否与Connector4中的netID匹配,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector1中的netID与Connector4中的netID均为SSID,二者匹配。Optionally, after step 606, it may also include: first, the third device verifies the netID in Connector1, whether it matches the netID in Connector4, if it matches, continues to verify Connector1, and if it does not match, then abandons the verification. In the embodiment of the present invention , the netID in Connector1 and the netID in Connector4 are both SSIDs, and they match.
607、第三设备根据第一网络密钥,确定对端网络密钥是否合法。607. The third device determines whether the peer network key is valid according to the first network key.
可选地,步骤607可以为,第三设备确定对端网络密钥是否为信任的网络密钥。其中,信任的网络密钥包括第一网络密钥或第四网络密钥。具体地,当第一设备已配置第二设备时,信任网络密钥为第一网络密钥;或者,当第三设备配置第二设备时,信任网络密钥为第四网络密钥。Optionally, step 607 may be that the third device determines whether the peer network key is a trusted network key. Wherein, the trusted network key includes the first network key or the fourth network key. Specifically, when the first device has configured the second device, the trusted network key is the first network key; or, when the third device has configured the second device, the trusted network key is the fourth network key.
具体地,第三设备验证Connector1中的peerKey是否为A-net-pub或 D-net-pub或wildcard,若匹配则继续验证Connector1,若不匹配则放弃验证,在本发明实施例中,Connector1中的peerKey为A-net-pub,故而peerKey匹配。Specifically, the third device verifies whether the peerKey in Connector1 is A-net-pub or D-net-pub or wildcard, if it matches, then continue to verify Connector1, if not match, then give up verification, in the embodiment of the present invention, the peerKey in Connector1 is A-net-pub, so the peerKey matches.
可选地,步骤607之后,还可以包括:第三设备验证Connector1中的introducer是否为信任设备,若是则继续验证Connector1,若不是则放弃验证,在本发明实施例中,Connector1中的introducer为A-id,即自身的标识信息,故而为信任设备。Optionally, after step 607, it may also include: the third device verifies whether the introducer in Connector1 is a trusted device, if so, continues to verify Connector1, and if not, gives up the verification. In the embodiment of the present invention, the introducer in Connector1 is A -id is its own identification information, so it is a trusted device.
608、第三设备利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果。608. The third device decrypts the first signature information by using the first signature verification key to obtain a decryption result.
具体地,第三设备根据A-sign-key1,验证signature1是否合法,若合法则确定Connector1合法,若不合法则放弃验证,在本发明实施例中,signature1由第一设备根据A-sign-key2进行签名得到,故而signature1合法,因此,第三设备确定Connector1合法,即第三设备确定第二设备合法。Specifically, the third device verifies whether signature1 is legal according to A-sign-key1, and if it is legal, it determines that Connector1 is legal; The signature is obtained, so signature1 is legal. Therefore, the third device determines that Connector1 is legal, that is, the third device determines that the second device is legal.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
609、第三设备将解密结果,与第二网络密钥进行比对。609. The third device compares the decryption result with the second network key.
对于本发明实施例,第一连接信息还可以包括第二网络密钥。For this embodiment of the present invention, the first connection information may further include the second network key.
610、若解密结果与第二网络密钥匹配,则第三设备确定第二设备合法。610. If the decryption result matches the second network key, the third device determines that the second device is legal.
对于本发明实施例,解密结果与第二网络密钥匹配,是指解密结果与第二网络密钥相同;或者,对解密结果进行转换后,与第二网络密钥相同;或者,对第二网络密钥进行转换后,与解密结果相同;或者,转换后的解密结果,与转换后的第二网络密钥相同。For this embodiment of the present invention, the decryption result matches the second network key, which means that the decryption result is the same as the second network key; or, after the decryption result is converted, it is the same as the second network key; or, the second network key After the network key is converted, it is the same as the decryption result; or, the converted decryption result is the same as the converted second network key.
对于本发明实施例,对解密结果或者第二网络密钥转换的方式,可以为直接通过base64/32/16编码方式,对解密结果或者第二网络密钥进行转 换;也可以为首先通过base64/32/16进行编码,然后通过ASN.1编码方式,对解密结果或者第二网络密钥进行转换。For the embodiment of the present invention, the way to convert the decryption result or the second network key may be to convert the decryption result or the second network key directly through base64/32/16 encoding. It can also be encoded by base64/32/16 first, and then converted by the ASN.1 encoding method to the decryption result or the second network key.
对于本发明实施例,第一签名信息还可以由第一设备根据第一签名生成密钥,对第一连接信息中的待配置网络密钥及其他项,进行签名得到。其中,其他项为第一连接信息中的网络标识、对端网络密钥及配置设备标识中的任一项或者任意组合。此时,解密结果与第二网络密钥匹配,是指第二网络密钥及其他项,与解密结果相同;或者,对第二网络密钥及其他项进行转换后,与解密结果相同;或者,对解密结果进行转换后,与第二网络密钥及其他项相同;或者,转换后的第二网络密钥及其他项,与转换后的解密结果相同。For the embodiment of the present invention, the first signature information may also be obtained by the first device signing the network key to be configured and other items in the first connection information according to the first signature generation key. Wherein, the other item is any one or any combination of the network identifier, the peer network key, and the configured device identifier in the first connection information. At this time, the decryption result matches the second network key, which means that the second network key and other items are the same as the decryption result; or, after conversion of the second network key and other items, it is the same as the decryption result; or , after converting the decryption result, it is the same as the second network key and other items; or, the converted second network key and other items are the same as the converted decryption result.
例如,当signature1由第一设备根据A-sign-key2,对B-net-pub、SSID、A-net-pub及A-id进行签名得到时,第三设备根据A-sign-key1,对signature1进行解密,得到解密结果,该解密结果与B-net-pub、SSID、A-net-pub及A-id相同;或者,转换后的解密结果,与B-net-pub、SSID、A-net-pub及A-id相同;或者,解密结果,与转换后的B-net-pub、SSID、A-net-pub及A-id相同;或者,转换后的解密结果,与转换后的B-net-pub、SSID、A-net-pub及A-id相同。具体地,若转换方式为哈希转换,当signature1由第一设备根据A-sign-key2,对B-net-pub、SSID、A-net-pub及A-id进行哈希后进行签名得到时,第一设备根据A-sign-key1,对signature1进行解密,得到解密结果,该解密结果与对B-net-pub、SSID、A-net-pub及A-id进行哈希后的结果相同。For example, when signature1 is obtained by the first device signing B-net-pub, SSID, A-net-pub and A-id according to A-sign-key2, the third device signs signature1 according to A-sign-key1 Perform decryption to obtain the decryption result, which is the same as B-net-pub, SSID, A-net-pub and A-id; or, the converted decryption result is the same as B-net-pub, SSID, A-net -pub and A-id are the same; or, the decryption result is the same as the converted B-net-pub, SSID, A-net-pub and A-id; or, the converted decryption result is the same as the converted B-net-pub net-pub, SSID, A-net-pub and A-id are the same. Specifically, if the conversion method is hash conversion, when signature1 is obtained by signing B-net-pub, SSID, A-net-pub and A-id according to A-sign-key2 by the first device , the first device decrypts signature1 according to A-sign-key1 to obtain a decryption result, which is the same as the hashed result of B-net-pub, SSID, A-net-pub and A-id.
611、第三设备至少根据第二网络密钥,生成第三共享密钥。611. The third device generates a third shared key at least according to the second network key.
其中,第三共享密钥为第三设备与第二设备之间进行握手认证的预先密钥。Wherein, the third shared key is a pre-key for handshake authentication between the third device and the second device.
可选地,第三设备按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第三共享密钥。其中,第 四网络密钥用于第二设备生成共享密钥。在本发明实施例中,第三共享密钥可以为DH(D-net-priv,B-net-pub)。其中,第四网络密钥对应的私钥可以为D-net-priv。Optionally, the third device generates a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and uses the DH shared key, Or a key derived from the DH shared key is used as the third shared key. Among them, the first The four network keys are used by the second device to generate a shared key. In this embodiment of the present invention, the third shared key may be DH (D-net-priv, B-net-pub). Wherein, the private key corresponding to the fourth network key may be D-net-priv.
需要说明的是,本发明实施例不限于上述第二设备根据第四网络密钥生成共享密钥,其他任何可以与第三设备进行通信的设备,均可以根据第四网络密钥生成共享密钥。It should be noted that this embodiment of the present invention is not limited to the second device generating a shared key based on the fourth network key, and any other device that can communicate with the third device can generate a shared key based on the fourth network key .
可替换地,第三设备按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第三共享密钥。在本发明实施例中,第三共享密钥可以为ECDH(D-net-priv,B-net-pub)。Alternatively, the third device generates an ECDH shared key according to the private key corresponding to the fourth network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, The ECDH shared key, or a key derived from the ECDH shared key is used as the third shared key. In this embodiment of the present invention, the third shared key may be ECDH (D-net-priv, B-net-pub).
需要说明的是,本领域技术人员能够理解,第三设备根据第四网络密钥对应的私钥以及第二网络密钥生成的第三共享密钥,与第二设备根据第二网络密钥对应的私钥以及第四网络密钥生成的第四共享密钥相同。It should be noted that those skilled in the art can understand that the third shared key generated by the third device according to the private key corresponding to the fourth network key and the second network key corresponds to the shared key generated by the second device according to the second network key. The private key and the fourth shared key generated by the fourth network key are the same.
对于本发明实施例,通过第三设备生成的第三共享密钥,与第二设备生成的第四共享密钥相同,能够实现第三设备与第二设备之间的握手认证。For the embodiment of the present invention, the third shared key generated by the third device is the same as the fourth shared key generated by the second device, so that handshake authentication between the third device and the second device can be implemented.
本发明实施例提供的配置的方法,当第一设备已配置第二设备时,首先配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第一签名验证密钥及第一网络密钥由第一设备生成并发送给配置设备,然后第二设备向第三设备发送携带有第一连接信息的第一消息,第一连接信息包括第一签名信息及对端网络密钥,最后第三设备根据第一网络密钥,确定对端网络密钥是否合法,若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过第一设备根据第二设备带外密钥对第二设备进行配置,该第二设备带外密钥由配置设备与第二设备之间进行带外通信获得,并且配置设备向第三设备发送第一签名验证密钥及第一网络密 钥,第二设备向第三设备发送第一连接信息,能够实现第三设备根据第一网络密钥,确定第一连接信息中的对端网络密钥是否合法,并根据第一签名验证密钥,确定第一连接信息中的第一签名信息是否合法,从而可以将第一设备已配置的第二设备,配置给第三设备,即实现第三设备配置第二设备,进而可以提高设备进行配置的成功率。In the configuration method provided by the embodiment of the present invention, when the first device has configured the second device, the configuration device first sends the first signature verification key and the first network key, the first signature verification key and the second device to the third device. A network key is generated by the first device and sent to the configuration device, and then the second device sends the first message carrying the first connection information to the third device, and the first connection information includes the first signature information and the peer network key , and finally the third device determines whether the peer network key is legal according to the first network key, and if the peer network key is legal, the third device determines whether the second device is legal according to the first signature information. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention uses the first device to configure the second device according to the out-of-band key of the second device, and the out-of-band key of the second device Obtained by out-of-band communication between the configuration device and the second device, and the configuration device sends the first signature verification key and the first network key to the third device key, the second device sends the first connection information to the third device, so that the third device can determine whether the peer network key in the first connection information is legal according to the first network key, and verify the key according to the first signature , to determine whether the first signature information in the first connection information is legal, so that the second device that has been configured by the first device can be configured to the third device, that is, the third device can configure the second device, and the configuration of the device can be improved. success rate.
进一步地,作为对图2及图3所示方法的实现,本发明实施例还提供了一种配置的装置,该装置可以位于第一设备,第一设备位于配置系统,配置系统包括第一设备、第二设备及配置设备,配置设备与第一设备之间进行带内通信,配置设备与第二设备之间进行带外通信,该装置可以用于对第二设备进行配置,如图7所示,所述装置包括:接收单元71、生成单元72、发送单元73、签名单元74。Further, as an implementation of the methods shown in FIG. 2 and FIG. 3 , an embodiment of the present invention also provides a configuration device, the device can be located in the first device, the first device is located in the configuration system, and the configuration system includes the first device , the second device and the configuration device, in-band communication between the configuration device and the first device, out-of-band communication between the configuration device and the second device, the device can be used to configure the second device, as shown in Figure 7 As shown, the device includes: a receiving unit 71 , a generating unit 72 , a sending unit 73 , and a signature unit 74 .
接收单元71,用于接收配置设备发送的第二设备带外密钥。The receiving unit 71 is configured to receive the out-of-band key of the second device sent by the configuration device.
其中,第二设备带外密钥由配置设备通过与第二设备之间进行带外通信获得。Wherein, the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device.
生成单元72,用于根据接收单元71接收的第二设备带外密钥,生成加密密钥。The generating unit 72 is configured to generate an encryption key according to the out-of-band key of the second device received by the receiving unit 71 .
其中,加密密钥用于对第一设备向第二设备发送的信息进行加密。Wherein, the encryption key is used to encrypt the information sent by the first device to the second device.
生成单元72,还用于生成第一签名生成密钥及第一签名验证密钥。The generation unit 72 is further configured to generate a first signature generation key and a first signature verification key.
其中,第一签名生成密钥及第一签名验证密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名验证密钥用于对第一设备签名的信息进行解密,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key and the first signature verification key are generated by the first device, the first signature generation key is used for the first device to sign, and the first signature verification key is used for signing information of the first device For decryption, the first signature generation key and the first signature verification key correspond to each other.
接收单元71,还用于接收第二设备发送的第二网络密钥。The receiving unit 71 is further configured to receive the second network key sent by the second device.
其中,第二网络密钥由第二设备生成,第二网络密钥用于第一设备生成共享密钥。Wherein, the second network key is generated by the second device, and the second network key is used by the first device to generate a shared key.
签名单元74,用于利用第一签名生成密钥对接收单元71接收的第二网络密钥进行签名,得到第一签名信息。 The signature unit 74 is configured to use the first signature generation key to sign the second network key received by the receiving unit 71 to obtain first signature information.
其中,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, and the first signature generation key and the first signature verification key correspond to each other.
发送单元73,用于向第二设备发送加密后的第一连接信息。A sending unit 73, configured to send the encrypted first connection information to the second device.
其中,第一连接信息包括签名单元74签名得到的第一签名信息及第二网络密钥,加密后的第一连接信息由第一设备利用第一密钥对第一连接信息进行加密得到,第一密钥由第一设备根据生成单元72生成的加密密钥得到,以使得第二设备获取并向第一设备发送第一连接信息,第一连接信息用于第一设备确定第二设备是否合法。Wherein, the first connection information includes the first signature information signed by the signature unit 74 and the second network key, the encrypted first connection information is obtained by the first device using the first key to encrypt the first connection information, and the second A key is obtained by the first device according to the encryption key generated by the generating unit 72, so that the second device obtains and sends the first connection information to the first device, and the first connection information is used by the first device to determine whether the second device is legitimate .
进一步地,以使得第二设备获取第一连接信息。Further, so that the second device acquires the first connection information.
接收单元71,还用于在接收单元71接收第二设备带外密钥之前,接收配置设备发送的第二签名验证密钥。The receiving unit 71 is further configured to receive the second signature verification key sent by the configuration device before the receiving unit 71 receives the out-of-band key of the second device.
其中,第二签名验证密钥由配置设备生成,第二签名验证密钥用于对配置设备签名的信息进行解密。Wherein, the second signature verification key is generated by the configuration device, and the second signature verification key is used to decrypt the information signed by the configuration device.
生成单元72,还用于生成第一网络密钥。The generating unit 72 is also configured to generate a first network key.
其中,第一网络密钥用于第二设备生成共享密钥。Wherein, the first network key is used by the second device to generate a shared key.
发送单元73,还用于将生成单元72生成的第一网络密钥发送给配置设备。The sending unit 73 is further configured to send the first network key generated by the generating unit 72 to the configuration device.
进一步地,以使得配置设备至少根据第一网络密钥,生成并向第一设备发送第二连接信息。Further, the configuration device generates and sends the second connection information to the first device at least according to the first network key.
接收单元71,还用于在发送单元73发送第一网络密钥后,接收配置设备发送的第二连接信息。The receiving unit 71 is further configured to receive the second connection information sent by the configuration device after the sending unit 73 sends the first network key.
其中,第二连接信息包括第二签名信息及第一网络密钥,第二签名信息由配置设备利用第二签名生成密钥对第一网络密钥进行签名得到,第二签名生成密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名生成密钥与第二签名验证密钥之间互相对应。Wherein, the second connection information includes the second signature information and the first network key, the second signature information is obtained by the configuration device signing the first network key with the second signature generation key, and the second signature generation key is obtained by the configuration Generated by the device, the second signature generation key is used to configure the device for signing, and the second signature generation key corresponds to the second signature verification key.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对 应的公钥。或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are asymmetric keys, the second signature generation key is the corresponding private key, and the second signature verification key is the pair corresponding public key. Or, when the second signature generation key and the second signature verification key are symmetric keys, the second signature generation key is the same as the second signature verification key.
发送单元73,还用于发送第二消息。The sending unit 73 is also configured to send the second message.
其中,第二消息携带有第二连接信息,第二连接信息包括第二签名信息。Wherein, the second message carries second connection information, and the second connection information includes second signature information.
进一步地,以使得第二设备接收第一设备发送的第二消息,并根据第二消息携带的第二签名信息,确定第一设备是否合法,并至少根据第二签名信息中的第一网络密钥生成第二共享密钥,第二共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认征。Further, the second device receives the second message sent by the first device, and determines whether the first device is legal according to the second signature information carried in the second message, and at least according to the first network password in the second signature information key to generate a second shared key, the second shared key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
生成单元72,还用于生成第三网络密钥。The generating unit 72 is further configured to generate a third network key.
其中,第三网络密钥用于第二设备生成共享密钥。Wherein, the third network key is used by the second device to generate a shared key.
发送单元73,还用于将第三网络密钥发送给配置设备。The sending unit 73 is further configured to send the third network key to the configuration device.
接收单元71,还用于接收配置设备发送的第三连接信息。The receiving unit 71 is further configured to receive third connection information sent by the configuration device.
其中,第三连接信息包括第三签名信息及第三网络密钥,第三签名信息由配置设备利用第二签名生成密钥对第三网络密钥进行签名得到。Wherein, the third connection information includes third signature information and a third network key, and the third signature information is obtained by the configuration device signing the third network key by using the second signature generation key.
发送单元73,还用于向第二设备发送加密后的第三消息。The sending unit 73 is further configured to send the encrypted third message to the second device.
其中,加密后的第二签名验证密钥由第一设备根据加密密钥得到,第三消息携带有第三连接信息。Wherein, the encrypted second signature verification key is obtained by the first device according to the encryption key, and the third message carries the third connection information.
进一步地,以使得第二设备获取第三网络密钥,并至少根据第三网络密钥生成新的第二共享密钥,新的第二共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Further, so that the second device obtains the third network key, and at least generates a new second shared key according to the third network key, and the new second shared key is a communication between the first device and the second device. A pre-key, the pre-key is used for handshake authentication between the first device and the second device.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
发送单元73,还用于向第二设备发送加密后的第二签名验证密钥。 The sending unit 73 is further configured to send the encrypted second signature verification key to the second device.
其中,加密后的第二签名验证密钥由第一设备利用第二密钥对第二签名验证密钥进行加密得到,第二密钥由第一设备根据加密密钥得到。Wherein, the encrypted second signature verification key is obtained by the first device by using the second key to encrypt the second signature verification key, and the second key is obtained by the first device according to the encryption key.
进一步地,以使得第二设备接收第二签名验证密钥,并根据第二签名验证密钥,以及第二消息携带的第二签名信息,确定第一设备合法。Further, the second device receives the second signature verification key, and determines that the first device is legal according to the second signature verification key and the second signature information carried in the second message.
接收单元71,还用于接收第二设备发送的第一消息。The receiving unit 71 is further configured to receive the first message sent by the second device.
进一步地,如图8所示,所述装置还可以包括:确定单元81。Further, as shown in FIG. 8 , the device may further include: a determining unit 81 .
其中,第一消息携带有第一连接信息。Wherein, the first message carries the first connection information.
确定单元81,用于根据第一消息携带的第一签名信息,确定第二设备合法。The determining unit 81 is configured to determine that the second device is legal according to the first signature information carried in the first message.
确定单元81,具体用于根据第一消息携带的第一签名信息,确定签名得到第一签名信息的设备是否为可信设备。The determining unit 81 is specifically configured to determine, according to the first signature information carried in the first message, whether the device that obtained the first signature information by signing is a trusted device.
其中,可信设备为第一设备或者配置设备。Wherein, the trusted device is the first device or the configuration device.
可选地,所述装置还包括:解密单元82、比对单元83。Optionally, the device further includes: a decryption unit 82 and a comparison unit 83 .
解密单元82,用于利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果。The decryption unit 82 is configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result.
比对单元83,用于将解密单元82解密得到的解密结果,与第一连接信息包括的第二网络密钥进行比对。The comparison unit 83 is configured to compare the decryption result obtained by the decryption unit 82 with the second network key included in the first connection information.
确定单元81,具体用于当比对单元83比对解密结果与第二网络密钥匹配时,确定第二设备合法。The determining unit 81 is specifically configured to determine that the second device is legal when the comparing unit 83 compares the decryption result with the second network key.
生成单元72,还用于当确定单元81确定第二设备合法时,至少根据第二网络密钥,生成第一共享密钥。The generating unit 72 is further configured to generate the first shared key at least according to the second network key when the determining unit 81 determines that the second device is legitimate.
其中,第一共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Wherein, the first shared key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
生成单元72,具体用于按照迪菲赫尔曼DH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第一共享密钥。The generation unit 72 is specifically configured to generate a DH shared key according to the Diffie-Hellman DH key generation algorithm, according to the private key corresponding to the first network key, and the second network key, and use the DH shared key, Or a key derived from the DH shared key is used as the first shared key.
生成单元72,具体还用于按照基于椭圆曲线密码体制的的迪菲赫尔曼 ECDH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第一共享密钥。The generation unit 72 is specifically also used for Diffie-Hellman based on the elliptic curve cryptosystem The ECDH key generation algorithm generates an ECDH shared key according to the private key corresponding to the first network key and the second network key, and uses the ECDH shared key, or a key derived from the ECDH shared key, as The first shared secret.
确定单元81,还用于确定第二设备是否存储有第二设备带外密钥对应的私钥。The determining unit 81 is further configured to determine whether the second device stores a private key corresponding to the second device's out-of-band key.
其中,第二设备带外密钥对应的私钥与第二设备带外密钥之间互相对应。Wherein, the private key corresponding to the out-of-band key of the second device corresponds to the out-of-band key of the second device.
对于本发明实施例,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为非对称密钥时,第二设备带外密钥对应的私钥为私钥,第二设备带外密钥为公钥。或者,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为对称密钥时,第二设备带外密钥对应的私钥与第二设备带外密钥相同。For the embodiment of the present invention, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are asymmetric keys, the private key corresponding to the out-of-band key of the second device is a private key, The second device out-of-band key is a public key. Or, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are symmetric keys, the private key corresponding to the out-of-band key of the second device is the same as the out-of-band key of the second device .
确定单元81,还用于当第二设备存储有第二设备带外密钥对应的私钥时,确定第二设备合法。The determining unit 81 is further configured to determine that the second device is legal when the second device stores a private key corresponding to the second device's out-of-band key.
本发明实施例提供的配置的装置,首先配置设备与第二设备进行带外通信,获得第二设备带外密钥,并将第二设备带外密钥发送给第一设备,然后第一设备生成第一签名生成密钥及第一签名验证密钥,并接收第二设备发送的第二设备生成的第二网络密钥,最后第一设备根据第一设备生成的第一签名生成密钥,对第二网络密钥进行签名,得到第一签名信息,并向第二设备发送包括第一签名信息及第二网络密钥的第一连接信息。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过配置设备与第二设备之间进行带外通信,获得第二设备带外密钥,并将该第二设备带外密钥发送给第一设备,能够使得第一设备与第二设备之间进行通信,从而可以实现第一设备对第二设备进行配置,即当配置设备与第二设备之间不能进行带内通信时,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,可以由第一设备对第二设备进行配置,进而可以提高设备进行配置的成功率。 The configuration device provided by the embodiment of the present invention first configures the device to perform out-of-band communication with the second device, obtains the out-of-band key of the second device, and sends the out-of-band key of the second device to the first device, and then the first device generating a first signature generation key and a first signature verification key, and receiving a second network key generated by the second device sent by the second device, and finally the first device generates a key according to the first signature generated by the first device, Sign the second network key to obtain first signature information, and send first connection information including the first signature information and the second network key to the second device. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention obtains the out-of-band key of the second device through out-of-band communication between the configuration device and the second device, and transfers the second device The two-device out-of-band key is sent to the first device, enabling communication between the first device and the second device, so that the first device can configure the second device, that is, when the configuration device and the second device cannot When performing in-band communication, for example, if a certain device does not support in-band communication, or the configured device does not match the in-band communication mode supported by a certain device, the first device can configure the second device to improve the performance of the device. configuration success rate.
需要说明的是,本发明实施例中提供的配置的装置中各单元所对应的其他相应描述,可以参考图2及图3中的对应描述,在此不再赘述。It should be noted that for other corresponding descriptions corresponding to each unit in the configured device provided in the embodiment of the present invention, reference may be made to the corresponding descriptions in FIG. 2 and FIG. 3 , and details are not repeated here.
再进一步地,本发明实施例还提供了一种设备,所述设备为第一设备,所述第一设备位于配置系统,配置系统包括第一设备、第二设备及配置设备,配置设备与第一设备之间进行带内通信,配置设备与第二设备之间进行带外通信,如图9所示,所述第一设备包括:接收器91、处理器92、发送器93。Furthermore, the embodiment of the present invention also provides a device, the device is the first device, the first device is located in the configuration system, the configuration system includes the first device, the second device and the configuration device, the configuration device and the first device In-band communication is performed between one device, and out-of-band communication is performed between the configuration device and a second device. As shown in FIG. 9 , the first device includes: a receiver 91 , a processor 92 , and a transmitter 93 .
接收器91,用于接收配置设备发送的第二设备带外密钥。The receiver 91 is configured to receive the out-of-band key of the second device sent by the configuration device.
其中,第二设备带外密钥由配置设备通过与第二设备之间进行带外通信获得。Wherein, the out-of-band key of the second device is obtained by the configuration device through out-of-band communication with the second device.
处理器92,用于根据接收器91接收的第二设备带外密钥,生成加密密钥。The processor 92 is configured to generate an encryption key according to the out-of-band key of the second device received by the receiver 91.
其中,加密密钥用于对第一设备向第二设备发送的信息进行加密。Wherein, the encryption key is used to encrypt the information sent by the first device to the second device.
处理器92,还用于生成第一签名生成密钥及第一签名验证密钥.The processor 92 is also configured to generate a first signature generation key and a first signature verification key.
其中,第一签名生成密钥及第一签名验证密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名验证密钥用于对第一设备签名的信息进行解密,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key and the first signature verification key are generated by the first device, the first signature generation key is used for the first device to sign, and the first signature verification key is used for signing information of the first device For decryption, the first signature generation key and the first signature verification key correspond to each other.
接收器91,还用于接收第二设备发送的第二网络密钥。The receiver 91 is further configured to receive the second network key sent by the second device.
其中,第二网络密钥由第二设备生成,第二网络密钥用于第一设备生成共享密钥。Wherein, the second network key is generated by the second device, and the second network key is used by the first device to generate a shared key.
处理器92,还用于利用第一签名生成密钥对接收器91接收的第二网络密钥进行签名,得到第一签名信息。The processor 92 is further configured to use the first signature generation key to sign the second network key received by the receiver 91 to obtain first signature information.
其中,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应。Wherein, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, and the first signature generation key and the first signature verification key correspond to each other.
发送器93,用于向第二设备发送加密后的第一连接信息。The sender 93 is configured to send the encrypted first connection information to the second device.
其中,第一连接信息包括处理器92签名得到的第一签名信息及第二网 络密钥,加密后的第一连接信息由第一设备利用第一密钥对第一连接信息进行加密得到,第一密钥由第一设备根据处理器92生成的加密密钥得到。Wherein, the first connection information includes the first signature information signed by the processor 92 and the second network The encrypted first connection information is obtained by the first device by encrypting the first connection information with the first key, and the first key is obtained by the first device according to the encryption key generated by the processor 92 .
进一步地,以使得第二设备获取并向第一设备发送第一连接信息,第一连接信息用于第一设备确定第二设备是否合法。Further, so that the second device obtains and sends the first connection information to the first device, the first connection information is used by the first device to determine whether the second device is legitimate.
接收器91,还用于在接收器91接收第二设备带外密钥之前,接收配置设备发送的第二签名验证密钥。The receiver 91 is further configured to receive the second signature verification key sent by the configuration device before the receiver 91 receives the out-of-band key of the second device.
其中,第二签名验证密钥由配置设备生成,第二签名验证密钥用于对配置设备签名的信息进行解密。Wherein, the second signature verification key is generated by the configuration device, and the second signature verification key is used to decrypt the information signed by the configuration device.
处理器92,还用于生成第一网络密钥。The processor 92 is further configured to generate a first network key.
其中,第一网络密钥用于第二设备生成共享密钥。Wherein, the first network key is used by the second device to generate a shared key.
需要说明的是,第一设备中的处理器92可以为一个或多个,本发明实施例以一个为例进行说明,其他实施例可以参考此处进行理解。It should be noted that there may be one or more processors 92 in the first device, and this embodiment of the present invention uses one as an example for description, and other embodiments may be understood with reference to this.
发送器93,还用于将处理器92生成的第一网络密钥发送给配置设备。The sender 93 is further configured to send the first network key generated by the processor 92 to the configuration device.
进一步地,以使得配置设备至少根据第一网络密钥,生成并向第一设备发送第二连接信息。Further, the configuration device generates and sends the second connection information to the first device at least according to the first network key.
接收器91,还用于在发送器93发送第一网络密钥后,接收配置设备发送的第二连接信息。The receiver 91 is further configured to receive the second connection information sent by the configuration device after the sender 93 sends the first network key.
其中,第二连接信息包括第二签名信息及第一网络密钥,第二签名信息由配置设备利用第二签名生成密钥对第一网络密钥进行签名得到,第二签名生成密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名生成密钥与第二签名验证密钥之间互相对应。Wherein, the second connection information includes the second signature information and the first network key, the second signature information is obtained by the configuration device signing the first network key with the second signature generation key, and the second signature generation key is obtained by the configuration Generated by the device, the second signature generation key is used to configure the device for signing, and the second signature generation key corresponds to the second signature verification key.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对应的公钥;或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are asymmetric keys, the second signature generation key is the corresponding private key, and the second signature verification key is the corresponding public key; or, when the second signature generation key and the second signature verification key are symmetric keys, the second signature generation key is the same as the second signature verification key.
发送器93,还用于发送第二消息。The sender 93 is also used to send the second message.
其中,第二消息携带有第二连接信息,第二连接信息包括第二签名信 息。Wherein, the second message carries the second connection information, and the second connection information includes the second signature information interest.
进一步地,以使得第二设备接收第一设备发送的第二消息,根据第二消息携带的第二签名信息,确定第一设备是否合法,并至少根据第二签名信息中的第一网络密钥生成第二共享密钥,第二共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认征。Further, so that the second device receives the second message sent by the first device, determines whether the first device is legitimate according to the second signature information carried in the second message, and at least according to the first network key in the second signature information A second shared key is generated, where the second shared key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
处理器92,还用于生成第三网络密钥。The processor 92 is further configured to generate a third network key.
其中,第三网络密钥用于第二设备生成共享密钥。Wherein, the third network key is used by the second device to generate a shared key.
发送器93,还用于将第三网络密钥发送给配置设备。The sender 93 is further configured to send the third network key to the configuration device.
接收器91,还用于接收配置设备发送的第三连接信息。The receiver 91 is further configured to receive third connection information sent by the configuration device.
其中,第三连接信息包括第三签名信息及第三网络密钥,第三签名信息由配置设备利用第二签名生成密钥对第三网络密钥进行签名得到。Wherein, the third connection information includes third signature information and a third network key, and the third signature information is obtained by the configuration device signing the third network key by using the second signature generation key.
发送器93,还用于向第二设备发送第三消息。The sender 93 is further configured to send the third message to the second device.
其中,第三消息携带有第三连接信息。Wherein, the third message carries the third connection information.
进一步地,以使得第二设备获取第三网络密钥,并至少根据第三网络密钥生成新的第二共享密钥,新的第二共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Further, so that the second device obtains the third network key, and at least generates a new second shared key according to the third network key, and the new second shared key is a communication between the first device and the second device. A pre-key, the pre-key is used for handshake authentication between the first device and the second device.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
发送器93,还用于向第二设备发送加密后的第二签名验证密钥。The sender 93 is further configured to send the encrypted second signature verification key to the second device.
其中,加密后的第二签名验证密钥由第一设备利用第二密钥对第二签名验证密钥进行加密得到,第二密钥由第一设备根据加密密钥得到。Wherein, the encrypted second signature verification key is obtained by the first device by using the second key to encrypt the second signature verification key, and the second key is obtained by the first device according to the encryption key.
进一步地,以使得第二设备接收第二签名验证密钥,并根据第二签名验证密钥,以及第二消息携带的第二签名信息,确定第一设备合法。Further, the second device receives the second signature verification key, and determines that the first device is legal according to the second signature verification key and the second signature information carried in the second message.
接收器91,还用于接收第二设备发送的第一消息。 The receiver 91 is further configured to receive the first message sent by the second device.
其中,第一消息携带有第一连接信息。Wherein, the first message carries the first connection information.
处理器92,还用于根据第一消息携带的第一签名信息,确定第二设备合法。The processor 92 is further configured to determine that the second device is legal according to the first signature information carried in the first message.
处理器92,具体用于根据第一消息携带的第一签名信息,确定签名得到第一签名信息的设备是否为可信设备。The processor 92 is specifically configured to determine, according to the first signature information carried in the first message, whether the device that signed the first signature information is a trusted device.
其中,可信设备为第一设备或者配置设备。Wherein, the trusted device is the first device or the configuration device.
处理器92,还用于利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果。The processor 92 is further configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result.
处理器92,还用于将解密结果,与第一连接信息包括的第二网络密钥进行比对。The processor 92 is further configured to compare the decryption result with the second network key included in the first connection information.
处理器92,具体用于当解密结果与第二网络密钥匹配时,确定第二设备合法。The processor 92 is specifically configured to determine that the second device is legal when the decryption result matches the second network key.
处理器92,还用于当确定第二设备合法时,利用根据第二网络密钥,生成第一共享密钥。The processor 92 is further configured to generate the first shared key according to the second network key when it is determined that the second device is legitimate.
其中,第一共享密钥为第一设备与第二设备之间的预先密钥,预先密钥用于第一设备与第二设备之间进行握手认证。Wherein, the first shared key is a pre-key between the first device and the second device, and the pre-key is used for handshake authentication between the first device and the second device.
处理器92,还用于按照迪菲赫尔曼DH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第一共享密钥。The processor 92 is further configured to generate a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the first network key and the second network key, and to generate the DH shared key, Or a key derived from the DH shared key is used as the first shared key.
处理器92,还用于按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据第一网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第一共享密钥。The processor 92 is further configured to generate an ECDH shared key according to the private key corresponding to the first network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, The ECDH shared key, or a key derived from the ECDH shared key is used as the first shared key.
处理器92,具体用于确定第二设备是否存储有第二设备带外密钥对应的私钥。The processor 92 is specifically configured to determine whether the second device stores a private key corresponding to the out-of-band key of the second device.
其中,第二设备带外密钥对应的私钥与第二设备带外密钥之间互相对应。 Wherein, the private key corresponding to the out-of-band key of the second device corresponds to the out-of-band key of the second device.
对于本发明实施例,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为非对称密钥时,第二设备带外密钥对应的私钥为私钥,第二设备带外密钥为公钥;或者,当第二设备带外密钥对应的私钥与第二设备带外密钥之间为对称密钥时,第二设备带外密钥对应的私钥与第二设备带外密钥相同。For the embodiment of the present invention, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are asymmetric keys, the private key corresponding to the out-of-band key of the second device is a private key, The out-of-band key of the second device is a public key; or, when the private key corresponding to the out-of-band key of the second device and the out-of-band key of the second device are symmetric keys, the corresponding The private key is the same as the second device out-of-band key.
处理器92,具体还用于当第二设备存储有第二设备带外密钥对应的私钥时,确定第二设备合法。The processor 92 is specifically further configured to determine that the second device is legal when the second device stores the private key corresponding to the second device's out-of-band key.
本发明实施例提供的设备,具体为第一设备,首先配置设备与第二设备进行带外通信,获得第二设备带外密钥,并将第二设备带外密钥发送给第一设备,以使得第一设备根据第二设备带外密钥生成加密密钥,然后第一设备生成第一签名生成密钥及第一签名验证密钥,并接收第二设备发送的第二网络密钥,最后第一设备根据第一签名生成密钥,对第二网络密钥进行签名,得到第一签名信息,并向第二设备发送根据加密密钥加密后的第一连接信息,第一连接信息包括第一签名信息及第二网络密钥。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过配置设备与第二设备之间进行带外通信,获得第二设备带外密钥,并将该第二设备带外密钥发送给第一设备,能够使得第一设备与第二设备之间进行通信,从而可以实现第一设备对第二设备进行配置,即当配置设备与第二设备之间不能进行带内通信时,例如,某一设备不支持带内通信,或者配置设备与某一设备支持的带内通信模式不匹配,可以由第一设备对第二设备进行配置,进而可以提高设备进行配置的成功率。The device provided by the embodiment of the present invention, specifically the first device, first configures the device to perform out-of-band communication with the second device, obtains the out-of-band key of the second device, and sends the out-of-band key of the second device to the first device, so that the first device generates an encryption key according to the out-of-band key of the second device, and then the first device generates a first signature generation key and a first signature verification key, and receives the second network key sent by the second device, Finally, the first device generates a key according to the first signature, signs the second network key, obtains the first signature information, and sends the first connection information encrypted according to the encryption key to the second device. The first connection information includes The first signature information and the second network key. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention obtains the out-of-band key of the second device through out-of-band communication between the configuration device and the second device, and transfers the second device The two-device out-of-band key is sent to the first device, enabling communication between the first device and the second device, so that the first device can configure the second device, that is, when the configuration device and the second device cannot When performing in-band communication, for example, if a certain device does not support in-band communication, or the configured device does not match the in-band communication mode supported by a certain device, the first device can configure the second device to improve the performance of the device. configuration success rate.
需要说明的是,本发明实施例中提供的第一设备中各器件所对应的其他相应描述,可以参考图2或图3中的对应描述,在此不再赘述。It should be noted that for other corresponding descriptions corresponding to the components in the first device provided in the embodiment of the present invention, reference may be made to the corresponding descriptions in FIG. 2 or FIG. 3 , and details are not repeated here.
进一步地,作为对图5及图6所示方法的实现,本发明实施例还提供了一种配置的装置,该装置可以位于第三设备,第三设备位于配置系统,配置系统包括第一设备、第二设备、配置设备及第三设备,配置设备与第一设备之间进行带内通信,配置设备与第二设备之间进行带外通信,配置 设备与第三设备之间进行带内通信,第一设备已配置第二设备,该装置可以用于对第二设备进行配置,如图10所示,所述装置包括:接收单元101、确定单元102。Furthermore, as an implementation of the methods shown in Figures 5 and 6, an embodiment of the present invention also provides a configuration device, which can be located in the third device, the third device is located in the configuration system, and the configuration system includes the first device , the second device, the configuration device and the third device, in-band communication between the configuration device and the first device, out-of-band communication between the configuration device and the second device, configuration In-band communication is performed between the device and the third device, the first device has configured the second device, and the device can be used to configure the second device, as shown in Figure 10, the device includes: a receiving unit 101, a determining unit 102.
接收单元101,用于接收配置设备发送的第一签名验证密钥及第一网络密钥。The receiving unit 101 is configured to receive the first signature verification key and the first network key sent by the configuration device.
其中,第一签名验证密钥由第一设备生成并发送给配置设备,第一签名验证密钥用于对第一设备签名的信息进行解密,第一网络密钥由第一设备生成并发送给配置设备,第一网络密钥用于第二设备生成共享密钥。Wherein, the first signature verification key is generated by the first device and sent to the configuration device, the first signature verification key is used to decrypt the information signed by the first device, and the first network key is generated by the first device and sent to the The device is configured, and the first network key is used by the second device to generate a shared key.
接收单元101,还用于接收第二设备发送的第一消息,第一消息携带有第一连接信息,第一连接信息包括第一签名信息及对端网络密钥,第一签名信息由第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应,第二网络密钥由第二设备生成,第二网络密钥用于第一设备或第三设备生成共享密钥。The receiving unit 101 is further configured to receive a first message sent by the second device, the first message carries first connection information, the first connection information includes first signature information and a peer network key, and the first signature information is generated by the first The device uses the first signature generation key to sign the second network key, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, and the first signature generation key Corresponding to the first signature verification key, the second network key is generated by the second device, and the second network key is used by the first device or the third device to generate a shared key.
确定单元102,用于根据接收单元101接收的第一网络密钥,确定对端网络密钥是否合法。The determining unit 102 is configured to determine whether the peer network key is valid according to the first network key received by the receiving unit 101 .
确定单元102,还用于当对端网络密钥合法时,根据接收单元101接收的第一签名信息,确定第二设备是否合法。The determining unit 102 is further configured to determine whether the second device is legal according to the first signature information received by the receiving unit 101 when the peer network key is legal.
确定单元102,具体用于确定对端网络密钥是否为信任的网络密钥。The determining unit 102 is specifically configured to determine whether the peer network key is a trusted network key.
其中,信任的网络密钥包括第一网络密钥。Wherein, the trusted network key includes the first network key.
接收单元101接收的第一连接信息还包括第二网络密钥。The first connection information received by the receiving unit 101 also includes a second network key.
进一步地,如图11所示,所述装置还包括:解密单元111、比对单元112。Further, as shown in FIG. 11 , the device further includes: a decryption unit 111 and a comparison unit 112 .
解密单元111,用于利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果。The decryption unit 111 is configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result.
比对单元112,用于将解密单元111解密得到的解密结果,与第二网络 密钥进行比对。The comparison unit 112 is used to decrypt the decryption result obtained by the decryption unit 111, and the second network Keys are compared.
确定单元102,具体用于当比对单元112比对解密结果与第二网络密钥匹配时,确定第二设备合法。The determining unit 102 is specifically configured to determine that the second device is legal when the comparing unit 112 compares the decryption result with the second network key.
可选地,所述装置还包括:生成单元113。Optionally, the device further includes: a generating unit 113 .
生成单元113,用于至少根据接收单元101接收的第二网络密钥,生成第三共享密钥。The generating unit 113 is configured to generate a third shared key at least according to the second network key received by the receiving unit 101 .
其中,第三共享密钥为第三设备与第二设备之间进行握手认证的预先密钥。Wherein, the third shared key is a pre-key for handshake authentication between the third device and the second device.
生成单元113,具体包括按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第三共享密钥,第四网络密钥用于第二设备生成共享密钥。或者,The generation unit 113 specifically includes generating a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and using the DH shared key, or The key derived from the DH shared key is used as the third shared key, and the fourth network key is used by the second device to generate the shared key. or,
生成单元113,具体包括按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第三共享密钥。The generation unit 113 specifically includes generating an ECDH shared key according to the private key corresponding to the fourth network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, and The ECDH shared key, or a key derived from the ECDH shared key is used as the third shared key.
生成单元113,还用于生成第四网络密钥。The generating unit 113 is further configured to generate a fourth network key.
其中,第四网络密钥用于第二设备生成共享密钥。Wherein, the fourth network key is used by the second device to generate a shared key.
可选地,所述装置还包括:发送单元114。Optionally, the device further includes: a sending unit 114 .
发送单元114,用于将生成单元113生成的第四网络密钥发送给配置设备。The sending unit 114 is configured to send the fourth network key generated by the generating unit 113 to the configuration device.
接收单元101,还用于接收配置设备发送的第四连接信息。The receiving unit 101 is further configured to receive fourth connection information sent by the configuration device.
其中,第四连接信息包括第四签名信息及第四网络密钥,第四签名信息由配置设备利用第二签名生成密钥对第四网络密钥进行签名得到,第二签名生成密钥及第二签名验证密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名验证密钥用于对配置设备签名的信息进行解密,第二签名生成密钥与第二签名验证密钥之间互相对应。 Wherein, the fourth connection information includes the fourth signature information and the fourth network key, the fourth signature information is obtained by the configuration device using the second signature generation key to sign the fourth network key, the second signature generation key and the The second signature verification key is generated by the configuration device. The second signature generation key is used to configure the device to sign. The second signature verification key is used to decrypt the information signed by the configuration device. The second signature generation key is the same as the second signature The verification keys correspond to each other.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对应的公钥;或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are asymmetric keys, the second signature generation key is the corresponding private key, and the second signature verification key is the corresponding public key; or, when the second signature generation key and the second signature verification key are symmetric keys, the second signature generation key is the same as the second signature verification key.
发送单元114,还用于向第二设备发送第四消息。The sending unit 114 is further configured to send a fourth message to the second device.
其中,第四消息携带有第四连接信息,第四连接信息包括第四签名信息。Wherein, the fourth message carries fourth connection information, and the fourth connection information includes fourth signature information.
进一步地,以使得第二设备接收第三设备发送的第四消息,并根据第四消息携带的第四签名信息,以及第二签名验证密钥,确定第三设备是否合法,第二签名验证密钥由第一设备配置第二设备时,发送给第二设备。Further, the second device receives the fourth message sent by the third device, and determines whether the third device is legal according to the fourth signature information carried in the fourth message and the second signature verification key, and the second signature verification key The key is sent to the second device when the first device configures the second device.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
本发明实施例提供的配置的装置,当第一设备已配置第二设备时,首先配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第一签名验证密钥及第一网络密钥由第一设备生成并发送给配置设备,然后第二设备向第三设备发送携带有第一连接信息的第一消息,第一连接信息包括第一签名信息及对端网络密钥,最后第三设备根据第一网络密钥,确定对端网络密钥是否合法,若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过第一设备根据第二设备带外密钥对第二设备进行配置,该第二设备带外密钥由配置设备与第二设备之间进行带外通信获得,并且配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第二设备向第三设备发送第一连接信息,能够实现第三设备根据第一网络密钥,确定第一连接信息中的对端网络密钥是否合法,并根据第一签名验证密钥,确定第一连接信息中的第一签名信息是否合法,从而可以将 第一设备已配置的第二设备,配置给第三设备,即实现第三设备配置第二设备,进而可以提高设备进行配置的成功率。In the configuration device provided by the embodiment of the present invention, when the first device has configured the second device, the configuration device first sends the first signature verification key and the first network key, the first signature verification key and the second device to the third device. A network key is generated by the first device and sent to the configuration device, and then the second device sends the first message carrying the first connection information to the third device, and the first connection information includes the first signature information and the peer network key , and finally the third device determines whether the peer network key is legal according to the first network key, and if the peer network key is legal, the third device determines whether the second device is legal according to the first signature information. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention uses the first device to configure the second device according to the out-of-band key of the second device, and the out-of-band key of the second device Obtained by out-of-band communication between the configuration device and the second device, and the configuration device sends the first signature verification key and the first network key to the third device, and the second device sends the first connection information to the third device, which can Realize that the third device determines whether the peer network key in the first connection information is legal according to the first network key, and determines whether the first signature information in the first connection information is legal according to the first signature verification key, thereby can The second device that has been configured by the first device is configured to the third device, that is, the third device configures the second device, thereby improving the success rate of device configuration.
需要说明的是,本发明实施例中提供的配置的装置中各单元所对应的其他相应描述,可以参考图5及图6中的对应描述,在此不再赘述。It should be noted that for other corresponding descriptions corresponding to each unit in the configured device provided in the embodiment of the present invention, reference may be made to the corresponding descriptions in FIG. 5 and FIG. 6 , and details are not repeated here.
再进一步地,本发明实施例还提供了一种设备,所述设备为第三设备,所述第三设备位于配置系统,配置系统包括第一设备、第二设备、配置设备及第三设备,配置设备与第一设备之间进行带内通信,配置设备与第二设备之间进行带外通信,配置设备与第三设备之间进行带内通信,第一设备已配置第二设备,如图12所示,所述第三设备包括:接收器121、处理器122、发送器123。Still further, an embodiment of the present invention also provides a device, the device is a third device, the third device is located in a configuration system, and the configuration system includes a first device, a second device, a configuration device, and a third device, In-band communication between the configuration device and the first device, out-of-band communication between the configuration device and the second device, in-band communication between the configuration device and the third device, the first device has configured the second device, as shown in the figure As shown in 12 , the third device includes: a receiver 121 , a processor 122 , and a transmitter 123 .
接收器121,用于接收配置设备发送的第一签名验证密钥及第一网络密钥。The receiver 121 is configured to receive the first signature verification key and the first network key sent by the configuration device.
其中,第一签名验证密钥由第一设备生成并发送给配置设备,第一签名验证密钥用于对第一设备签名的信息进行解密,第一网络密钥由第一设备生成并发送给配置设备,第一网络密钥用于第二设备生成共享密钥。Wherein, the first signature verification key is generated by the first device and sent to the configuration device, the first signature verification key is used to decrypt the information signed by the first device, and the first network key is generated by the first device and sent to the The device is configured, and the first network key is used by the second device to generate a shared key.
接收器121,还用于接收第二设备发送的第一消息。The receiver 121 is further configured to receive the first message sent by the second device.
其中,第一消息携带有第一连接信息,第一连接信息包括第一签名信息及对端网络密钥,第一签名信息由第一设备利用第一签名生成密钥对第二网络密钥进行签名得到,第一签名生成密钥由第一设备生成,第一签名生成密钥用于第一设备进行签名,第一签名生成密钥与第一签名验证密钥之间互相对应,第二网络密钥由第二设备生成,第二网络密钥用于第一设备或第三设备生成共享密钥。Wherein, the first message carries the first connection information, and the first connection information includes the first signature information and the peer network key, and the first signature information is generated by the first device using the first signature generation key to the second network key. The signature is obtained, the first signature generation key is generated by the first device, the first signature generation key is used for the first device to sign, the first signature generation key and the first signature verification key correspond to each other, the second network The key is generated by the second device, and the second network key is used by the first device or the third device to generate a shared key.
处理器122,用于根据接收器121接收的第一网络密钥,确定对端网络密钥是否合法。The processor 122 is configured to determine whether the opposite-end network key is valid according to the first network key received by the receiver 121 .
需要说明的是,第三设备中的处理器122可以为一个或多个,本发明实施例以一个为例进行说明,其他实施例可以参考此处进行理解。It should be noted that there may be one or more processors 122 in the third device, and this embodiment of the present invention uses one as an example for description, and other embodiments may be understood with reference to this.
处理器122,还用于当对端网络密钥合法时,根据接收器121接收的第 一签名信息,确定第二设备是否合法。The processor 122 is further configured to, when the peer network key is valid, according to the first received by the receiver 121 A signature message to determine whether the second device is legitimate.
处理器122,具体用于确定对端网络密钥是否为信任的网络密钥。The processor 122 is specifically configured to determine whether the peer network key is a trusted network key.
其中,信任的网络密钥包括第一网络密钥。Wherein, the trusted network key includes the first network key.
接收器121接收的第一连接信息还包括第二网络密钥。The first connection information received by the receiver 121 also includes the second network key.
处理器122,还用于利用第一签名验证密钥,对第一签名信息进行解密,得到解密结果。The processor 122 is further configured to use the first signature verification key to decrypt the first signature information to obtain a decryption result.
处理器122,还用于将解密得到的解密结果,与第二网络密钥进行比对。The processor 122 is further configured to compare the decryption result obtained by decryption with the second network key.
处理器122,具体用于解密结果与第二网络密钥匹配时,确定第二设备合法。The processor 122 is specifically configured to determine that the second device is legal when the decryption result matches the second network key.
处理器122,还用于至少根据接收器121接收的第二网络密钥,生成第三共享密钥。The processor 122 is further configured to generate a third shared key at least according to the second network key received by the receiver 121 .
其中,第三共享密钥为第三设备与第二设备之间进行握手认证的预先密钥。Wherein, the third shared key is a pre-key for handshake authentication between the third device and the second device.
处理器122,具体包括按照迪菲赫尔曼DH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成DH共享密钥,并将DH共享密钥,或者由DH共享密钥衍生得到的密钥,作为第三共享密钥,第四网络密钥用于所述第二设备生成共享密。或者,The processor 122 specifically includes generating a DH shared key according to the Diffie-Hellman DH key generation algorithm according to the private key corresponding to the fourth network key and the second network key, and using the DH shared key, or The key derived from the DH shared key is used as the third shared key, and the fourth network key is used by the second device to generate a shared secret. or,
处理器122,具体包括按照基于椭圆曲线密码体制的的迪菲赫尔曼ECDH密钥生成算法,根据第四网络密钥对应的私钥,以及第二网络密钥,生成ECDH共享密钥,并将ECDH共享密钥,或者由ECDH共享密钥衍生得到的密钥,作为第三共享密钥。The processor 122 specifically includes generating an ECDH shared key according to the private key corresponding to the fourth network key and the second network key according to the Diffie-Hellman ECDH key generation algorithm based on the elliptic curve cryptosystem, and The ECDH shared key, or a key derived from the ECDH shared key is used as the third shared key.
处理器122,还用于生成第四网络密钥,第四网络密钥用于第二设备生成共享密钥。The processor 122 is further configured to generate a fourth network key, where the fourth network key is used by the second device to generate a shared key.
发送器123,用于将处理器122生成的第四网络密钥发送给配置设备。The sender 123 is configured to send the fourth network key generated by the processor 122 to the configuration device.
接收器121,还用于接收配置设备发送的第四连接信息。The receiver 121 is further configured to receive fourth connection information sent by the configuration device.
其中,第四连接信息包括第四签名信息及第四网络密钥,第四签名信 息由配置设备利用第二签名生成密钥对第四网络密钥进行签名得到,第二签名生成密钥及第二签名验证密钥由配置设备生成,第二签名生成密钥用于配置设备进行签名,第二签名验证密钥用于对配置设备签名的信息进行解密,第二签名生成密钥与第二签名验证密钥之间互相对应。Wherein, the fourth connection information includes the fourth signature information and the fourth network key, and the fourth signature information The information is obtained by the configuration device using the second signature generation key to sign the fourth network key, the second signature generation key and the second signature verification key are generated by the configuration device, and the second signature generation key is used by the configuration device to perform For signing, the second signature verification key is used to decrypt the information signed by the configuration device, and the second signature generation key corresponds to the second signature verification key.
对于本发明实施例,当第二签名生成密钥与第二签名验证密钥之间为非对称密钥时,第二签名生成密钥为对应的私钥,第二签名验证密钥为对应的公钥;或者,当第二签名生成密钥与第二签名验证密钥之间为对称密钥时,第二签名生成密钥与第二签名验证密钥相同。For the embodiment of the present invention, when the second signature generation key and the second signature verification key are asymmetric keys, the second signature generation key is the corresponding private key, and the second signature verification key is the corresponding public key; or, when the second signature generation key and the second signature verification key are symmetric keys, the second signature generation key is the same as the second signature verification key.
发送器123,还用于向第二设备发送第四消息。The sender 123 is further configured to send a fourth message to the second device.
其中,第四消息携带有第四连接信息,第四连接信息包括第四签名信息。Wherein, the fourth message carries fourth connection information, and the fourth connection information includes fourth signature information.
进一步地,以使得第二设备接收第三设备发送的第四消息,并根据第四消息携带的第四签名信息,以及第二签名验证密钥,确定第三设备是否合法,第二签名验证密钥由第一设备配置第二设备时,发送给第二设备。Further, the second device receives the fourth message sent by the third device, and determines whether the third device is legal according to the fourth signature information carried in the fourth message and the second signature verification key, and the second signature verification key The key is sent to the second device when the first device configures the second device.
对于本发明实施例,当第一签名生成密钥与第一签名验证密钥之间为非对称密钥时,第一签名生成密钥为对应的私钥,第一签名验证密钥为对应的公钥;或者,当第一签名生成密钥与第一签名验证密钥之间为对称密钥时,第一签名生成密钥与第一签名验证密钥相同。For the embodiment of the present invention, when the first signature generation key and the first signature verification key are asymmetric keys, the first signature generation key is the corresponding private key, and the first signature verification key is the corresponding public key; or, when the first signature generation key and the first signature verification key are symmetric keys, the first signature generation key and the first signature verification key are the same.
本发明实施例提供的设备,具体为第三设备,当第一设备已配置第二设备时,首先配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第一签名验证密钥及第一网络密钥由第一设备生成并发送给配置设备,然后第二设备向第三设备发送携带有第一连接信息的第一消息,第一连接信息包括第一签名信息及对端网络密钥,最后第三设备根据第一网络密钥,确定对端网络密钥是否合法,若对端网络密钥合法,则第三设备根据第一签名信息,确定第二设备是否合法。与目前通过配置设备分别对第一设备及第二设备进行配置相比,本发明实施例通过第一设备根据第二设备带外密钥对第二设备进行配置,该第二设备带外密钥由配置设备与第二 设备之间进行带外通信获得,并且配置设备向第三设备发送第一签名验证密钥及第一网络密钥,第二设备向第三设备发送第一连接信息,能够实现第三设备根据第一网络密钥,确定第一连接信息中的对端网络密钥是否合法,并根据第一签名验证密钥,确定第一连接信息中的第一签名信息是否合法,从而可以将第一设备已配置的第二设备,配置给第三设备,即实现第三设备配置第二设备,进而可以提高设备进行配置的成功率。The device provided by the embodiment of the present invention is specifically the third device. When the first device has configured the second device, the configuration device first sends the first signature verification key and the first network key to the third device, and the first signature verification The key and the first network key are generated by the first device and sent to the configuration device, and then the second device sends a first message carrying the first connection information to the third device, and the first connection information includes the first signature information and the Finally, the third device determines whether the peer network key is legal according to the first network key. If the peer network key is legal, the third device determines whether the second device is legal according to the first signature information. Compared with currently configuring the first device and the second device separately through the configuration device, the embodiment of the present invention uses the first device to configure the second device according to the out-of-band key of the second device, and the out-of-band key of the second device by configuring the device with the second Out-of-band communication between devices is obtained, and the configuration device sends the first signature verification key and the first network key to the third device, and the second device sends the first connection information to the third device, which can realize the third device according to the first A network key, determine whether the peer network key in the first connection information is legal, and determine whether the first signature information in the first connection information is legal according to the first signature verification key, so that the first device can be The configured second device is configured to the third device, that is, the third device configures the second device, thereby improving the success rate of device configuration.
需要说明的是,本发明实施例中提供的第三设备中各器件所对应的其他相应描述,可以参考图5或图6中的对应描述,在此不再赘述。It should be noted that for other corresponding descriptions corresponding to the components in the third device provided in the embodiment of the present invention, reference may be made to the corresponding descriptions in FIG. 5 or FIG. 6 , and details are not repeated here.
本发明实施例提供的配置的方法、配置的装置及设备,可以适用于对设备进行配置,但不仅限于此。The configuration method, configuration device, and equipment provided in the embodiments of the present invention may be applicable to equipment configuration, but are not limited thereto.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (60)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2014/088018 WO2016049895A1 (en) | 2014-09-30 | 2014-09-30 | Configuration method, configuration apparatus and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106471831A true CN106471831A (en) | 2017-03-01 |
CN106471831B CN106471831B (en) | 2019-11-29 |
Family
ID=55629322
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201480080297.5A Active CN106471831B (en) | 2014-09-30 | 2014-09-30 | The method of configuration, the device of configuration and equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106471831B (en) |
WO (1) | WO2016049895A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110650057A (en) * | 2019-09-29 | 2020-01-03 | 武汉迈威通信股份有限公司 | Method and system for configuring equipment through portable mobile terminal |
CN111339545A (en) * | 2020-03-20 | 2020-06-26 | 苏州链原信息科技有限公司 | Method for generating data tag, electronic device and computer storage medium |
CN112601218A (en) * | 2020-12-31 | 2021-04-02 | 青岛海尔科技有限公司 | Wireless network configuration method and device |
CN113595740A (en) * | 2021-07-30 | 2021-11-02 | 北京小米移动软件有限公司 | Data transmission method and device, electronic equipment and storage medium |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11012898B2 (en) | 2016-10-27 | 2021-05-18 | Silicon Laboratories, Inc. | Use of a network to commission a second network |
US20190205874A1 (en) * | 2018-01-02 | 2019-07-04 | Laurence Hamid | Wireless based methods and systems for federated key management, asset management, and financial transactions |
CN111835508B (en) * | 2019-04-23 | 2023-02-28 | 深圳市汇顶科技股份有限公司 | Key distribution deployment method and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101366259A (en) * | 2005-12-30 | 2009-02-11 | 英特尔公司 | Automatic configuration of devices upon introduction into a networked environment |
CN101873588A (en) * | 2010-05-27 | 2010-10-27 | 大唐微电子技术有限公司 | Method and system for realizing service application safety |
CN102255888A (en) * | 2010-05-21 | 2011-11-23 | 英特尔公司 | Method and apparatus for secure scan of Data storage device from remote server |
CN102457849A (en) * | 2010-10-20 | 2012-05-16 | 诺基亚公司 | Wireless docking with out-of-band initiation |
CN102576559A (en) * | 2009-08-07 | 2012-07-11 | 杜比国际公司 | Authentication of data streams |
CN103813318A (en) * | 2012-11-09 | 2014-05-21 | 华为终端有限公司 | Information configuration method, device and system |
US20140281522A1 (en) * | 2013-03-13 | 2014-09-18 | Xerox Corporation | Method and apparatus for establishing a secure communication link between a mobile endpoint device and a networked device |
-
2014
- 2014-09-30 CN CN201480080297.5A patent/CN106471831B/en active Active
- 2014-09-30 WO PCT/CN2014/088018 patent/WO2016049895A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101366259A (en) * | 2005-12-30 | 2009-02-11 | 英特尔公司 | Automatic configuration of devices upon introduction into a networked environment |
CN102576559A (en) * | 2009-08-07 | 2012-07-11 | 杜比国际公司 | Authentication of data streams |
CN102255888A (en) * | 2010-05-21 | 2011-11-23 | 英特尔公司 | Method and apparatus for secure scan of Data storage device from remote server |
CN101873588A (en) * | 2010-05-27 | 2010-10-27 | 大唐微电子技术有限公司 | Method and system for realizing service application safety |
CN102457849A (en) * | 2010-10-20 | 2012-05-16 | 诺基亚公司 | Wireless docking with out-of-band initiation |
CN103813318A (en) * | 2012-11-09 | 2014-05-21 | 华为终端有限公司 | Information configuration method, device and system |
US20140281522A1 (en) * | 2013-03-13 | 2014-09-18 | Xerox Corporation | Method and apparatus for establishing a secure communication link between a mobile endpoint device and a networked device |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110650057A (en) * | 2019-09-29 | 2020-01-03 | 武汉迈威通信股份有限公司 | Method and system for configuring equipment through portable mobile terminal |
CN110650057B (en) * | 2019-09-29 | 2022-03-11 | 武汉迈威通信股份有限公司 | Method and system for configuring equipment through portable mobile terminal |
CN111339545A (en) * | 2020-03-20 | 2020-06-26 | 苏州链原信息科技有限公司 | Method for generating data tag, electronic device and computer storage medium |
CN111339545B (en) * | 2020-03-20 | 2024-03-19 | 苏州链原信息科技有限公司 | Method for generating data tag, electronic device and computer storage medium |
CN112601218A (en) * | 2020-12-31 | 2021-04-02 | 青岛海尔科技有限公司 | Wireless network configuration method and device |
CN112601218B (en) * | 2020-12-31 | 2022-12-02 | 青岛海尔科技有限公司 | Wireless network configuration method and device |
CN113595740A (en) * | 2021-07-30 | 2021-11-02 | 北京小米移动软件有限公司 | Data transmission method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2016049895A1 (en) | 2016-04-07 |
CN106471831B (en) | 2019-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106471831B (en) | The method of configuration, the device of configuration and equipment | |
CN105684344B (en) | A kind of cipher key configuration method and apparatus | |
CN112640510B (en) | Method and apparatus for establishing a wireless secure link while maintaining privacy to prevent tracking | |
US10979412B2 (en) | Methods and apparatus for secure device authentication | |
US9668230B2 (en) | Security integration between a wireless and a wired network using a wireless gateway proxy | |
KR101233254B1 (en) | Session key sharing method between Wireless Communication devices by using variable length of authentication code | |
US10305684B2 (en) | Secure connection method for network device, related apparatus, and system | |
CN101689990B (en) | Method for generating traffic encryption key | |
CN103391541B (en) | The collocation method of wireless device and device, system | |
CN105764058B (en) | Method, device and system for accessing a network | |
KR20160078475A (en) | Key configuration method, system and apparatus | |
CN112740733A (en) | A secure access method and device | |
WO2014180296A1 (en) | Method, configuration device, and wireless device for establishing connection between devices | |
CN110087240B (en) | Wireless network security data transmission method and system based on WPA2-PSK mode | |
CN109905348B (en) | End-to-end authentication and key agreement method, device and system | |
WO2015100675A1 (en) | Network configuration method, and related device and system | |
US20180095500A1 (en) | Tap-to-dock | |
CN105407109A (en) | Data secure transmission method between Bluetooth devices | |
WO2021103772A1 (en) | Data transmission method and apparatus | |
WO2018126783A1 (en) | Key transmission method, device, and computer storage medium | |
CN104509025A (en) | System and method for hybrid multiple source decryption | |
CN106664559B (en) | The method, apparatus and system of device configuration in cordless communication network | |
WO2017114156A1 (en) | Method for encrypted transmission of data, base station and pdt terminal | |
Berchtold et al. | Secure communication protocol for a low-bandwidth audio channel | |
CN115769542A (en) | Information processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210429 Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Device Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |