CN114124394A - A method and device for generating authentication credential and device authentication - Google Patents
A method and device for generating authentication credential and device authentication Download PDFInfo
- Publication number
- CN114124394A CN114124394A CN202010888232.0A CN202010888232A CN114124394A CN 114124394 A CN114124394 A CN 114124394A CN 202010888232 A CN202010888232 A CN 202010888232A CN 114124394 A CN114124394 A CN 114124394A
- Authority
- CN
- China
- Prior art keywords
- authenticated
- layer
- authentication
- value
- firmware
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3226—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
-
- 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/08—Network architectures or network communication protocols for network security for authentication of entities
-
- 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/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/083—Network architectures or network communication protocols for network security for authentication of entities using passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0863—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0869—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
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)
- Power Engineering (AREA)
- Stored Programmes (AREA)
Abstract
本申请涉及一种认证凭证的生成、设备认证方法及装置,可应用于物联网设备,第一设备包括n个待认证层,在启动认证过程时,确定初始校验值;所述初始校验值用于标记本次认证过程;依次针对所述n个待认证层的第i个待认证层执行下述处理,得到第n个待认证层的固件密码值:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;根据所述第i+1个待认证层的代码和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;根据所述第n个待认证层的固件密码值,生成初始认证凭证;以用于对所述第一设备进行认证。
The present application relates to an authentication credential generation, device authentication method and device, which can be applied to IoT devices. The first device includes n layers to be authenticated, and an initial verification value is determined when the authentication process is started; the initial verification value is The value is used to mark this authentication process; the following processing is performed for the i-th layer to be authenticated of the n layers to be authenticated, and the firmware password value of the n-th layer to be authenticated is obtained: according to the i-th layer to be authenticated The first check value of the layer, to determine the first check value of the i+1th layer to be authenticated; the first check value of the first layer to be authenticated is determined according to the initial check value ; According to the code of the i+1 layer to be authenticated and the first check value of the i layer to be authenticated, determine the firmware password value of the i+1 layer to be authenticated; According to the i+1 layer to be authenticated The firmware password values of the n layers to be authenticated are used to generate an initial authentication credential, which is used to authenticate the first device.
Description
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种认证凭证的生成、设备认证方法及装置。The present application relates to the field of communication technologies, and in particular, to a method and apparatus for generating an authentication credential and device authentication.
背景技术Background technique
在互联网环境下,物联网设备相较于传统用户终端设备更易遭受黑客攻击,其主要原因表现在:1)部分物联网设备为了保持低功耗或低成本,因而设备资源受限,进而其自身难以提供强健的安全机制抵御来自外部的网络攻击;2)物联网设备广泛分布在不安全的物理环境中,其操作缺乏授权许可,进而易于被非授权人员通过物理接口访问植入恶意代码。物联网设备的攻破可能造成机密信息泄露,也可能使物联网设备本身成为僵尸主机的组成部分,这为物联网设备及其所属网络环境带来威胁。网络或设备管理员需要及时识别出被入侵的物联网设备,进而及时限制被入侵物联网设备的网络流量行为以降低其潜在带来的网络安全威胁。In the Internet environment, IoT devices are more vulnerable to hacker attacks than traditional user terminal devices. The main reasons are: 1) In order to maintain low power consumption or low cost, some IoT devices have limited device resources, and their own It is difficult to provide a robust security mechanism to defend against external network attacks; 2) IoT devices are widely distributed in insecure physical environments, and their operations lack authorization, which is easy to be accessed by unauthorized personnel through physical interfaces to implant malicious codes. The breach of IoT devices may lead to the leakage of confidential information, and may also make IoT devices themselves become part of bots, which brings threats to IoT devices and the network environment to which they belong. Network or device administrators need to identify the compromised IoT devices in time, and then limit the network traffic behavior of the compromised IoT devices in time to reduce the potential network security threats.
目前采取的一种措施是,可以对物联网设备进行认证。例如,物联网设备通过向认证方发送物联网设备的固件版本以及固件哈希值。认证方通过校验固件哈希值的完整性,可以判断物联网设备的固件代码是否遭到非授权的篡改。但是,目前的认证方式安全性较低。One of the measures currently being taken is that IoT devices can be authenticated. For example, IoT devices send authenticators the firmware version of the IoT device along with the firmware hash. By verifying the integrity of the firmware hash value, the authenticator can determine whether the firmware code of the IoT device has been unauthorizedly tampered with. However, the current authentication method is less secure.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种认证凭证的生成、设备认证方法及装置,用于提高物联网设备的第一设备的安全性。Embodiments of the present application provide a method and apparatus for generating an authentication credential and device authentication, which are used to improve the security of a first device of an Internet of Things device.
第一方面,提供一种认证凭证的生成方法,该第一方面的方法可由第一通信装置执行,第一通信装置可以是通信设备或能够支持通信设备实现该方法所需的功能的装置,例如芯片系统。示例性地,通信设备为物联网设备。在下文的描述中,以第一通信装置是第一设备为例。A first aspect provides a method for generating an authentication credential, the method of the first aspect can be performed by a first communication device, and the first communication device can be a communication device or a device capable of supporting the communication device to implement the functions required by the method, for example chip system. Illustratively, the communication device is an Internet of Things device. In the following description, it is taken as an example that the first communication apparatus is the first device.
其中,所述第一设备包括n个待认证层,n为正整数。第一设备在启动认证过程时,确定初始校验值;所述初始校验值用于标记本次认证过程;第一设备依次针对所述n个待认证层的第i个待认证层执行下述处理,得到第n个待认证层的固件密码值:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;所述i大于等于1且小于或等于n-1的正整数;根据所述第i+1个待认证层的代码和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;所述第1个待认证层的固件密码值为根据所述第1个待认证层的代码确定的;第一设备根据所述第n个待认证层的固件密码值,生成初始认证凭证;所述初始认证凭证用于对所述第一设备进行认证。Wherein, the first device includes n layers to be authenticated, and n is a positive integer. When starting the authentication process, the first device determines an initial verification value; the initial verification value is used to mark the current authentication process; the first device sequentially executes the next step for the i-th layer to be authenticated of the n layers to be authenticated. The above process obtains the firmware password value of the n-th layer to be authenticated: according to the first check value of the i-th layer to be authenticated, determine the first check value of the i+1-th layer to be authenticated; The first check value of the first layer to be authenticated is determined according to the initial check value; the i is a positive integer greater than or equal to 1 and less than or equal to n-1; The code of the authentication layer and the first check value of the i-th layer to be authenticated determine the firmware password value of the i+1-th layer to be authenticated; the firmware password value of the first layer to be authenticated is based on Determined by the code of the first layer to be authenticated; the first device generates an initial authentication credential according to the firmware password value of the nth layer to be authenticated; the initial authentication credential is used to authenticate the first device .
通过上述方法,通过初始校验值标记本次认证过程,使得基于初始校验值生成第一校验值,之后再通过第一校验值生成第n个待认证层的固件密码值,以得到的初始认证凭证,可以在每次启动过程中,都生成不同的初始认证凭证,从而,避免由于第一设备中存储的初始认证凭证可能被黑客窃取,导致发送给第二设备的目标认证凭证可能是历史中被窃取的认证凭证,从而提高了第一设备的安全性。另外,由于通过根据所述第i+1个待认证层的代码和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值,从而,可以使得每个待认证层的固件密码值之间是相互独立的,为每个待认证层进行分别认证提供了可能,提高了第一设备的安全性和认证的粒度。Through the above method, the current authentication process is marked with the initial verification value, so that the first verification value is generated based on the initial verification value, and then the firmware password value of the nth layer to be authenticated is generated through the first verification value, so as to obtain The initial authentication credential of the device can generate different initial authentication credential in each startup process, so as to avoid that the initial authentication credential stored in the first device may be stolen by hackers, resulting in the possibility that the target authentication credential sent to the second device may be It is an authentication credential that has been stolen in history, thereby improving the security of the first device. In addition, since the firmware password value of the i+1th layer to be authenticated is determined according to the code of the i+1th layer to be authenticated and the first check value of the ith layer to be authenticated, thus , the firmware password values of each to-be-authenticated layer can be made independent of each other, which provides the possibility for each to-be-authenticated layer to perform separate authentication, and improves the security of the first device and the granularity of authentication.
一种可能的实现方式,第一设备对所述第i+1个待认证层的代码进行哈希,得到第i+1个待认证层的哈希值;第一设备对所述第i+1个待认证层的哈希值和所述第i个待认证层的第一校验值加密,得到所述第i+1个待认证层的固件密码值。A possible implementation manner, the first device hashes the code of the i+1th layer to be authenticated to obtain the hash value of the i+1th layer to be authenticated; the first device hashes the code of the i+1th layer to be authenticated; The hash value of one layer to be authenticated and the first check value of the i-th layer to be authenticated are encrypted to obtain the firmware password value of the i+1-th layer to be authenticated.
通过上述方法,可以使得每个待认证层生成的固件密码值是相互独立的,从而,可以分别对每个待认证层的固件密码值进行认证,提高认证的精度。Through the above method, the firmware password values generated by each layer to be authenticated can be independent of each other, so that the firmware password value of each layer to be authenticated can be authenticated separately, and the accuracy of authentication can be improved.
一种可能的实现方式,第一设备对所述第i个待认证层的第一校验值进行哈希,得到所述第i+1个待认证层的第一校验值。In a possible implementation manner, the first device hashes the first check value of the i-th layer to be authenticated to obtain the first check value of the i+1-th layer to be authenticated.
通过上述方法,可以为每个待认证层生成相应的第一校验值,以提高基于第一校验值生成固件密码值的安全性。Through the above method, a corresponding first check value can be generated for each layer to be authenticated, so as to improve the security of generating a firmware password value based on the first check value.
一种可能的实现方式,第一设备确定所述第i个待认证层的固件密码值后,还可以向第i+1个待认证层输出所述第i+1个待认证层的第一校验值、所述第i+1个待认证层的固件密码值和所述初始校验值。A possible implementation manner, after the first device determines the firmware password value of the i-th layer to be authenticated, it can also output the first device of the i+1-th layer to be authenticated to the i+1-th layer to be authenticated. The verification value, the firmware password value of the i+1 th layer to be authenticated, and the initial verification value.
通过上述方法,可以基于上一个待认证层生成的下一个待认证层的第一校验值、固件密码值和所述初始校验值,以便下一个待认证层生成下下一个的待认证层的第一校验值、固件密码值和所述初始校验值,完成逐级生成的认证凭证的过程,并相互独立。Through the above method, based on the first check value of the next layer to be authenticated, the firmware password value and the initial check value generated by the previous layer to be authenticated, the next layer to be authenticated can generate the next layer to be authenticated The first verification value, the firmware password value and the initial verification value of the device complete the process of generating the authentication credential step by step, and are independent of each other.
一种可能的实现方式,第一设备还可以删除所述第i个待认证层的第一校验值、所述第i个待认证层的固件密码值。In a possible implementation manner, the first device may also delete the first check value of the i-th layer to be authenticated and the firmware password value of the i-th layer to be authenticated.
通过上述方法,可以避免所述第i个待认证层的第一校验值、所述第i个待认证层的固件密码值的泄露,提高安全性。Through the above method, the leakage of the first check value of the i-th layer to be authenticated and the firmware password value of the i-th layer to be authenticated can be avoided, thereby improving security.
一种可能的实现方式,所述初始校验值为以下任一项:时间戳、计数器或随机数。In a possible implementation manner, the initial check value is any one of the following: a timestamp, a counter or a random number.
通过上述方法,通过初始校验值为以下任一项:时间戳、计数器或随机数,可以生成动态的初始认证凭证,使得认证方有能力对初始校验值进行认证,从而降低攻击者在认证过程中仿冒其他设备身份的风险。Through the above method, the initial verification value can be any of the following: timestamp, counter or random number, and a dynamic initial authentication credential can be generated, so that the authenticator has the ability to authenticate the initial verification value, thereby reducing the attacker's ability to authenticate. Risk of impersonating the identity of other devices in the process.
第二方面,提供一种基于第一方面生成的认证凭证的设备认证方法,该方法可以由第一设备执行。包括:向认证方发送第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;接收来自所述认证方的第一认证响应;所述第一认证响应用于指示所述第一设备的认证结果。In a second aspect, a device authentication method based on the authentication credential generated by the first aspect is provided, and the method can be executed by the first device. It includes: sending a first authentication request message to an authenticating party; the first authentication request message includes: the initial verification value and a target authentication credential; the target authentication credential is determined according to the initial authentication credential; the first authentication credential An authentication request message is used to request authentication for the first device; receive a first authentication response from the authenticator; and the first authentication response is used to indicate the authentication result of the first device.
通过上述方法,由于初始校验值仅标记本次认证过程,向认证方发送的目标认证凭证也是仅能用于该次认证过程,可以避免由于第一设备中存储的初始认证凭证可能被黑客窃取,提高目标认证凭证的安全性。并且,通过发送初始校验值,可以使得认证方对初始校验值进行认证,进一步提高了认证的有效性。Through the above method, since the initial verification value only marks this authentication process, the target authentication credential sent to the authenticator can only be used in this authentication process, which can avoid the possibility that the initial authentication credential stored in the first device may be stolen by hackers , to improve the security of the target authentication credentials. In addition, by sending the initial verification value, the authenticator can authenticate the initial verification value, which further improves the validity of the authentication.
一种可能的实现方式,在所述第一设备的认证结果为认证失败时,第一设备还可以向所述认证方发送第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;接收来自所述认证方的第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。A possible implementation manner, when the authentication result of the first device is an authentication failure, the first device may also send a second authentication request message to the authenticator; the second authentication request message includes: the i-th The encrypted firmware password value of the layer to be authenticated; the encrypted firmware password value is determined according to the firmware password value of the i-th layer to be authenticated; the second authentication request message is used to The i-th layer to be authenticated requests authentication; a second authentication response from the authenticator is received; the second authentication response is used to indicate the authentication result of the i-th layer to be authenticated.
通过上述方法,在确定第一设备认证失败时,可以向认证方发送第二认证请求消息,从而,使得认证方对第i个待认证层的加密固件密码值进行认证,以获得第i个待认证层的认证结果,获得更细粒度的认证。Through the above method, when it is determined that the authentication of the first device fails, a second authentication request message can be sent to the authenticating party, so that the authenticating party can authenticate the encrypted firmware password value of the i-th layer to be authenticated to obtain the i-th layer to be authenticated. The authentication result of the authentication layer to obtain more fine-grained authentication.
一种可能的实现方式,所述向所述认证方发送第二认证请求消息之前,还可以接收来自所述认证方的第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。A possible implementation manner, before sending the second authentication request message to the authenticating party, a third authentication request message from the authenticating party may also be received; the third authentication request message is used to request to obtain the The encrypted firmware password value of the i-th layer to be authenticated.
通过上述方法,可以在接收到来自认证方的第三认证请求消息后,向认证方发送第i个待认证层的加密固件密码值,从而,可以基于认证方的认证需要进行分别发送,避免发送不必要的认证信息,减少传输过程中被窃取的可能,提高认证过程的安全性。Through the above method, after receiving the third authentication request message from the authenticating party, the encrypted firmware password value of the i-th layer to be authenticated can be sent to the authenticating party, so that the encrypted firmware password value of the i-th layer to be authenticated can be sent separately based on the authentication needs of the authenticating party to avoid sending Unnecessary authentication information reduces the possibility of being stolen during transmission and improves the security of the authentication process.
一种可能的实现方式,所述第一认证请求消息还包括:所述n个待认证层的n个加密固件密码值;所述n个待认证层中的第i个待认证层的加密固件密码值为根据所述第i个待认证层的固件密码值进行加密后确定的;所述第一认证响应还用于指示所述n个待认证层中认证失败的待认证层。A possible implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the encrypted firmware of the i-th layer to be authenticated in the n layers to be authenticated The password value is determined after encryption according to the firmware password value of the i-th layer to be authenticated; the first authentication response is further used to indicate a layer to be authenticated that fails to be authenticated among the n layers to be authenticated.
通过上述方法,可以在第一认证请求中,即发送n个待认证层的n个加密固件密码值,从而,无需第一设备在确定认证失败后,再次发送第二认证请求,以降低第一设备的功耗。Through the above method, n encrypted firmware password values of n layers to be authenticated can be sent in the first authentication request, so that the first device does not need to send the second authentication request again after determining that the authentication fails, so as to reduce the first The power consumption of the device.
一种可能的实现方式,第一设备还可以接收来自所述认证方的第一随机数;根据所述第一随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;或者,根据所述第一随机数、第二随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;所述第二随机数为所述第一设备确定的;所述目标认证凭证为根据加密后的所述初始认证凭证确定的。In a possible implementation manner, the first device may also receive a first random number from the authenticator; generate the encrypted initial authentication credential according to the first random number and the initial authentication credential; or, The encrypted initial authentication credential is generated according to the first random number, the second random number and the initial authentication credential; the second random number is determined by the first device; the target authentication credential is It is determined according to the encrypted initial authentication credential.
通过上述方法,第一设备可以通过接收到的第二设备(认证方)的第一随机数,对初始认证凭证进行加密,或者,基于第一随机数和第二随机数据,对初始认证凭证进行加密,从而可以提高目标认证凭证在传输过程中的安全性。Through the above method, the first device can encrypt the initial authentication credential by using the received first random number of the second device (authentication party), or, based on the first random number and the second random data, encrypt the initial authentication credential Encryption, which can improve the security of target authentication credentials during transmission.
一种可能的实现方式,第一设备还可以根据所述第一随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值;或者,第一设备还可以根据所述第一随机数、所述第二随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值。In a possible implementation manner, the first device may also generate the encrypted firmware password value of the i-th layer to be authenticated according to the first random number and the firmware password value of the i-th layer to be authenticated; or, The first device may also generate the encrypted firmware password value of the i-th layer to be authenticated according to the first random number, the second random number, and the firmware password value of the i-th layer to be authenticated.
通过上述方法,第一设备可以通过接收到的第二设备(认证方)的第一随机数,对第i个待认证层的固件密码值进行加密,或者,基于第一随机数和第二随机数据,对第i个待认证层的固件密码值进行加密,从而可以提高第i个待认证层的固件密码值在传输过程中的安全性。Through the above method, the first device can encrypt the firmware password value of the i-th layer to be authenticated through the received first random number of the second device (authentication party), or, based on the first random number and the second random number data, encrypt the firmware password value of the i-th layer to be authenticated, so that the security of the firmware password value of the i-th layer to be authenticated during transmission can be improved.
一种可能的实现方式,所述第一认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败;所述第二认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败、所述第i个待认证层认证失败。A possible implementation manner, the first authentication response includes at least one of the following: the initial verification value authentication fails, the target authentication credential authentication fails; the second authentication response includes at least one of the following: The authentication of the initial check value fails, the authentication of the target authentication credential fails, and the authentication of the i-th layer to be authenticated fails.
通过上述方法,第一认证响应可以是在初始校验值认证失败或者所述目标认证凭证认证失败发送的,第二认证响应可以是在确认第i个待认证层认证失败后发送的,所述初始校验值认证失败、所述目标认证凭证认证失败、所述第i个待认证层认证失败的发送方式并不限定,可以基于具体场景的需要进行发送,以提高认证的灵活性和认证的效率。Through the above method, the first authentication response may be sent when the authentication of the initial check value or the target authentication credential fails, and the second authentication response may be sent after confirming that the i-th layer to be authenticated fails. The sending method of the initial verification value authentication failure, the target authentication credential authentication failure, and the authentication failure of the i-th layer to be authenticated is not limited, and can be sent based on the needs of specific scenarios to improve the flexibility of authentication and the efficiency of authentication. efficiency.
第三方面,提供一种基于第一方面生成的认证凭证的设备认证方法,该方法可以是由第二通信装置执行,第二通信装置可以是通信设备或能够支持通信设备实现该方法所需的功能的装置,例如芯片系统。示例性地,通信设备为认证方的服务器。在下文的描述中,以第通信装置是第二设备为例。包括:第二设备接收来自第一设备的第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;第二设备对所述第一认证请求消息进行认证;第二设备根据所述第一认证请求消息的认证结果,向所述第一设备发送第一认证响应;所述第一认证响应用于指示所述第一设备认证结果。A third aspect provides a device authentication method based on the authentication credential generated in the first aspect, the method may be executed by a second communication device, and the second communication device may be a communication device or capable of supporting the communication device required to implement the method A functional device, such as a system-on-a-chip. Illustratively, the communication device is the authenticator's server. In the following description, it is taken as an example that the first communication device is the second device. Including: the second device receives a first authentication request message from the first device; the first authentication request message includes: the initial verification value and the target authentication credential; the target authentication credential is determined according to the initial authentication credential The first authentication request message is used to request authentication for the first device; the second device authenticates the first authentication request message; The first device sends a first authentication response; the first authentication response is used to indicate an authentication result of the first device.
通过上述方法,第二设备可以基于第一设备在本次认证过程中的初始校验值进行认证,还可以基于初始校验值生成的目标认证凭证进行认证,避免由于第一设备中存储的初始认证凭证可能被黑客窃取,导致发送给第二设备的目标认证凭证可能是历史中被窃取的认证凭证,从而提高了第一设备的安全性。Through the above method, the second device can perform authentication based on the initial verification value of the first device in the current authentication process, and can also perform authentication based on the target authentication credential generated based on the initial verification value. The authentication credential may be stolen by a hacker, so that the target authentication credential sent to the second device may be an authentication credential that has been stolen in history, thereby improving the security of the first device.
一种可能的实现方式,所述初始校验值为时间戳,则第二设备根据当前时间,对所述初始校验值进行认证;或者,所述第一校验值为计数器,则第二设备将所述初始校验值与第二校验值比较,对所述初始校验值进行认证;所述第二校验值为所述第一设备上一次发送的初始校验值;所述第一校验值为随机数,则第二设备根据所述初始校验值与所述第一设备发送的所有历史初始校验值比较,对所述第一校验值进行认证。A possible implementation manner, if the initial check value is a timestamp, the second device authenticates the initial check value according to the current time; or, if the first check value is a counter, then the second device authenticates the initial check value according to the current time The device compares the initial verification value with the second verification value, and authenticates the initial verification value; the second verification value is the initial verification value sent by the first device last time; the If the first check value is a random number, the second device authenticates the first check value according to the comparison between the initial check value and all historical initial check values sent by the first device.
通过上述方法,第二设备可以基于第一设备发送的初始校验值与历史的初始校验值进行比较,从而,对初始校验值进行认证,使得认证方可以通过初始校验值,指定相应的策略进行认证,从而降低攻击者在认证过程中仿冒第一设备身份的风险,提高第一设备的安全性。Through the above method, the second device can compare the initial verification value sent by the first device with the historical initial verification value, thereby authenticating the initial verification value, so that the authenticator can specify the corresponding initial verification value through the initial verification value. This reduces the risk of an attacker imitating the identity of the first device during the authentication process and improves the security of the first device.
一种可能的实现方式,第二设备根据所述第一设备的n个待认证层的n个标准哈希值及所述第一校验值,生成n个标准固件密码值;第二设备根据所述n个标准固件密码值,生成标准校验秘钥;第二设备将所述标准校验秘钥与所述目标认证凭证比较,确定所述目标认证凭证是否认证成功。In a possible implementation manner, the second device generates n standard firmware password values according to the n standard hash values of the n layers to be authenticated and the first check value of the first device; The n standard firmware password values are used to generate a standard verification key; the second device compares the standard verification key with the target authentication credential to determine whether the target authentication credential is authenticated successfully.
通过上述方法,第二设备可以基于存储的标准哈希值及所述第一校验值,生成n个标准固件密码值,从而,可以生成标准校验秘钥,以实现对目标认证凭证的认证。Through the above method, the second device can generate n standard firmware password values based on the stored standard hash value and the first check value, thereby generating a standard check key to authenticate the target authentication credential .
一种可能的实现方式,第二设备针对n个待认证层中的第i个待认证层,执行:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;i为大于等于1且小于或等于n-1的正整数;第二设备根据所述第i+1个待认证层的标准哈希值和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的标准固件密码值;所述第1个待认证层的标准固件密码值为根据所述第1个待认证层的标准哈希值确定的。A possible implementation manner, the second device performs for the i-th layer to be authenticated among the n layers to be authenticated: according to the first check value of the i-th layer to be authenticated, determine the i+1 The first check value of each layer to be authenticated; the first check value of the first layer to be authenticated is determined according to the initial check value; i is a positive value greater than or equal to 1 and less than or equal to n-1 Integer; the second device determines the standard of the i+1th layer to be authenticated according to the standard hash value of the i+1th layer to be authenticated and the first check value of the ith layer to be authenticated Firmware password value; the standard firmware password value of the first layer to be authenticated is determined according to the standard hash value of the first layer to be authenticated.
通过上述方法,第二设备可以根据存储的标准哈希值及所述第一校验值,生成每一个待认证层的标准固件密码值,以便后续可以对每个待认证层进行认证。Through the above method, the second device can generate the standard firmware password value of each layer to be authenticated according to the stored standard hash value and the first check value, so that each layer to be authenticated can be authenticated subsequently.
一种可能的实现方式,在所述第一设备认证结果为所述目标认证凭证的认证结果为失败,则接收来自所述第一设备的第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;对所述第i个待认证层的加密固件密码值进行认证,根据所述第i个待认证层的加密固件密码值的认证结果,向所述第一设备发送第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。A possible implementation manner, when the authentication result of the first device is that the authentication result of the target authentication credential is a failure, a second authentication request message from the first device is received; the second authentication request message includes : the encrypted firmware password value of the i-th layer to be authenticated; the encrypted firmware password value is determined according to the firmware password value of the i-th layer to be authenticated; the second authentication request message is used to The i-th layer to be authenticated of the device requests authentication; the encrypted firmware password value of the i-th layer to be authenticated is authenticated, and according to the authentication result of the encrypted firmware password value of the i-th layer to be authenticated, a The first device sends a second authentication response; the second authentication response is used to indicate the authentication result of the i-th layer to be authenticated.
通过上述方法,为提高传输过程中的安全性,第二认证请求消息中可以携带第i个待认证层的加密固件密码值,从而,第二设备可以基于第i个待认证层的标准固件密码值,对第i个待认证层的加密固件密码值进行认证。举例来说,可以是基于每一个待认证层的标准固件密码值,生成加密后的第i个待认证层的标准固件密码值,从而与第i个待认证层的加密固件密码值进行比较,以实现第i个待认证层的认证。Through the above method, in order to improve the security in the transmission process, the second authentication request message can carry the encrypted firmware password value of the i-th layer to be authenticated, so that the second device can be based on the standard firmware password of the i-th layer to be authenticated value to authenticate the encrypted firmware password value of the i-th layer to be authenticated. For example, based on the standard firmware password value of each layer to be authenticated, the encrypted standard firmware password value of the i-th layer to be authenticated is generated, so as to compare with the encrypted firmware password value of the i-th layer to be authenticated, In order to realize the authentication of the i-th layer to be authenticated.
一种可能的实现方式,第二设备根据所述n个标准固件密码值中的第i个标准固件密码值,生成加密后的第i个标准固件密码值;将所述加密后的第i个标准固件密码值,确定所述第i个待认证层是否认证成功。A possible implementation, the second device generates an encrypted i-th standard firmware password value according to the i-th standard firmware password value in the n standard firmware password values; Standard firmware password value to determine whether the i-th layer to be authenticated is authenticated successfully.
一种可能的实现方式,第二设备还可以向所述第一设备发送第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。In a possible implementation manner, the second device may also send a third authentication request message to the first device; the third authentication request message is used to request to obtain the encrypted firmware password value of the i-th layer to be authenticated.
通过上述方法,可以根据需要,主动向第一设备发送第三认证请求消息,以获取第i个待认证层的加密固件密码值,提高认证的灵活性。Through the above method, the third authentication request message can be actively sent to the first device as required to obtain the encrypted firmware password value of the i-th layer to be authenticated, thereby improving the flexibility of authentication.
一种可能的实现方式,所述第一认证请求消息还包括:n个待认证层的n个加密固件密码值;第二设备还可以对所述n个待认证层的n个加密固件密码值分别进行认证,以确定认证失败的待认证层;所述第一认证响应还用于指示认证失败的待认证层。In a possible implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the second device may also verify the n encrypted firmware password values of the n layers to be authenticated. The authentication is performed respectively to determine the to-be-authenticated layer for which the authentication fails; the first authentication response is also used to indicate the to-be-authenticated layer for which the authentication fails.
通过上述方法,第二设备可以对第一认证请求消息中的n个待认证层的n个加密固件密码值分别进行认证,以获得认证设备的待认证层,从而提高认证的粒度,以便指导后续对第一设备的管理,提高第一设备的安全性。Through the above method, the second device can respectively authenticate the n encrypted firmware password values of the n layers to be authenticated in the first authentication request message to obtain the layers to be authenticated of the authentication device, thereby improving the granularity of authentication and guiding subsequent The management of the first device improves the security of the first device.
一种可能的实现方式,第二设备还可以向所述第一设备发送第一随机数;其中,所述目标认证凭证为根据所述第一随机数和所述初始认证凭证生成的;或者,所述目标认证凭证为根据所述第一随机数、第二随机数和所述初始认证凭证生成的;所述第二随机数为所述第一设备确定的。In a possible implementation manner, the second device may also send a first random number to the first device; wherein, the target authentication credential is generated according to the first random number and the initial authentication credential; or, The target authentication credential is generated according to the first random number, the second random number and the initial authentication credential; the second random number is determined by the first device.
通过上述方法,第二设备可以向第一设备发送第一随机数,从而,可以使得第一设备基于第一随机数对待发送的初始认证凭证进行加密,以提高传输过程中的认证请求的安全性。Through the above method, the second device can send the first random number to the first device, so that the first device can be made to encrypt the initial authentication credential to be sent based on the first random number, so as to improve the security of the authentication request during the transmission process .
一种可能的实现方式,所述第i个待认证层的加密固件密码值为根据所述第一随机数和所述第i个待认证层的固件密码值生成的;或者,所述第i个待认证层的加密固件密码值为根据所述第一随机数、第二随机数和所述第i个待认证层的固件密码值生成的。A possible implementation manner, the encrypted firmware password value of the i-th layer to be authenticated is generated according to the first random number and the firmware password value of the i-th layer to be authenticated; The encrypted firmware password values of the layers to be authenticated are generated according to the first random number, the second random number, and the firmware password value of the i-th layer to be authenticated.
通过上述方法,可以使得第一设备基于第一随机数对待发送的第i个待认证层的固件密码值进行加密,以提高传输过程中的认证请求的安全性。Through the above method, the first device can be made to encrypt the firmware password value of the i-th layer to be authenticated to be sent based on the first random number, so as to improve the security of the authentication request during the transmission process.
第四方面,提供一种通信装置,例如该通信装置为如前所述的第一通信装置。所述第一通信装置用于执行上述第一方面或第一方面的任一可能的实现方式中的方法。具体地,所述第一通信装置可以包括用于执行第一方面或第一方面的任一可能的实现方式中的方法的模块,例如包括处理模块和收发模块。其中,收发模块可以是指一个功能模块,该功能模块既能完成接收信息的功能也能完成发送信息的功能。或者,收发模块可以是发送模块和接收模块的统称,发送模块用于完成发送信息的功能,接收模块用于完成接收信息的功能。示例性地,所述第一通信装置为物联网设备。其中,所述第一通信装置包括n个待认证层,n为正整数。In a fourth aspect, a communication device is provided, for example, the communication device is the aforementioned first communication device. The first communication apparatus is configured to execute the method in the first aspect or any possible implementation manner of the first aspect. Specifically, the first communication apparatus may include a module for executing the method in the first aspect or any possible implementation manner of the first aspect, for example, including a processing module and a transceiver module. The transceiver module may refer to a functional module, and the functional module can perform both the function of receiving information and the function of transmitting information. Alternatively, the transceiver module may be a general term for a sending module and a receiving module, the sending module is used to complete the function of sending information, and the receiving module is used to complete the function of receiving information. Exemplarily, the first communication apparatus is an IoT device. Wherein, the first communication device includes n layers to be authenticated, and n is a positive integer.
所述处理模块,用于在启动认证过程时,确定初始校验值;所述初始校验值用于标记本次认证过程;依次针对所述n个待认证层的第i个待认证层执行下述处理,得到第n个待认证层的固件密码值:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;所述i大于等于1且小于或等于n-1的正整数;根据所述第i+1个待认证层的代码和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;所述第1个待认证层的固件密码值为根据所述第1个待认证层的代码确定的;第一设备根据所述第n个待认证层的固件密码值,生成初始认证凭证;所述初始认证凭证用于通过所述收发模块向认证方进行认证。The processing module is used to determine an initial verification value when the authentication process is started; the initial verification value is used to mark the current authentication process; and sequentially executes the i-th layer to be authenticated of the n layers to be authenticated The following process obtains the firmware password value of the nth layer to be authenticated: according to the first check value of the ith layer to be authenticated, determine the first check value of the i+1th layer to be authenticated; The first check value of the first layer to be authenticated is determined according to the initial check value; the i is a positive integer greater than or equal to 1 and less than or equal to n-1; according to the i+1th The code of the layer to be authenticated and the first check value of the i-th layer to be authenticated determine the firmware password value of the i+1-th layer to be authenticated; the firmware password value of the first layer to be authenticated is Determined according to the code of the first layer to be authenticated; the first device generates an initial authentication credential according to the firmware password value of the nth layer to be authenticated; the initial authentication credential is used to authenticate the party for authentication.
一种可能的实现方式,所述处理模块,用于对所述第i+1个待认证层的代码进行哈希,得到第i+1个待认证层的哈希值;对所述第i+1个待认证层的哈希值和所述第i个待认证层的第一校验值加密,得到所述第i+1个待认证层的固件密码值。A possible implementation, the processing module is used to hash the code of the i+1th layer to be authenticated to obtain the hash value of the i+1th layer to be authenticated; The hash value of the +1 layer to be authenticated and the first check value of the i-th layer to be authenticated are encrypted to obtain the firmware password value of the i+1-th layer to be authenticated.
一种可能的实现方式,所述处理模块,用于对所述第i个待认证层的第一校验值进行哈希,得到所述第i+1个待认证层的第一校验值。A possible implementation, the processing module is configured to hash the first check value of the i-th layer to be authenticated to obtain the first check value of the i+1-th layer to be authenticated .
一种可能的实现方式,所述处理模块,用于确定所述第i个待认证层的固件密码值后,通过所述收发模块向第i+1个待认证层输出所述第i个待认证层的第一校验值、所述第i个待认证层的固件密码值和所述初始校验值。A possible implementation, the processing module is configured to output the i-th to-be-authenticated layer to the i+1-th to-be-authenticated layer through the transceiver module after determining the firmware password value of the i-th layer to be authenticated. The first verification value of the authentication layer, the firmware password value of the i-th layer to be authenticated, and the initial verification value.
一种可能的实现方式,所述处理模块,还可以用于删除所述第i个待认证层的第一校验值、所述第i个待认证层的固件密码值。In a possible implementation manner, the processing module may be further configured to delete the first check value of the i-th layer to be authenticated and the firmware password value of the i-th layer to be authenticated.
一种可能的实现方式,所述初始校验值为以下任一项:时间戳、计数器或随机数。In a possible implementation manner, the initial check value is any one of the following: a timestamp, a counter or a random number.
关于第四方面或第四方面的各种可能的实施方式所带来的技术效果,可参考对于第一方面或第一方面的各种可能的实施方式的技术效果的介绍。Regarding the technical effects brought by the fourth aspect or various possible implementations of the fourth aspect, reference may be made to the introduction to the technical effects of the first aspect or various possible implementations of the first aspect.
第五方面,提供一种通信装置,例如该通信装置为如前所述的第一通信装置。所述第一通信装置用于执行上述第二方面或第二方面的任一可能的实现方式中的方法。具体地,所述第一通信装置可以包括用于执行第二方面或第二方面的任一可能的实现方式中的方法的模块,例如包括处理模块和收发模块。其中,收发模块可以是指一个功能模块,该功能模块既能完成接收信息的功能也能完成发送信息的功能。或者,收发模块可以是发送模块和接收模块的统称,发送模块用于完成发送信息的功能,接收模块用于完成接收信息的功能。示例性地,所述第一通信装置为物联网设备。其中,In a fifth aspect, a communication device is provided, for example, the communication device is the aforementioned first communication device. The first communication apparatus is configured to execute the method in the second aspect or any possible implementation manner of the second aspect. Specifically, the first communication apparatus may include a module for executing the method in the second aspect or any possible implementation manner of the second aspect, for example, including a processing module and a transceiver module. The transceiver module may refer to a functional module, and the functional module can perform both the function of receiving information and the function of transmitting information. Alternatively, the transceiver module may be a general term for a sending module and a receiving module, the sending module is used to complete the function of sending information, and the receiving module is used to complete the function of receiving information. Exemplarily, the first communication apparatus is an IoT device. in,
所述处理模块,用于通过收发模块向认证方发送第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;通过收发模块接收来自所述认证方的第一认证响应;所述第一认证响应用于指示所述第一设备的认证结果。The processing module is configured to send a first authentication request message to the authenticator through the transceiver module; the first authentication request message includes: the initial check value and a target authentication credential; the target authentication credential is based on the initial The authentication credential is determined; the first authentication request message is used to request authentication for the first device; the first authentication response from the authenticator is received through the transceiver module; the first authentication response is used to indicate the first authentication response The authentication result of a device.
一种可能的实现方式,所述处理模块,还用于在所述第一设备的认证结果为认证失败时,通过所述收发模块向所述认证方发送第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;In a possible implementation manner, the processing module is further configured to send a second authentication request message to the authenticating party through the transceiver module when the authentication result of the first device is an authentication failure; the second authentication request message The authentication request message includes: the encrypted firmware password value of the i-th layer to be authenticated; the encrypted firmware password value is determined according to the firmware password value of the i-th layer to be authenticated; the second authentication request message is used for The i-th layer to be authenticated of the first device requests authentication;
所述收发模块,还用于接收来自所述认证方的第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。The transceiver module is further configured to receive a second authentication response from the authenticating party; the second authentication response is used to indicate the authentication result of the i-th layer to be authenticated.
一种可能的实现方式,所述收发模块向所述认证方发送第二认证请求消息之前,还用于接收来自所述认证方的第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。A possible implementation manner, before the transceiver module sends the second authentication request message to the authenticating party, is further configured to receive a third authentication request message from the authenticating party; the third authentication request message is used to request Obtain the encrypted firmware password value of the i-th layer to be authenticated.
一种可能的实现方式,所述第一认证请求消息还包括:所述n个待认证层的n个加密固件密码值;所述n个待认证层中的第i个待认证层的加密固件密码值为根据所述第i个待认证层的固件密码值进行加密后确定的;所述第一认证响应还用于指示所述n个待认证层中认证失败的待认证层。A possible implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the encrypted firmware of the i-th layer to be authenticated in the n layers to be authenticated The password value is determined after encryption according to the firmware password value of the i-th layer to be authenticated; the first authentication response is further used to indicate a layer to be authenticated that fails to be authenticated among the n layers to be authenticated.
一种可能的实现方式,所述收发模块,还用于接收来自所述认证方的第一随机数;A possible implementation manner, the transceiver module is further configured to receive the first random number from the authenticating party;
所述处理模块,还用于根据所述第一随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;或者,根据所述第一随机数、第二随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;所述第二随机数为所述第一设备确定的;所述目标认证凭证为根据加密后的所述初始认证凭证确定的。The processing module is further configured to generate the encrypted initial authentication credential according to the first random number and the initial authentication credential; or, according to the first random number, the second random number and the initial authentication credential; The authentication credential is to generate the encrypted initial authentication credential; the second random number is determined by the first device; the target authentication credential is determined according to the encrypted initial authentication credential.
一种可能的实现方式,所述处理模块,用于根据所述第一随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值;或者,所述处理模块,用于根据所述第一随机数、所述第二随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值。A possible implementation, the processing module is configured to generate the encrypted firmware password value of the i-th layer to be authenticated according to the first random number and the firmware password value of the i-th layer to be authenticated; Alternatively, the processing module is configured to generate the encrypted firmware password of the i-th layer to be authenticated according to the first random number, the second random number and the firmware password value of the i-th layer to be authenticated value.
一种可能的实现方式,所述第一认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败;所述第二认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败、所述第i个待认证层认证失败。A possible implementation manner, the first authentication response includes at least one of the following: the initial verification value authentication fails, the target authentication credential authentication fails; the second authentication response includes at least one of the following: The authentication of the initial check value fails, the authentication of the target authentication credential fails, and the authentication of the i-th layer to be authenticated fails.
关于第五方面或第五方面的各种可能的实施方式所带来的技术效果,可参考对于第二方面或第二方面的各种可能的实施方式的技术效果的介绍。Regarding the technical effects brought by the fifth aspect or various possible implementations of the fifth aspect, reference may be made to the introduction to the technical effects of the second aspect or various possible implementations of the second aspect.
第六方面,提供一种通信装置,例如该通信装置为如前所述的第二通信装置。所述第二通信装置用于执行上述第三方面或第三方面的任一可能的实现方式中的方法。具体地,所述第二通信装置可以包括用于执行第三方面或第三方面的任一可能的实现方式中的方法的模块,例如包括处理模块和收发模块。其中,收发模块可以是指一个功能模块,该功能模块既能完成接收信息的功能也能完成发送信息的功能。或者,收发模块可以是发送模块和接收模块的统称,发送模块用于完成发送信息的功能,接收模块用于完成接收信息的功能。示例性地,所述第二通信装置为认证方的服务器。其中,In a sixth aspect, a communication device is provided, for example, the communication device is the aforementioned second communication device. The second communication apparatus is configured to execute the method in the third aspect or any possible implementation manner of the third aspect. Specifically, the second communication apparatus may include a module for executing the method in the third aspect or any possible implementation manner of the third aspect, for example, including a processing module and a transceiver module. The transceiver module may refer to a functional module, and the functional module can perform both the function of receiving information and the function of transmitting information. Alternatively, the transceiver module may be a general term for a sending module and a receiving module, the sending module is used to complete the function of sending information, and the receiving module is used to complete the function of receiving information. Exemplarily, the second communication device is a server of the authenticating party. in,
所述收发模块,用于接收来自第一设备的第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;The transceiver module is configured to receive a first authentication request message from a first device; the first authentication request message includes: the initial check value and a target authentication credential; the target authentication credential is based on the initial authentication The credential is determined; the first authentication request message is used to request authentication for the first device;
所述处理模块,用于对所述第一认证请求消息进行认证;根据所述第一认证请求消息的认证结果,通过所述收发模块向所述第一设备发送第一认证响应;所述第一认证响应用于指示所述第一设备认证结果。The processing module is configured to authenticate the first authentication request message; send a first authentication response to the first device through the transceiver module according to the authentication result of the first authentication request message; the first authentication response An authentication response is used to indicate the authentication result of the first device.
一种可能的实现方式,所述初始校验值为时间戳,则所述处理模块,用于根据当前时间,对所述初始校验值进行认证;或者,A possible implementation manner, the initial check value is a timestamp, and the processing module is configured to authenticate the initial check value according to the current time; or,
所述第一校验值为计数器,则所述处理模块,用于将所述初始校验值与第二校验值比较,对所述初始校验值进行认证;所述第二校验值为所述第一设备上一次发送的初始校验值;If the first check value is a counter, the processing module is configured to compare the initial check value with the second check value, and authenticate the initial check value; the second check value is the initial check value sent last time by the first device;
所述第一校验值为随机数,则所述处理模块,用于根据所述初始校验值与所述第一设备发送的所有历史初始校验值比较,对所述第一校验值进行认证。If the first check value is a random number, the processing module is configured to compare the first check value with all historical initial check values sent by the first device according to the initial check value. Authenticate.
一种可能的实现方式,所述处理模块,用于根据所述第一设备的n个待认证层的n个标准哈希值及所述第一校验值,生成n个标准固件密码值;根据所述n个标准固件密码值,生成标准校验秘钥;将所述标准校验秘钥与所述目标认证凭证比较,确定所述目标认证凭证是否认证成功。A possible implementation, the processing module is configured to generate n standard firmware password values according to n standard hash values of the n layers to be authenticated and the first check value of the first device; Generate a standard verification key according to the n standard firmware password values; compare the standard verification key with the target authentication credential to determine whether the target authentication credential is successfully authenticated.
一种可能的实现方式,所述处理模块,用于针对n个待认证层中的第i个待认证层,执行:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;i为大于等于1且小于或等于n-1的正整数;根据所述第i+1个待认证层的标准哈希值和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;所述第1个待认证层的固件密码值为根据所述第1个待认证层的标准哈希值确定的。A possible implementation manner, the processing module is configured to, for the i-th layer to be authenticated among the n layers to be authenticated, perform: according to the first check value of the i-th layer to be authenticated, determine the The first check value of the i+1th layer to be authenticated; the first check value of the first layer to be authenticated is determined according to the initial check value; i is greater than or equal to 1 and less than or equal to n A positive integer of -1; according to the standard hash value of the i+1th layer to be authenticated and the first check value of the ith layer to be authenticated, determine the value of the i+1th layer to be authenticated Firmware password value; the firmware password value of the first layer to be authenticated is determined according to the standard hash value of the first layer to be authenticated.
一种可能的实现方式,所述处理模块,用于在所述第一设备认证结果为所述目标认证凭证的认证结果为失败,则通过所述收发模块接收来自所述第一设备的第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;对所述第i个待认证层的加密固件密码值进行认证,根据所述第i个待认证层的加密固件密码值的认证结果,通过所述收发模块向所述第一设备发送第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。A possible implementation manner, the processing module is configured to receive, through the transceiver module, a second message from the first device when the authentication result of the first device is that the target authentication credential fails. An authentication request message; the second authentication request message includes: the encrypted firmware password value of the i-th layer to be authenticated; the encrypted firmware password value is determined according to the firmware password value of the i-th layer to be authenticated; the The second authentication request message is used to request authentication for the i-th layer to be authenticated of the first device; to authenticate the encrypted firmware password value of the i-th layer to be authenticated, according to the i-th layer to be authenticated The authentication result of the encrypted firmware password value of the layer is sent to the first device through the transceiver module, and the second authentication response is used to indicate the authentication result of the i-th layer to be authenticated.
一种可能的实现方式,所述收发模块,还用于向所述第一设备发送第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。A possible implementation, the transceiver module is further configured to send a third authentication request message to the first device; the third authentication request message is used to request to obtain the encryption firmware of the i-th layer to be authenticated password value.
一种可能的实现方式,所述处理模块,还用于将所述n个标准固件密码值中的第i个标准固件密码值与所述第i个待认证层的加密固件密码值进行比较,确定所述第i个待认证层是否认证成功。In a possible implementation, the processing module is further configured to compare the i-th standard firmware password value in the n standard firmware password values with the encrypted firmware password value of the i-th layer to be authenticated, Determine whether the i-th layer to be authenticated is authenticated successfully.
一种可能的实现方式,所述第一认证请求消息还包括:n个待认证层的n个加密固件密码值;所述处理模块,还用于对所述n个待认证层的n个加密固件密码值分别进行认证,以确定认证失败的待认证层;所述第一认证响应还用于指示认证失败的待认证层。A possible implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the processing module is further configured to encrypt the n layers of the n layers to be authenticated The firmware password value is authenticated respectively to determine the to-be-authenticated layer whose authentication has failed; the first authentication response is also used to indicate the to-be-authenticated layer that has failed authentication.
一种可能的实现方式,所述处理模块,还用于通过所述收发模块向所述第一设备发送第一随机数;其中,所述目标认证凭证为根据所述第一随机数和所述初始认证凭证生成的;或者,所述目标认证凭证为根据所述第一随机数、第二随机数和所述初始认证凭证生成的;所述第二随机数为所述第一设备确定的。A possible implementation manner, the processing module is further configured to send a first random number to the first device through the transceiver module; wherein, the target authentication credential is based on the first random number and the The target authentication credential is generated according to the first random number, the second random number and the initial authentication credential; the second random number is determined by the first device.
一种可能的实现方式,所述第i个待认证层的加密固件密码值为根据所述第一随机数和所述第i个待认证层的固件密码值生成的;或者,所述第i个待认证层的加密固件密码值为根据所述第一随机数、第二随机数和所述第i个待认证层的固件密码值生成的。A possible implementation manner, the encrypted firmware password value of the i-th layer to be authenticated is generated according to the first random number and the firmware password value of the i-th layer to be authenticated; The encrypted firmware password values of the layers to be authenticated are generated according to the first random number, the second random number, and the firmware password value of the i-th layer to be authenticated.
关于第六方面或第六方面的各种可能的实施方式所带来的技术效果,可参考对于第三方面或第三方面的各种可能的实施方式的技术效果的介绍。Regarding the technical effects brought by the sixth aspect or various possible implementations of the sixth aspect, reference may be made to the introduction to the technical effects of the third aspect or various possible implementations of the third aspect.
第七方面,提供一种通信装置,该通信装置例如为如前所述的第一通信装置。该第一通信装置包括处理器和收发器,处理器和收发器用于实现上述第一方面或第二方面的各种可能的设计所描述的方法。示例性地,所述第一通信装置为设置在通信设备中的芯片。其中,收发器例如通过通信设备中的天线、馈线和编解码器等实现,或者,如果所述第一通信装置为设置在通信设备中的芯片,那么收发器例如为芯片中的通信接口,该通信接口与通信设备中的射频收发组件连接,以通过射频收发组件实现信息的收发。其中,收发器可以是指一个功能模块,该功能模块既能完成接收信息的功能也能完成发送信息的功能。或者,收发器可以是发送器和接收器的统称,发送器用于完成发送信息的功能,接收器用于完成接收信息的功能。示例性的,所述通信设备为物联网设备。In a seventh aspect, a communication device is provided, and the communication device is, for example, the aforementioned first communication device. The first communication device includes a processor and a transceiver, and the processor and the transceiver are used to implement the methods described in various possible designs of the first aspect or the second aspect. Exemplarily, the first communication device is a chip provided in a communication device. Wherein, the transceiver is implemented by, for example, an antenna, a feeder, a codec, etc. in the communication device, or, if the first communication device is a chip provided in the communication device, the transceiver is, for example, a communication interface in the chip, the The communication interface is connected with the radio frequency transceiver component in the communication device, so as to realize the sending and receiving of information through the radio frequency transceiver component. The transceiver may refer to a functional module, and the functional module can perform both the function of receiving information and the function of transmitting information. Alternatively, the transceiver may be a collective term for a transmitter and a receiver, the transmitter is used to complete the function of sending information, and the receiver is used to complete the function of receiving information. Exemplarily, the communication device is an Internet of Things device.
第八方面,提供一种通信装置,该通信装置例如为如前所述的第二通信装置。该第二通信装置包括处理器和收发器,处理器和收发器用于实现上述第三方面或第三方面的各种可能的设计所描述的方法。示例性地,所述第二通信装置为设置在通信设备中的芯片。其中,收发器例如通过通信设备中的天线、馈线和编解码器等实现,或者,如果所述第二通信装置为设置在通信设备中的芯片,那么收发器例如为芯片中的通信接口,该通信接口与通信设备中的射频收发组件连接,以通过射频收发组件实现信息的收发。其中,收发器可以是指一个功能模块,该功能模块既能完成接收信息的功能也能完成发送信息的功能。或者,收发器可以是发送器和接收器的统称,发送器用于完成发送信息的功能,接收器用于完成接收信息的功能。示例性的,所述通信设备为认证方的服务器。In an eighth aspect, a communication device is provided, and the communication device is, for example, the aforementioned second communication device. The second communication device includes a processor and a transceiver, and the processor and the transceiver are used to implement the method described in the third aspect or various possible designs of the third aspect. Exemplarily, the second communication device is a chip provided in a communication device. Wherein, the transceiver is implemented by, for example, an antenna, a feeder, a codec, etc. in the communication device, or, if the second communication device is a chip provided in the communication device, the transceiver is, for example, a communication interface in the chip, the The communication interface is connected with the radio frequency transceiver component in the communication device, so as to realize the sending and receiving of information through the radio frequency transceiver component. The transceiver may refer to a functional module, and the functional module can perform both the function of receiving information and the function of transmitting information. Alternatively, the transceiver may be a collective term for a transmitter and a receiver, the transmitter is used to complete the function of sending information, and the receiver is used to complete the function of receiving information. Exemplarily, the communication device is an authenticator's server.
第九方面,提供一种通信装置。该通信装置可以为上述方法设计中的第一通信装置。示例性地,所述第一通信装置为设置在通信设备中的芯片。示例性地,通信设备为车载装置。该第一通信装置可以包括:通信接口,用于与其他装置或设备通信;以及处理器,处理器与通信接口耦合。该通信接口可以是该通信装置中的收发器,例如通过所述通信装置中的天线、馈线和编解码器等实现,或者,如果该通信装置为设置在通信设备中的芯片,则通信接口可以是该芯片的输入/输出接口,例如输入/输出管脚等。In a ninth aspect, a communication device is provided. The communication device may be the first communication device in the above method design. Exemplarily, the first communication device is a chip provided in a communication device. Exemplarily, the communication device is an in-vehicle device. The first communication apparatus may include: a communication interface for communicating with other apparatuses or devices; and a processor coupled to the communication interface. The communication interface may be a transceiver in the communication device, for example, implemented by an antenna, a feeder, a codec, etc. in the communication device, or, if the communication device is a chip provided in a communication device, the communication interface may be is the input/output interface of the chip, such as input/output pins, etc.
可选的,第一通信装置还可以包括存储器,用于存储计算机可执行程序代码。存储器所存储的程序代码包括指令。当处理器执行所述指令时,使第一通信装置执行上述第一方面或第二方面的任意一种可能的实施方式中的方法。或者,第一通信装置也可以不包括存储器,例如,处理器可以执行外部的存储器所存储的指令,使第一通信装置执行上述第一方面或第二方面的任意一种可能的实施方式中的方法。Optionally, the first communication apparatus may further include a memory for storing computer-executable program codes. The program code stored in the memory includes instructions. When the processor executes the instructions, the first communication device is caused to execute the method in any one possible implementation manner of the first aspect or the second aspect. Alternatively, the first communication device may also not include a memory. For example, the processor may execute instructions stored in an external memory, so that the first communication device may execute any one of the possible implementations of the first aspect or the second aspect. method.
第十方面,提供一种通信装置。该通信装置可以为上述方法设计中的第二通信装置。示例性地,所述第二通信装置为设置在通信设备中的芯片。示例性地,通信设备为车载装置。该第二通信装置可以包括:通信接口,用于与其他装置或设备通信;以及处理器,处理器与通信接口耦合。该通信接口可以是该通信装置中的收发器,例如通过所述通信装置中的天线、馈线和编解码器等实现,或者,如果该通信装置为设置在通信设备中的芯片,则通信接口可以是该芯片的输入/输出接口,例如输入/输出管脚等。A tenth aspect provides a communication device. The communication device may be the second communication device in the above method design. Exemplarily, the second communication device is a chip provided in a communication device. Exemplarily, the communication device is an in-vehicle device. The second communication apparatus may include: a communication interface for communicating with other apparatuses or devices; and a processor coupled to the communication interface. The communication interface may be a transceiver in the communication device, for example, implemented by an antenna, a feeder, a codec, etc. in the communication device, or, if the communication device is a chip provided in a communication device, the communication interface may be is the input/output interface of the chip, such as input/output pins, etc.
可选的,第二通信装置还可以包括存储器,用于存储计算机可执行程序代码。存储器所存储的程序代码包括指令。当处理器执行所述指令时,使第二通信装置执行上述第三方面或第三方面的任意一种可能的实施方式中的方法。或者,第二通信装置也可以不包括存储器,例如,处理器可以执行外部的存储器所存储的指令,使第二通信装置执行上述第三方面或第三方面的任意一种可能的实施方式中的方法。Optionally, the second communication apparatus may further include a memory for storing computer-executable program codes. The program code stored in the memory includes instructions. When the processor executes the instructions, the second communication apparatus is caused to execute the method in the third aspect or any possible implementation manner of the third aspect. Alternatively, the second communication device may not include a memory. For example, the processor may execute instructions stored in an external memory, so that the second communication device may execute the third aspect or any of the possible implementations of the third aspect. method.
第十一方面,提供一种通信系统,该通信系统包括第四方面所述的通信装置、第五方面所述的通信装置、或第七方面、第八方面所述的通信装置,以及包括第六方面所述的通信装置、或第九方面所述的通信装置。In an eleventh aspect, a communication system is provided, the communication system comprising the communication device according to the fourth aspect, the communication device according to the fifth aspect, or the communication device according to the seventh aspect and the eighth aspect, The communication device according to the sixth aspect, or the communication device according to the ninth aspect.
第十二方面,提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第一方面或第一方面的任意一种可能的实施方式中所述的方法。A twelfth aspect provides a computer storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer is made to execute the first aspect or the first aspect. The method described in any of the possible embodiments.
第十三方面,提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第二方面或第一方面的任意一种可能的实施方式中所述的方法。A thirteenth aspect provides a computer storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer is made to execute the second aspect or the first aspect. The method described in any of the possible embodiments.
第十四方面,提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第三方面或第三方面的任意一种可能的实施方式中所述的方法。A fourteenth aspect provides a computer storage medium, where the computer readable storage medium is used to store a computer program, when the computer program runs on a computer, the computer is made to execute the third aspect or the third aspect. The method described in any of the possible embodiments.
第十五方面,提供一种包含指令的计算机程序产品,所述计算机程序产品用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第一方面或第一方面的任意一种可能的实施方式中所述的方法。A fifteenth aspect provides a computer program product comprising instructions, the computer program product is used to store a computer program, when the computer program is run on a computer, the computer causes the computer to execute the above-mentioned first aspect or the first aspect The method described in any one of the possible embodiments of .
第十六方面,提供一种包含指令的计算机程序产品,所述计算机程序产品用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第二方面或第二方面的任意一种可能的实施方式中所述的方法。A sixteenth aspect provides a computer program product comprising instructions, the computer program product is used to store a computer program, when the computer program is run on a computer, the computer causes the computer to execute the above-mentioned second aspect or the second aspect The method described in any one of the possible embodiments of .
第十七方面,提供一种包含指令的计算机程序产品,所述计算机程序产品用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第三方面或第三方面的任意一种可能的实施方式中所述的方法。A seventeenth aspect provides a computer program product comprising instructions, the computer program product is used to store a computer program, and when the computer program is run on a computer, the computer causes the computer to execute the above-mentioned third aspect or the third aspect The method described in any one of the possible embodiments of .
附图说明Description of drawings
图1a-图1b为本申请实施例所应用的一种网络架构的示意图;FIG. 1a-FIG. 1b are schematic diagrams of a network architecture applied by an embodiment of the present application;
图2为本申请实施例提供的一种设备认证方法的流程图;FIG. 2 is a flowchart of a device authentication method provided by an embodiment of the present application;
图3a-图3b为本申请实施例提供的一种设备认证方法的流程图;3a-3b are flowcharts of a device authentication method provided by an embodiment of the present application;
图4a-图4b为本申请实施例提供的一种认证凭证的生成方法的示意图;4a-4b are schematic diagrams of a method for generating an authentication credential provided by an embodiment of the present application;
图5为本申请实施例提供的一种设备认证方法的流程图;FIG. 5 is a flowchart of a device authentication method provided by an embodiment of the present application;
图6为本申请实施例提供的一种设备认证方法的流程图;6 is a flowchart of a device authentication method provided by an embodiment of the present application;
图7为本申请实施例提供的一种通信装置的结构示意图;FIG. 7 is a schematic structural diagram of a communication device according to an embodiment of the present application;
图8为本申请实施例提供的一种通信装置的结构示意图;FIG. 8 is a schematic structural diagram of a communication device according to an embodiment of the present application;
图9为本申请实施例提供的一种通信装置的结构示意图;FIG. 9 is a schematic structural diagram of a communication device according to an embodiment of the present application;
图10为本申请实施例提供的一种通信装置的结构示意图。FIG. 10 is a schematic structural diagram of a communication device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
1)物联网设备1) IoT devices
本申请主要涉及低功耗的物联网设备。物联网设备可以是性能与资源受限的低功耗终端设备。例如,包括向用户提供语音和/或数据连通性的设备,例如可以包括具有无线连接功能的手持式设备、或连接到无线调制解调器的处理设备。还包括受限设备,例如功耗较低的设备,或存储能力有限的设备,或计算能力有限的设备等。例如包括条码、射频识别(radio frequency identification,RFID)、传感器、全球定位系统(global positioningsystem,GPS)、激光扫描器等信息传感设备。该终端设备可以经无线接入网(radio accessnetwork,RAn)与核心网进行通信,与RAn交换语音和/或数据。该终端设备可以包括用户设备(userequipment,UE)、无线终端设备、移动终端设备、设备到设备通信(device-to-device,D2D)终端设备、V2X终端设备、机器到机器/机器类通信(machine-to-machine/machine-typecommunications,M2M/MTC)终端设备、物联网(internet of things,IoT)终端设备、订户单元(subscriber unit)、订户站(subscriber station),移动站(mobilestation)、远程站(remotestation)、接入点(access point,AP)、远程终端(remoteterminal)、接入终端(access terminal)、用户终端(user terminal)、用户代理(useragent)、或用户装备(user device)等。例如,可以包括移动电话(或称为“蜂窝”电话),具有移动终端设备的计算机,便携式、袖珍式、手持式、计算机内置的移动装置等。例如,个人通信业务(personal communication service,PCS)电话、无绳电话、会话发起协议(sessioninitiation protocol,SIP)话机、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、等设备。作为示例而非限定,在本申请实施例中,低功耗的物联网设备还可以包括可穿戴设备。可穿戴设备也可以称为穿戴式智能设备或智能穿戴式设备等,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能头盔、智能首饰等。This application primarily relates to low-power IoT devices. IoT devices can be low-power end devices with limited performance and resources. For example, devices that provide voice and/or data connectivity to a user may include, for example, handheld devices with wireless connectivity, or processing devices connected to a wireless modem. Also includes constrained devices, such as devices with lower power consumption, or devices with limited storage capacity, or devices with limited computing power, etc. For example, information sensing devices such as barcodes, radio frequency identification (radio frequency identification, RFID), sensors, global positioning system (global positioning system, GPS), and laser scanners are included. The terminal equipment can communicate with the core network via a radio access network (RAn), and exchange voice and/or data with the RAn. The terminal equipment may include user equipment (UE), wireless terminal equipment, mobile terminal equipment, device-to-device (D2D) terminal equipment, V2X terminal equipment, machine-to-machine/machine-type communication (machine-to-machine communication) -to-machine/machine-typecommunications, M2M/MTC) terminal equipment, Internet of things (Internet of things, IoT) terminal equipment, subscriber unit (subscriber unit), subscriber station (subscriber station), mobile station (mobilestation), remote station (remotestation), access point (access point, AP), remote terminal (remote terminal), access terminal (access terminal), user terminal (user terminal), user agent (useragent), or user equipment (user device) and the like. For example, these may include mobile telephones (or "cellular" telephones), computers with mobile terminal equipment, portable, pocket-sized, hand-held, computer-embedded mobile devices, and the like. For example, personal communication service (PCS) phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs) ), and other equipment. As an example and not a limitation, in this embodiment of the present application, the IoT device with low power consumption may also include a wearable device. Wearable devices can also be called wearable smart devices or smart wearable devices, etc. It is a general term for the application of wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes. Wait. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction. In a broad sense, wearable smart devices include full-featured, large-scale, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, which needs to cooperate with other devices such as smart phones. Use, such as all kinds of smart bracelets, smart helmets, smart jewelry, etc. for physical sign monitoring.
2)物联网设备的认证方式2) Authentication method of IoT devices
物联网设备的认证方式可以依据设备特征不同,依赖于三种不同类型的硬件模块实现。例如,可信平台模块(trusted platform module,TPM)、可信执行环境(trustedexecutionenvironment,TEE)模块、设备标识符复合引擎(device identifiercomposition engine,DICE)模块。TPM模块、TEE模块、DICE模块所能提供的功能依次减少、复杂性依次降低,其功耗依次降低。针对供电充足的高性能设备而言,物联网设备的认证通常依赖于TPM模块;针对能耗适中的移动设备而言,物联网设备的认证通常依赖于TEE模块;针对低功耗要求严苛的设备而言,物联网设备的认证依赖于DICE模块。如图1a所示,描述了物联网设备的认证的一种流程示意图。当认证方需要验证物联网设备的固件安全性时,设备同时向验证主体发送其固件版本(例如,firmware version:V2.1)以及其固件哈希值(例如,firmwarehash:H323CD87LKUE7BGH…)。通过识别固件版本,验证主体可以判断物联网设备是否存在已被公开的安全漏洞;通过校验固件完整性,验证主体可以判断物联网设备的固件代码是否遭到非授权的篡改。The authentication method of IoT devices can be implemented by three different types of hardware modules according to different device characteristics. For example, a trusted platform module (TPM), a trusted execution environment (TEE) module, and a device identifier composition engine (DICE) module. The functions that the TPM module, the TEE module, and the DICE module can provide are successively reduced, the complexity is successively reduced, and their power consumption is successively reduced. For high-performance devices with sufficient power supply, the certification of IoT devices usually relies on TPM modules; for mobile devices with moderate energy consumption, the certification of IoT devices usually relies on TEE modules; for devices with strict low power consumption requirements In terms of devices, the authentication of IoT devices relies on the DICE module. As shown in Fig. 1a, a schematic flow chart of authentication of IoT devices is described. When the authenticator needs to verify the firmware security of the IoT device, the device simultaneously sends its firmware version (for example, firmware version: V2.1) and its firmware hash value (for example, firmwarehash: H323CD87LKUE7BGH…) to the verification subject. By identifying the firmware version, the verification subject can determine whether the IoT device has disclosed security vulnerabilities; by verifying the integrity of the firmware, the verification subject can determine whether the firmware code of the IoT device has been unauthorizedly tampered with.
3)本申请实施例中的术语“系统”和“网络”可被互换使用。“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。3) The terms "system" and "network" in the embodiments of this application may be used interchangeably. "At least one" means one or more, and "plurality" means two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean: the existence of A alone, the existence of A and B at the same time, the existence of B alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are an "or" relationship. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple .
以及,除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。例如,第一消息和第二消息,只是为了区分不同的消息,而并不是表示这两种消息的优先级、发送顺序或者重要程度等的不同。And, unless stated to the contrary, the ordinal numbers such as “first” and “second” mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, sequence, priority or priority of multiple objects. Importance. For example, the first message and the second message are only for distinguishing different messages, but do not indicate the difference in priority, sending order, or importance of the two kinds of messages.
如上介绍了本申请实施例涉及的一些概念,下面介绍本申请实施例的技术特征。Some concepts involved in the embodiments of the present application are described above, and the technical features of the embodiments of the present application are described below.
图1b为本申请实施例提供的一种物联网设备的认证系统的架构示意图。如图1b所示,物联网设备的认证系统100可包括物联网设备10、认证方20、接入网设备30,其中,认证方20可以是认证服务器、安全锚点等。FIG. 1b is a schematic structural diagram of an authentication system for an Internet of Things device provided by an embodiment of the present application. As shown in FIG. 1b, the
例如,以园区网络中用于管理物联网设备的场景为例。认证方可以是园区内为物联网设备提供数据分享的云平台的服务器,在物联网设备每一次与服务器建立连接前,服务器均可向物联网设备发起可信远程证明请求。从而,通过服务器对物联网设备(例如,接入的功耗受限设备)进行认证。对于通过认证的物联网设备,该物联网设备发起的通信连接将被服务器允许;对于未能通过认证的物联网设备,该物联网设备发起的通信将被服务器拒绝,以提高物联网设备的安全性。For example, consider a scenario in a campus network for managing IoT devices. The authenticator can be the server of the cloud platform that provides data sharing for IoT devices in the park. Before each IoT device establishes a connection with the server, the server can initiate a trusted remote certification request to the IoT device. Thus, IoT devices (eg, connected power-constrained devices) are authenticated by the server. For IoT devices that pass the authentication, the communication connection initiated by the IoT device will be allowed by the server; for IoT devices that fail to pass the authentication, the communication initiated by the IoT device will be rejected by the server to improve the security of IoT devices sex.
再比如,物联网设备还可以是在接入网络的过程中,请求进行网络认证。图1b中,物联网设备可通过为物联网设备提供网络接入服务功能的基站(nodeB)、基站控制器(Radio network Controller,RnC)或接入网关等接入网网元与认证节点进行交互认证。网络管理方对物联网设备的身份和固件完整性进行度量,并依据认证结果对该物联网设备设置网络访问权限,以提高物联网设备的安全性。For another example, the IoT device may also request network authentication during the process of accessing the network. In Figure 1b, the IoT device can interact with the authentication node through access network elements such as a base station (nodeB), a base station controller (Radio network Controller, RnC), or an access gateway that provide network access services for the IoT device Certification. The network management party measures the identity and firmware integrity of the IoT device, and sets network access rights for the IoT device according to the authentication result, so as to improve the security of the IoT device.
其中,物联网设备可以是具有低功耗要求的用户设备,包括手机、平板电脑、笔记本电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等)等用户终端,也可以包括IoT设备,还可以包括其他通信设备。The IoT device may be user equipment with low power consumption requirements, including mobile phones, tablet computers, notebook computers, mobile Internet devices (Mobile Internet Device, MID), wearable devices (such as smart watches, smart bracelets, pedometers, etc.) User terminals such as devices, etc.), may also include IoT devices, and may also include other communication devices.
认证方可以是为所有接入网络的用户设备提供网络认证服务的节点,可以是单独配置的认证节点,也可以配置在第三方系统中。认证方可以用于存储用于认证物联网设备的ID和物联网设备的加密算法等相关信息。The authenticator may be a node that provides network authentication services for all user equipment accessing the network, may be an authentication node configured independently, or may be configured in a third-party system. The authenticator can be used to store related information such as the ID used to authenticate the IoT device and the encryption algorithm of the IoT device.
本申请以下实施例中主要针对物联网设备和认证方之间的交互认证过程进行说明。物联网设备和认证方之间可支持的预共享秘钥(Pre-Share Key,PSK)协议进行PSK交互认证。图1b所示,物联网设备侧可以包括认证请求客户端,客户端是终端侧负责运行认证的实体,包含了与密钥存储实体的接口,接入网可以负责认证消息的中继,网络侧的认证服务器可以包括认证服务端,可以用于负责网络侧的认证。图2所示为现有技术中物联网设备和认证方之间进行PSK交互认证的实现流程图。参阅图2所示,包括:The following embodiments of the present application mainly describe the interactive authentication process between the IoT device and the authenticator. The Pre-Share Key (PSK) protocol that can be supported between the IoT device and the authenticator is used for PSK interactive authentication. As shown in Figure 1b, the IoT device side may include an authentication request client. The client is the entity responsible for running the authentication on the terminal side, including the interface with the key storage entity. The access network may be responsible for relaying the authentication message, and the network side The authentication server can include an authentication server, which can be used for authentication on the network side. FIG. 2 is a flow chart showing the implementation of PSK interactive authentication between an IoT device and an authenticating party in the prior art. See Figure 2, including:
步骤101:认证方向物联网设备发出第一条消息,该第一条消息包括一个随机数(RAND_S)和认证方的标识信息(ID_S)。Step 101 : the authenticator sends a first message to the IoT device, where the first message includes a random number (RAND_S) and identification information (ID_S) of the authenticator.
步骤102:物联网设备向认证方发送第二条消息,该第二条消息中包含认证方产生的随机数(RAND_S),以及物联网设备产生的随机数(RAND_P)和物联网设备的标识信息(ID_P)。Step 102: The IoT device sends a second message to the authenticator, and the second message includes the random number (RAND_S) generated by the authenticator, the random number (RAND_P) generated by the IoT device, and the identification information of the IoT device (ID_P).
步骤103:认证方发送第三条消息,该第三条消息包含了使用预共享密钥针对该第三条消息产生的一个消息认证码(Message Authentication Code,MAC),用于物联网设备的认证方,可表示为MAC_S。Step 103: The authenticating party sends a third message, where the third message includes a Message Authentication Code (MAC) generated for the third message using the pre-shared key, which is used for authentication of the IoT device square, which can be expressed as MAC_S.
步骤104:物联网设备接收到认证方发送的第三条消息后,物联网设备产生并发送第四条消息,该第四条消息中也包含一个使用预共享密钥产生的一个MAC,用于认证方认证物联网设备。Step 104: After the IoT device receives the third message sent by the authenticator, the IoT device generates and sends a fourth message, and the fourth message also includes a MAC generated by using a pre-shared key for The authenticating party authenticates the IoT device.
通过上述交互过程后,物联网设备与认证方使用交互的信息中包含的随机数及其预共享密钥,生成会话密钥供物联网设备和认证方在随后的通信中使用。After the above interaction process, the IoT device and the authenticator use the random number and its pre-shared key contained in the interactive information to generate a session key for the IoT device and the authenticator to use in subsequent communications.
PSK的生成方式可以有多种,下面以方式a和方式b举例说明。There are many ways to generate the PSK, and the following is an example of way a and way b.
方式a,如图3a所示,物联网设备和认证方之间可以基于非对称加密的方式生成预共享密钥,从而进行交互认证。Mode a, as shown in Figure 3a, can generate a pre-shared key based on asymmetric encryption between the IoT device and the authenticator, so as to perform mutual authentication.
当设备完成生产后,设备制造商可以为设备生成一对非对称公私钥对,并把私钥SK*和对应的公钥的证书烧录入设备的DICE模块中,其中设备的公钥证书由设备生产商的私钥签名,且DICE模块通过烧录等方式,确保存储在其中的SK*和对应的公钥证书的安全。设备的固件开发方(通常也是设备的制造商)将设备固件划分为n层,当设备启动时,n层固件将逐级启动。具体的层数的划分可以基于设备具体的固件形式,一种可能的实现方式,n层可以为2层,例如,包括底层(例如,(U)可扩展固件接口(extensible firmwareinterface,EFI)/基本输入输出系统(Basic Input Output System,BIOS)层)和系统层(例如,安卓层),n层还可以为3层,例如,包括:底层、系统层和应用层。还可以为包括安全层的4层结构,例如,包括:底层、系统层、安全层和应用层。上述仅为举例,在具体实施中可以有其他方式,在此不做限定。在下述描述中,n层固件包括第0层的固件至第n-1层的固件。在启动n层固件之前,先启动DICE层,用于读取私钥SK*,以确定下一层生成证书所需的参数。After the device is produced, the device manufacturer can generate a pair of asymmetric public and private keys for the device, and burn the private key SK* and the certificate of the corresponding public key into the DICE module of the device, where the public key certificate of the device is set by The device manufacturer's private key is signed, and the DICE module ensures the security of the SK* and the corresponding public key certificate stored in it through programming and other methods. The firmware developer of the device (usually the manufacturer of the device) divides the device firmware into n layers, and when the device starts up, the n layers of firmware will be started step by step. The specific number of layers can be divided based on the specific firmware form of the device. In a possible implementation, the n-layer can be 2 layers, for example, including the bottom layer (for example, (U) extensible firmware interface (EFI) / basic The input and output system (Basic Input Output System, BIOS) layer) and the system layer (for example, the Android layer), the n layer may also be three layers, for example, including: the bottom layer, the system layer and the application layer. It can also be a 4-layer structure including a security layer, for example, including: a bottom layer, a system layer, a security layer and an application layer. The above is only an example, and there may be other ways in specific implementation, which are not limited here. In the following description, the n-layer firmware includes the firmware of the 0th layer to the firmware of the n-1th layer. Before starting the n-layer firmware, the DICE layer is started first, which is used to read the private key SK* to determine the parameters required by the next layer to generate the certificate.
如图3a所示,具体可以包括以下步骤:As shown in Figure 3a, it may specifically include the following steps:
步骤201a:设备启动DICE层。Step 201a: The device starts the DICE layer.
当设备启动时,设备首先启动DICE层,DICE层首先生成一对公私钥对(PK0,SK0),同时计算第1个待认证固件层(第0层)的固件哈希值,该固件哈希值可以满足:H(L0)。其中,L0为第0层的固件代码,通过对第0层的固件代码进行哈希运算,可以确定第0层的固件哈希值。从而,DICE层可以将第0层的固件哈希值及固件版本,作为证书扩展选项记录在公钥PK0对应的X509证书中,生成DICE层的证书,且该证书通过DICE模块中的私钥SK*进行签名。When the device starts, the device first starts the DICE layer, the DICE layer first generates a pair of public and private key pairs (PK0, SK0), and at the same time calculates the firmware hash value of the first firmware layer to be authenticated (layer 0). The value can satisfy: H(L0). Wherein, L0 is the firmware code of the 0th layer, and the firmware hash value of the 0th layer can be determined by performing a hash operation on the firmware code of the 0th layer. Therefore, the DICE layer can record the firmware hash value and firmware version of the 0th layer as the certificate extension option in the X509 certificate corresponding to the public key PK0, and generate the certificate of the DICE layer, and the certificate passes the private key SK in the DICE module. * to sign.
DICE层将DICE层的证书和对应的私钥SK0传递给第0层后,DICE层将会关闭。需要说明的是,为确保秘钥SK*安全,在整个启动过程中,仅有DICE层在执行完任务后会将其自身关闭。After the DICE layer passes the certificate of the DICE layer and the corresponding private key SK0 to the 0th layer, the DICE layer will be closed. It should be noted that, in order to ensure the security of the secret key SK*, during the entire startup process, only the DICE layer will close itself after completing the task.
步骤202a:设备启动第i个待认证层。Step 202a: The device starts the i-th layer to be authenticated.
例如,DICE层之后连接的待认证层为第0层,此时,可以在关闭DICE层后,启动第0层待认证层。For example, the layer to be authenticated connected after the DICE layer is the 0th layer. In this case, after the DICE layer is turned off, the 0th layer to be authenticated can be started.
在第i层启动后,通过对第i层的固件代码进行哈希运算,可以确定第i层的固件哈希值H(Li)。将第i层的固件哈希值及固件版本,写入该证书中,并作为第i层证书的扩展选项,且该证书通过私钥SK(i-1)进行签名,从而生成第i层的证书。After the ith layer is started, the firmware hash value H(Li) of the ith layer can be determined by hashing the firmware code of the ith layer. Write the firmware hash value and firmware version of the i-th layer into the certificate as an extension option of the i-layer certificate, and the certificate is signed by the private key SK(i-1), thereby generating the layer-i certificate. Certificate.
重复上述过程,直至n层固件全部启动。Repeat the above process until the n-layer firmware is all started.
步骤203a:设备根据n个待认证层的证书生成初始认证凭证PSK。Step 203a: The device generates an initial authentication credential PSK according to the certificates of the n layers to be authenticated.
当n个待认证层全部启动完毕后,第n-1层将会得到第0层至第n-1层的证书,而证书通过签名的方式形成证书链。此时,第n-1层可以根据证书链生成认证凭证P,该认证凭证包括设备的固件版本号和证书链。When the n layers to be authenticated are all activated, the n-1th layer will obtain the certificates from the 0th to the n-1th layer, and the certificates form a certificate chain by means of signatures. At this time, the n-1th layer can generate an authentication credential P according to the certificate chain, where the authentication credential includes the firmware version number of the device and the certificate chain.
步骤204a:设备将初始认证凭证PSK发送给认证方,以对初始认证凭证PSK进行认证。Step 204a: The device sends the initial authentication credential PSK to the authenticator, so as to authenticate the initial authentication credential PSK.
在认证方对设备进行安全认证时,设备可以将初始认证凭证PSK通过安全信道传递给认证方。When the authenticator performs security authentication on the device, the device may transmit the initial authentication credential PSK to the authenticator through a secure channel.
步骤205a:认证方根据存储的设备生厂商私钥SK*自签名的根证书,对接收到的设备的初始认证凭证PSK进行认证。Step 205a: The authenticator authenticates the received initial authentication certificate PSK of the device according to the stored root certificate of the device manufacturer's private key SK* self-signed.
具体的,认证方根据设备生厂商私钥SK*自签名的根证书,将相应的公钥PK0作为验证的信任锚。通过根证书验证证书链的签名,从而确定所有证书签名未被篡改,通过验证证书的签名,以确定证书链的完整可信,即确定设备身份的合法。Specifically, the authenticator uses the corresponding public key PK0 as the trust anchor for verification according to the root certificate self-signed by the private key SK* of the device manufacturer. The root certificate is used to verify the signature of the certificate chain, so as to determine that all certificate signatures have not been tampered with.
其次,认证方从初始认证凭证PSK中的证书的扩展选项中提取出n层固件的版本号和度量哈希值。认证方通过将版本号与对应的度量哈希值与数据库中的每层的标准哈希值对比,确定每层的固件代码是否被篡改,若被篡改,则证书中的度量哈希值与数据库中的每层的标准哈希值不同。若未被篡改,则证书中的度量哈希值与数据库中的每层的标准哈希值相同,以此确定设备固件版本的真实性以及固件的完整性。Second, the authenticator extracts the version number and metric hash value of the n-layer firmware from the extended options of the certificate in the initial authentication credential PSK. The authenticator determines whether the firmware code of each layer has been tampered with by comparing the version number with the corresponding metric hash value and the standard hash value of each layer in the database. The standard hash value is different for each layer in . If not tampered with, the metric hash in the certificate is the same as the standard hash for each layer in the database to determine the authenticity of the device firmware version and the integrity of the firmware.
该方式中,由于采用了非对称加密的方式,引入的计算开销相比于对称计算而言开销增加100~100,000倍;另外,由于采用X.509证书,而X.509证书最小约为500字节;证书链的生成会使得传输和计算开销随固件层数增加而进一步增加,因此,能耗开销较高。In this method, due to the use of asymmetric encryption, the computational overhead introduced is 100 to 100,000 times higher than that of symmetric computing; in addition, due to the use of X.509 certificates, the minimum X.509 certificate is about 500 words. The generation of the certificate chain will further increase the transmission and calculation overhead with the number of firmware layers, so the energy consumption overhead is high.
方式b,如图3b所示,为降低能耗的开销,物联网设备和认证方之间可以基于对称加密的方式生成预共享密钥,从而进行交互认证。当设备完成生产后,设备制造商为设备生成唯一的设备ID和基于对称秘钥的UDS,并把UDS作为信任锚烧录入设备的DICE模块中。固件启动仍然为n层固件的逐级启动,n层固件包括第0层的固件至第n-1层的固件。在启动n层固件之前,先启动DICE层,用于读取对称密钥UDS,以确定下一层生成固件密码值所需的参数。具体可以包括以下步骤:Mode b, as shown in Figure 3b, in order to reduce the energy consumption overhead, a pre-shared key can be generated between the IoT device and the authenticator based on symmetric encryption, so as to perform mutual authentication. After the device is produced, the device manufacturer generates a unique device ID and a UDS based on the symmetric key for the device, and burns the UDS into the DICE module of the device as a trust anchor. The firmware startup is still the step-by-step startup of the n-layer firmware, and the n-layer firmware includes the firmware of the 0th layer to the firmware of the n-1th layer. Before starting the n-layer firmware, the DICE layer is started first, which is used to read the symmetric key UDS to determine the parameters required by the next layer to generate the firmware cryptographic value. Specifically, the following steps may be included:
步骤201b:设备启动DICE层。Step 201b: The device starts the DICE layer.
DICE模块首先计算第0层的固件哈希值H(L0);The DICE module first calculates the firmware hash value H(L 0 ) of the 0th layer;
其中,L0表示第0层的固件代码,通过对第0层的固件代码进行哈希运算,可以确定第0层的固件哈希值。Wherein, L 0 represents the firmware code of the 0th layer, and the firmware hash value of the 0th layer can be determined by performing a hash operation on the firmware code of the 0th layer.
通过第0层的固件哈希值和对称密钥UDS,确定第0层的固件密码值;Determine the firmware password value of layer 0 through the firmware hash value of layer 0 and the symmetric key UDS;
具体的,第0层的固件密码值可以满足:Specifically, the firmware password value of layer 0 can satisfy:
Secret0=HMAC(UDS,H(L0))Secret 0 =HMAC(UDS,H(L 0 ))
其中,HMAC为一种加密函数。Among them, HMAC is an encryption function.
DICE层将Secret0传递给第0层后,DICE层将会关闭。在整个启动过程中,仅有DICE层在执行完任务后会将其自身关闭以确保秘钥UDS绝对安全。After the DICE layer passes Secret 0 to layer 0, the DICE layer will be closed. During the entire startup process, only the DICE layer will shut itself down after completing the task to ensure that the key UDS is absolutely safe.
步骤202b:设备启动第i个待认证层。其中,i为正整数。Step 202b: The device starts the i-th layer to be authenticated. where i is a positive integer.
在启动第i个待认证层的过程中,计算第i+1层的固件哈希值。In the process of starting the i-th layer to be authenticated, the firmware hash value of the i+1-th layer is calculated.
其中,Li+1表示第i+1层的固件代码,通过对第i+1层的固件代码进行哈希,可以获得第i层的固件哈希值H(Li+1)。Wherein, L i+1 represents the firmware code of the i+1 layer, and by hashing the firmware code of the i+1 layer, the firmware hash value H(L i+1 ) of the i layer can be obtained.
在启动第i个待认证层的过程中,计算第i+1层的固件密码值,其中,第i+1层的固件密码值可以通过第i层的固件密码值和第i+1层的固件哈希值通过HMAC加密确定的。例如,第i+1层的固件密码值可以满足:In the process of starting the i-th layer to be authenticated, the firmware password value of the i+1-th layer is calculated, wherein the firmware password value of the i+1-th layer can be determined by the firmware password value of the i-th layer and the The firmware hash is determined by HMAC encryption. For example, the firmware password value for layer i+1 can satisfy:
Secret i+1=HMAC(Secreti,H(L i+1)),Secret i+1 =HMAC(Secret i ,H(L i+1 )),
可以看出,下一层的固件密码值与上一层的固件密码值有关,因此,各层之间的固件密码值之间具有关联关系,即只要有一层的固件哈希值与标准哈希值不匹配,则会导致固件密码值与标准固件密码值不同,但是无法确定是哪一层的固件哈希值不同导致固件密码值出现异常。It can be seen that the firmware password value of the next layer is related to the firmware password value of the previous layer. Therefore, the firmware password values of each layer have an association relationship, that is, as long as there is a layer of firmware hash value and standard hash value If the values do not match, the firmware password value will be different from the standard firmware password value, but it is impossible to determine which layer has a different firmware hash value that causes the firmware password value to be abnormal.
重复上述步骤202b启动下一层待认证层,并计算下一层所需的固件密码值,直至n层固件全部启动。Repeat the above step 202b to start the next layer to be authenticated, and calculate the firmware password value required by the next layer until all the n layers of firmware are started.
步骤203b:设备根据n个待认证层的证书生成初始认证凭证PSK。Step 203b: The device generates an initial authentication credential PSK according to the certificates of the n layers to be authenticated.
当启动完毕后,第n-1层通过第n-1层生成的固件密码值进行加密,生成初始认证凭证PSK。After the startup is completed, the n-1th layer encrypts the firmware password value generated by the n-1th layer to generate the initial authentication certificate PSK.
加密的方式可以采用密钥导出函数(key derivation function,KDF)。即初始认证凭证PSK可以满足:The encryption method can use a key derivation function (key derivation function, KDF). That is, the initial authentication credential PSK can satisfy:
初始认证凭证PSK=KDF(Secretn-1)。The initial authentication credential PSK=KDF(Secret n-1 ).
从而,第n-1层可以根据初始认证凭证PSK,生成认证凭证。认证凭证中可以包括:设备ID,设备固件版本号,初始认证凭证PSK等。Thus, the n-1th layer can generate an authentication credential according to the initial authentication credential PSK. The authentication credential may include: device ID, device firmware version number, initial authentication credential PSK, etc.
步骤204b:设备将认证凭证发送给认证方,以对认证凭证进行认证。Step 204b: The device sends the authentication credential to the authenticator to authenticate the authentication credential.
其中,发送认证凭证的方式可以是在认证方发送认证请求时,将认证凭证通过安全信道传递给认证方。The manner of sending the authentication credential may be that when the authenticating party sends the authentication request, the authentication credential is transmitted to the authenticating party through a secure channel.
步骤205b:认证方根据存储的设备ID对应的密钥UDS,对接收到的设备的认证凭证进行认证。Step 205b: The authenticator authenticates the received authentication credential of the device according to the stored key UDS corresponding to the device ID.
其中,设备的ID与UDS的对应关系可以存储在认证方的云端数据库中,认证方根据预置的设备ID和设备的USD的对应关系,对认证凭证进行认证。The corresponding relationship between the device ID and the UDS may be stored in the authenticator's cloud database, and the authenticator authenticates the authentication certificate according to the preset corresponding relationship between the device ID and the device's USD.
认证方需要先通过设备ID读取对应的UDS,通过设备所提供的固件版本值读取设备n层固件的正确哈希值,例如,H*(L0),…,H*(Ln-1)。The authenticator needs to first read the corresponding UDS through the device ID, and read the correct hash value of the n-layer firmware of the device through the firmware version value provided by the device, for example, H*(L 0 ),...,H*(L n- 1 ).
认证方随后通过相同的算法生成出初始认证凭证PSK*。例如,通过步骤201b中确定固件密码值的方法,确定第0层的标准固件密码值为:Secret*0=HMAC(UDS,H*(L0)),通过步骤202b中确定固件密码值的方法,确定第i+1层的标准固件密码值为:Secret*i+1=HMAC(Secret*i,H*(Li+1))。从而,确定标准初始认证凭证PSK*=KDF(Secret*n-1)。The authenticator then generates the initial authentication credential PSK* through the same algorithm. For example, by the method of determining the firmware password value in step 201b, the standard firmware password value of the 0th layer is determined as: Secret* 0 =HMAC(UDS,H*(L 0 )), and by the method of determining the firmware password value in step 202b , it is determined that the standard firmware password value of the i+1th layer is: Secret* i+1 =HMAC(Secret* i ,H*(L i+1 )). Thus, the standard initial authentication credential PSK*=KDF(Secret* n-1 ) is determined.
通过对比标准初始认证凭证PSK*与认证凭证中的初始认证凭证PSK对比,若一致,可以确定设备的固件版本的真实。若不一致,可以确定设备的固件被篡改。从而,认证方可判断设备固件版本的真实性以及固件的完整性。By comparing the standard initial authentication credential PSK* with the initial authentication credential PSK in the authentication credential, if they are consistent, the authenticity of the firmware version of the device can be determined. If not, it can be determined that the firmware of the device has been tampered with. Thus, the authenticator can judge the authenticity of the device firmware version and the integrity of the firmware.
上述方案中,设备用于身份及固件完整性验证的认证凭证是一种静态认证凭证,只有设备的固件版本更新时,认证凭证才可能发生变化。由于DICE模块无法为认证凭证提供硬件级的安全存储方式,一旦黑客有能力窃取静态认证凭证,设备身份即存在被仿冒的风险。认证方仅能通过初始认证凭证PSK判断整体固件的完整性,但不能精确定位出现篡改固件的具体层级,固件完整性证明的粒度不足。In the above solution, the authentication credential used by the device for identity and firmware integrity verification is a static authentication credential, and the authentication credential may change only when the firmware version of the device is updated. Since the DICE module cannot provide hardware-level secure storage for authentication credentials, once hackers have the ability to steal static authentication credentials, the device identity is at risk of being counterfeited. The authenticator can only judge the integrity of the overall firmware through the initial authentication certificate PSK, but cannot precisely locate the specific level of the tampered firmware, and the granularity of the firmware integrity proof is insufficient.
基于上述问题,本申请提供一种认证凭证的生成方法,物联网设备和认证方组成的认证系统的架构示意图可如图1b所示。图1b所述的认证系统中,物联网设备和认证方在功能上均可包括DICE模块。设备制造商在生产设备时已为设备安装了DICE模块,并在DICE模块中引入一个初始校验值Seed值,该Seed值是基于当前启动过程中新生成的,从而,DICE模块通过该Seed值在各层固件在启动过程中生成动态度量值,进而生成动态认证凭证用于认证。Based on the above problems, the present application provides a method for generating an authentication credential, and a schematic diagram of the architecture of an authentication system composed of an IoT device and an authenticator can be shown in FIG. 1b. In the authentication system shown in FIG. 1b, both the IoT device and the authenticator can functionally include a DICE module. The device manufacturer has installed the DICE module for the device when producing the device, and introduced an initial check value Seed value into the DICE module. The Seed value is newly generated based on the current startup process. Therefore, the DICE module passes the Seed value. Firmware at each layer generates dynamic metrics during startup, which in turn generates dynamic authentication credentials for authentication.
为了保证安全性,可以在设备生产完成后,向设备的DICE模块写入该设备的身份信息。例如,在设备生产完成后,厂商可以对设备进行测试,在测试合格后,该设备的生产商或者原始设备制造商可以向该设备写入该设备的身份信息。设备的身份信息例如包括如下的一项或多项:该设备的型号,该设备使用的UDS,或,该设备的标识。其中,ID可以是设备制造商为设备生成的设备ID,UDS为设备制造商为设备生成的全局唯一的对称密钥UDS。该对称密钥作为信任锚。设备ID与UDS可以是烧录入DICE模块中的,从而可以保证其不被篡改。In order to ensure security, the identity information of the device can be written to the DICE module of the device after the production of the device is completed. For example, after the production of the equipment is completed, the manufacturer can test the equipment, and after passing the test, the manufacturer of the equipment or the original equipment manufacturer can write the identity information of the equipment to the equipment. The identity information of the device includes, for example, one or more of the following: the model of the device, the UDS used by the device, or the identifier of the device. The ID may be a device ID generated for the device by the device manufacturer, and the UDS is a globally unique symmetric key UDS generated by the device manufacturer for the device. This symmetric key acts as a trust anchor. The device ID and UDS can be programmed into the DICE module to ensure that they are not tampered with.
DICE模块还可用于对生成的认证凭证初始认证凭证PSK、Seed等密钥的相关信息的管理和存储。DICE模块还可以用于认证消息的产生与发送,把基于DICE的认证参数如设备的身份信息、Seed、到期日、版本号、认证凭证等封装在认证消息中,并从认证方返回的响应消息中解析基于认证方的参数如随机数等。从而,基于接收到的认证方的参数,向认证方发送认证凭证,例如物联网设备的DICE模块可基于接收到的随机数对认证凭证进行加密等。DICE模块还可用于根据DICE模块提供的认证方的参数如ID,到期日等信息产生验证过程中的随机数。The DICE module can also be used to manage and store the information related to the generated authentication credentials, such as the initial authentication credentials PSK, Seed, and other keys. The DICE module can also be used to generate and send authentication messages, encapsulate DICE-based authentication parameters such as device identity information, Seed, expiration date, version number, authentication credentials, etc. in the authentication message, and return the response from the authenticator Parameters such as random numbers based on the authenticator are parsed in the message. Thus, based on the received parameters of the authenticating party, the authentication credential is sent to the authenticating party. For example, the DICE module of the IoT device can encrypt the authentication credential based on the received random number. The DICE module can also be used to generate random numbers in the verification process according to the parameters of the authenticator provided by the DICE module, such as ID, expiration date and other information.
此外,设备制造商可以预先将设备的ID与UDS的对应关系通关安全的带外方式分发给认证方。以便认证方通过设备的ID与UDS对认证凭证进行认证。认证方可以为一台执行特定业务的云端服务器。认证方提前预置初始校验值Seed值有效性的认证方法,并在验证过程中预先判断初始校验值Seed有效性。在初始校验值Seed有效的条件下,认证方通过设备启动过程中相同的度量机制和算法生成标准认证凭证。通过对比设备所提供的动态认证凭证与标准认证凭证的一致性,认证方可以判断设备身份的真实性及设备固件的合法性。In addition, the device manufacturer can pre-distribute the corresponding relationship between the device ID and the UDS to the authenticator in an out-of-band way to clear the security. So that the authenticator can authenticate the authentication credential through the device ID and UDS. The authenticator can be a cloud server that performs specific services. The authenticator presets the authentication method of the validity of the initial check value Seed value in advance, and pre-judged the validity of the initial check value Seed during the verification process. Under the condition that the initial verification value Seed is valid, the authenticator generates a standard authentication credential through the same measurement mechanism and algorithm in the device startup process. By comparing the consistency of the dynamic authentication credentials provided by the device with the standard authentication credentials, the authenticator can judge the authenticity of the device identity and the legitimacy of the device firmware.
在下文的介绍过程中,以该方法应用于图1b所示的网络架构为例。另外,该方法可由二个通信装置(或者说,二种通信装置)执行,这二个通信装置例如为第一通信装置和第二通信装置。其中,第一通信装置,可以是物联网设备或能够支持物联网设备实现该方法所需的功能的通信装置(例如芯片系统),第二通信装置可以是认证方或者能够支持认证方实现该方法所需的功能的通信装置(例如芯片系统),当然还可以是其他通信装置。且对于第一通信装置和第二通信装置的实现方式均不做限制,例如这二个通信装置可以实现为相同的形式,例如均通过设备的形式实现,或者二个通信装置也可以实现为不同的形式,例如第一通信装置通过设备的形式实现,第二通信装置通过芯片系统的方式实现的形式实现,这二种通信装置也可以是二种不同的芯片,等等。In the following introduction process, the method is applied to the network architecture shown in FIG. 1b as an example. In addition, the method may be performed by two communication apparatuses (or, in other words, two types of communication apparatuses), such as a first communication apparatus and a second communication apparatus. Wherein, the first communication device may be an IoT device or a communication device (such as a chip system) capable of supporting the functions required by the IoT device to implement the method, and the second communication device may be an authenticator or capable of supporting an authenticator to implement the method The communication device (for example, a chip system) with the required functions, of course, can also be other communication devices. And there is no restriction on the implementation of the first communication device and the second communication device, for example, the two communication devices can be realized in the same form, for example, both are realized in the form of equipment, or the two communication devices can also be realized in different ways. For example, the first communication device is realized in the form of a device, and the second communication device is realized in the form of a chip system. The two communication devices can also be two different chips, and so on.
本申请提供一种生成认证凭证的方法,请参见图4a,为该方法的流程图。以该方法由第一设备执行为例,例如,第一设备可以是待认证的物联网设备,也就是说,在下文中,以第一通信装置是第一设备,如图4a所示,包括:The present application provides a method for generating an authentication credential, please refer to FIG. 4a , which is a flowchart of the method. Taking the method performed by the first device as an example, for example, the first device may be an IoT device to be authenticated, that is to say, in the following, the first communication device is the first device, as shown in FIG. 4a, including:
步骤401:第一设备启动DICE初始固件层。Step 401: The first device starts the DICE initial firmware layer.
在DICE初始固件层中,可以通过UDS生成下一层的校验信息。下一层可以是第1个待认证层。为区分DICE初始固件层和待认证层,可以将DICE初始固件层标记为第-1层。In the initial firmware layer of DICE, the verification information of the next layer can be generated through UDS. The next layer can be the first layer to be authenticated. In order to distinguish the DICE initial firmware layer and the layer to be authenticated, the DICE initial firmware layer can be marked as layer -1.
步骤402:DICE初始固件层确定第1个待认证层的相关信息;Step 402: the DICE initial firmware layer determines the relevant information of the first layer to be authenticated;
步骤402中,可以生成第1个待认证层的第一校验值、固件哈希值、固件密码值等。下面以方式A1-A2举例说明第1个待认证层的第一校验值的生成方式。In step 402, a first check value, a firmware hash value, a firmware password value, etc. of the first layer to be authenticated may be generated. The method for generating the first check value of the first to-be-authenticated layer is exemplified below by taking the methods A1-A2.
方式A1,DICE初始固件层计算第1个待认证层的第一校验值:Method A1, the DICE initial firmware layer calculates the first check value of the first layer to be authenticated:
KEY0=HMAC(UDS,Seed);KEY 0 =HMAC(UDS, Seed);
如图4b所示,其中,UDS为物联网设备的DICE模块中存储的对称密钥。初始校验值Seed为物联网设备在该次启动过程中生成的。一种可能的实现方式,初始校验值Seed可以是随机数、时间戳、计数器等。在每次启动过程中,可以生成不同的初始校验值Seed,从而,可以保证生成的认证凭证为不同的值,以实现动态校验。As shown in Figure 4b, the UDS is the symmetric key stored in the DICE module of the IoT device. The initial check value Seed is generated by the IoT device during the startup process. In a possible implementation manner, the initial check value Seed may be a random number, a timestamp, a counter, and the like. In each startup process, different initial verification values Seed can be generated, so that the generated authentication credentials can be guaranteed to be different values to realize dynamic verification.
方式A2,第1个待认证层的第一校验值的加密方式,还可以满足:Method A2, the encryption method of the first check value of the first layer to be authenticated, can also satisfy:
KEY0=HMAC(Seed);KEY 0 =HMAC(Seed);
其中,HMAC为哈希为基础的消息认证码(hash-based message authenticationcode,HMAC),用于对UDS和M0进行加密。当然,本申请中,不限定根据初始校验值Seed确定第一校验值KEY0的加密方式,还可以有其他加密方式,例如,KDF函数,也可以是伪随机函数(pseudo random function,PRF),还可以是哈希函数为基础的密钥导出函数(hashbasedkey derivation function,HKDF)。Wherein, HMAC is a hash-based message authentication code (hash-based message authentication code, HMAC), which is used to encrypt the UDS and M 0 . Of course, in this application, the encryption method for determining the first check value KEY 0 according to the initial check value Seed is not limited, and there may be other encryption methods, for example, a KDF function, or a pseudo random function (PRF). ), or a hash-based key derivation function (HKDF).
下面以方式B1-B2举例说明固件哈希值的生成方式。The method for generating the firmware hash value is exemplified by the methods B1-B2 below.
方式B1:DICE初始固件层,通过对第1个待认证层(可以标记为第0层)的固件代码进行哈希,可以确定出第1个待认证层的固件度量值,如图4b所示,例如,第1个待认证层的固件度量值可以满足:M0=H(L0);Method B1: DICE initial firmware layer, by hashing the firmware code of the first layer to be authenticated (which can be marked as layer 0), the firmware metric value of the first layer to be authenticated can be determined, as shown in Figure 4b , for example, the firmware metric value of the first layer to be authenticated can satisfy: M 0 =H(L 0 );
其中,H为一种哈希算法,通过对第0层的固件代码进行哈希,可以获得第0层的固件度量值。Among them, H is a hash algorithm, by hashing the firmware code of the 0th layer, the firmware metric value of the 0th layer can be obtained.
方式B2:DICE初始固件层通过对第1个待认证层(可以标记为第0层)的固件代码和UDS进行哈希,可以确定出第1个待认证层的固件度量值,例如,第1个待认证层的固件度量值可以满足:M0=H(UDS,L0);Mode B2: DICE initial firmware layer By hashing the firmware code and UDS of the first layer to be authenticated (which can be marked as layer 0), the firmware metric value of the first layer to be authenticated can be determined, for example, the first layer The firmware metrics of the layers to be authenticated can satisfy: M 0 =H(UDS, L 0 );
结合方式A2,可以通过对UDS和第0层的固件代码进行哈希,从而,避免仅根据Seed获得初始校验值,或者,仅根据固件代码获得相应的固件密码值,从而,可以提高认证效果和固件代码的安全性。Combining method A2, the UDS and the firmware code of layer 0 can be hashed, thereby avoiding obtaining the initial verification value only according to the Seed, or obtaining the corresponding firmware password value only according to the firmware code, so that the authentication effect can be improved. and firmware code security.
需要说明的是,本申请中,不限定根据第0层的固件度量值的确定方式,还可以有其他加密方式,例如,KDF函数,也可以是PRF,还可以是HKDF。It should be noted that, in this application, the determination method according to the firmware metric value of the 0th layer is not limited, and other encryption methods are also possible, for example, KDF function, PRF, or HKDF.
下面以方式C1-C2举例说明固件密码值的生成方式。The method of generating the firmware password value is illustrated below by taking the methods C1-C2 as an example.
方式C1,DICE初始固件层计算第1个待认证层的固件密码值,其中,第0层的固件密码值可以根据UDS和第0层的固件度量值确定,如图4b所示,例如,第1个待认证层的固件密码值可以满足:Mode C1, the DICE initial firmware layer calculates the firmware password value of the first layer to be authenticated, wherein the firmware password value of the 0th layer can be determined according to the UDS and the firmware metric value of the 0th layer, as shown in Figure 4b, for example, the first layer One firmware password value of the layer to be authenticated can satisfy:
Secret0=HMAC(UDS,M0);Secret 0 =HMAC(UDS, M 0 );
方式C2,DICE初始固件层计算第1个待认证层的固件密码值,其中,第0层的固件密码值可以根据第0层的固件度量值确定,例如,第1个待认证层的固件密码值可以满足:Mode C2, the DICE initial firmware layer calculates the firmware password value of the first layer to be authenticated, wherein the firmware password value of the 0th layer can be determined according to the firmware metric value of the 0th layer, for example, the firmware password of the first layer to be authenticated The value can satisfy:
Secret0=HMAC(M0);Secret 0 =HMAC(M 0 );
需要说明的是,本申请中,不限定根据第0层的固件度量值确定固件密码值的加密方式,还可以有其他加密方式,例如,KDF函数,也可以是PRF,还可以是HKDF。It should be noted that, in this application, the encryption method for determining the firmware password value according to the firmware metric value of the 0th layer is not limited, and there may be other encryption methods, such as KDF function, PRF, or HKDF.
步骤403:第一设备启动第1个待认证层;Step 403: the first device starts the first layer to be authenticated;
例如,第一设备启动的第1个待认证层为第0层固件,并通过DICE初始固件层将第一校验值KEY0、Secret0、初始校验值Seed、ID传递给第0层固件。For example, the first layer to be authenticated started by the first device is the layer 0 firmware, and the first check value KEY 0 , Secret 0 , the initial check value Seed and ID are passed to the layer 0 firmware through the DICE initial firmware layer .
进一步的,DICE初始固件层删除KEY0、M0、Secret0值,并关闭当前DICE初始固件层,以保证密钥的安全性。Further, the DICE initial firmware layer deletes the values of KEY 0 , M 0 , and Secret 0 , and closes the current DICE initial firmware layer to ensure the security of the key.
需要说明的是,步骤403可以在步骤404之后执行,也可以同时执行,在此不做限定。It should be noted that step 403 may be performed after step 404, or may be performed simultaneously, which is not limited herein.
步骤404:第一设备的第1个待认证层确定第2个待认证层的相关信息;Step 404: the first layer to be authenticated of the first device determines the relevant information of the second layer to be authenticated;
在步骤405中,可以生成下一个待认证层的第一校验值、固件哈希值、固件密码值等。In step 405, the first check value, firmware hash value, firmware password value, etc. of the next layer to be authenticated may be generated.
下面以第i个待认证层确定第i+1个待认证层的第一校验值、固件哈希值、固件密码值为例进行说明。其中,i为小于n的正整数。The following description will be given by taking as an example that the i-th layer to be authenticated determines the first check value, the firmware hash value, and the firmware password value of the i+1-th layer to be authenticated. where i is a positive integer less than n.
以方式D1和方式D2举例说明第i个待认证层确定第i+1个待认证层的第一校验值的方式。Modes D1 and D2 are used to illustrate the manner in which the i-th layer to be authenticated determines the first check value of the i+1-th layer to be authenticated.
方式D1,第i个待认证层根据第i个待认证层的第一校验值,确定第i+1个待认证层的第一校验值。如图4b所示,例如,第i+1个待认证层的第一校验值满足:Mode D1, the i-th layer to be authenticated determines the first check value of the i+1-th layer to be authenticated according to the first check value of the i-th layer to be authenticated. As shown in Figure 4b, for example, the first check value of the i+1th layer to be authenticated satisfies:
KEYi+1=H(KEYi);KEY i+1 =H(KEY i );
即通过对第i个待认证层的第一校验值进行哈希,可以确定第i+1个待认证层的第一校验值。That is, by hashing the first check value of the i-th layer to be authenticated, the first check value of the i+1-th layer to be authenticated can be determined.
以第1个待认证层(第0层)为例,则第2个待认证层的第一校验值满足:KEY1=H(KEY0)。Taking the first layer to be authenticated (layer 0) as an example, the first check value of the second layer to be authenticated satisfies: KEY 1 =H(KEY 0 ).
方式D2,第i个待认证层对第i个待认证层的第一校验值进行加密,确定第i+1个待认证层的第一校验值。例如,第i+1个待认证层的第一校验值满足:Mode D2, the i-th layer to be authenticated encrypts the first check value of the i-th layer to be authenticated to determine the first check value of the i+1-th layer to be authenticated. For example, the first check value of the i+1th layer to be authenticated satisfies:
KEYi+1=HMAC(KEYi);KEY i+1 =HMAC(KEY i );
即通过对第i个待认证层的第一校验值进行HMAC加密,可以确定第i+1个待认证层的第一校验值。That is, by performing HMAC encryption on the first check value of the i-th layer to be authenticated, the first check value of the i+1-th layer to be authenticated can be determined.
以第1个待认证层(第0层)为例,则第2个待认证层(第1层)的第一校验值满足:KEY1=HMAC(KEY0)。Taking the first layer to be authenticated (layer 0) as an example, the first check value of the second layer to be authenticated (layer 1) satisfies: KEY 1 =HMAC(KEY 0 ).
当前,还可以是通过其他方式,确定第i+1个待认证层的第一校验值,在此不做限定。Currently, the first check value of the i+1 th layer to be authenticated may also be determined by other methods, which is not limited here.
在步骤405中,针对第i+1个待认证层的固件哈希值的确定方式,可以根据第i+1个待认证层的固件代码确定。例如,第i+1个待认证层的固件哈希值可以满足:In step 405, the manner of determining the firmware hash value of the i+1 th layer to be authenticated may be determined according to the firmware code of the i+1 th layer to be authenticated. For example, the firmware hash value of the i+1th layer to be authenticated can satisfy:
Mi+1=H(Li+1);M i+1 =H(L i+1 );
其中,Li+1为第i+1个待认证层的固件代码,通过对第i+1个待认证层的固件代码进行哈希,可以确定第i+1个待认证层的固件哈希值。Among them, L i+1 is the firmware code of the i+1th layer to be authenticated. By hashing the firmware code of the i+1th layer to be authenticated, the firmware hash of the i+1th layer to be authenticated can be determined. value.
以第1个待认证层(第0层)为例,则第2个待认证层(第1层)的固件哈希值满足:M1=H(L1)。Taking the first layer to be authenticated (layer 0) as an example, the firmware hash value of the second layer to be authenticated (layer 1) satisfies: M 1 =H(L 1 ).
以方式E1和方式E2举例说明第i个待认证层确定第i+1个待认证层的固件密码值的方式。The manner in which the i-th layer to be authenticated determines the firmware password value of the i+1-th layer to be authenticated is exemplified by way E1 and way E2.
方式E1,可以根据第i+1个待认证层的固件哈希值和第i个待认证层的第一校验值,确定第i+1个待认证层的固件密码值。如图4b所示,例如,第i+1个待认证层的固件密码值可以满足:In the manner E1, the firmware password value of the i+1th layer to be authenticated can be determined according to the firmware hash value of the i+1th layer to be authenticated and the first check value of the ith layer to be authenticated. As shown in Figure 4b, for example, the firmware password value of the i+1th layer to be authenticated can satisfy:
Secreti+1=HMAC(KEYi,H(Li+1))。Secret i+1 =HMAC(KEY i ,H(L i+1 )).
以第1个待认证层(第0层)为例,则第2个待认证层(第1层)的固件密码值满足:Secret1=HMAC(KEY0,H(L1))。Taking the first layer to be authenticated (layer 0) as an example, the firmware password value of the second layer to be authenticated (layer 1) satisfies: Secret 1 =HMAC(KEY 0 , H(L 1 )).
方式E2,可以根据第i+1个待认证层的固件哈希值,确定第i+1个待认证层的固件密码值。例如,第i+1个待认证层的固件密码值可以满足:In manner E2, the firmware password value of the i+1 th layer to be authenticated can be determined according to the firmware hash value of the i+1 th layer to be authenticated. For example, the firmware password value of the i+1th layer to be authenticated can satisfy:
Secreti+1=HMAC(H(Li+1))。Secret i+1 =HMAC(H(L i+1 )).
以第1个待认证层(第0层)为例,则第2个待认证层(第1层)的固件密码值满足:Secret1=HMAC(H(L1))。Taking the first layer to be authenticated (layer 0) as an example, the firmware password value of the second layer to be authenticated (layer 1) satisfies: Secret 1 =HMAC(H(L 1 )).
在上述方式中,每个待认证层生成的固件密码值是相互独立的,仅与该次启动时生成的第一校验值和该层的固件代码有关,从而,在认证方进行每层的固件哈希值的验证时,可以确定是哪些层的固件哈希值出现了问题,从而可以根据物联网设备生成的每个待认证层的固件密码值,精准的定位到出现被篡改的固件层中,进一步的,还可以根据确定出的被篡改的固件层,对相应层的固件代码执行相应的安全策略,提高固件代码的安全性。In the above manner, the firmware password values generated by each layer to be authenticated are independent of each other, and are only related to the first check value generated during this startup and the firmware code of that layer. When verifying the firmware hash value, it is possible to determine which layers of the firmware hash value have problems, so that the tampered firmware layer can be accurately located according to the firmware password value of each layer to be authenticated generated by the IoT device. Further, according to the determined tampered firmware layer, a corresponding security policy can be executed on the firmware code of the corresponding layer to improve the security of the firmware code.
通过上述方式,第i个待认证层可以将确定的第i+1个待认证层的第一校验值KEYi+1、第i+1个待认证层的固件哈希值、第i+1个待认证层的固件密码值Secreti+1、初始校验值Seed、第一设备ID传递给第i+1个待认证层,以使第i+1个待认证层确定第i+2个待认证层的相关信息。或者,第i个待认证层还可以将i+1个待认证层的固件密码值Secret0~Secreti+1全部发送给第i+1个待认证层。In the above manner, the i-th layer to be authenticated can determine the first check value KEY i+1 of the i+1-th layer to be authenticated, the firmware hash value of the i+1-th layer to be authenticated, the i+ The firmware password value Secret i+1 , the initial check value Seed, and the first device ID of 1 layer to be authenticated are passed to the i+1 layer to be authenticated, so that the i+1 layer to be authenticated determines the i+2 Information about the layer to be authenticated. Alternatively, the i-th layer to be authenticated may also send all the firmware password values Secret 0 to Secret i+1 of the i+1 layers to be authenticated to the i+1-th layer to be authenticated.
例如,第一设备启动第2个待认证层。For example, the first device starts the second layer to be authenticated.
第2个待认证层可以确定第3个待认证层的相关信息。具体实施方式,可以参考步骤405,在此不再赘述。The second to-be-authenticated layer may determine relevant information of the third to-be-authenticated layer. For a specific implementation manner, reference may be made to step 405, which will not be repeated here.
逐层启动n个待认证层,直至n个待认证层全部启动。The n layers to be authenticated are started layer by layer until all the n layers to be authenticated are started.
步骤406:第一设备启动第n个待认证层,确定初始认证凭证PSK。Step 406: The first device starts the nth layer to be authenticated, and determines the initial authentication credential PSK.
第n-1个待认证层确定初始认证凭证PSK=KDF(Secretn-1)。The n-1 th layer to be authenticated determines the initial authentication credential PSK=KDF(Secret n-1 ).
当第一设备被认证方请求可信远程证明时,第一设备通过网络向认证方发送目标认证凭证。发送的目标认证凭证可以有多种方式,下面以方式F1-F3举例说明。When the first device is requested by the authenticator for a trusted remote certificate, the first device sends the target authentication credential to the authenticator through the network. There are many ways to send the target authentication credential. The following is an example of ways F1-F3.
方式F1:目标认证凭证可以包括:第一设备的身份信息,初始校验值Seed,初始认证凭证PSK。Manner F1: The target authentication credential may include: the identity information of the first device, the initial verification value Seed, and the initial authentication credential PSK.
其中,第一设备的身份信息可以包括以下至少一项:第一设备的ID,固件版本号Firmware Version,第一设备的标识等,在此不做限定。Wherein, the identity information of the first device may include at least one of the following: ID of the first device, firmware version number Firmware Version, identification of the first device, etc., which are not limited herein.
其中,Seed和初始认证凭证PSK可以是明文发送给认证方,也可以通过加密的方式发送,在此不做限定,具体发送方式在下述实施例中详细说明。The Seed and the initial authentication credential PSK may be sent to the authenticating party in plain text, or may be sent in an encrypted manner, which is not limited here, and the specific sending method is described in detail in the following embodiments.
方式F2:第n-1个待认证层还根据n个待认证层的固件密码值,确定校验序列D=(Secret0,Secret1…,Secretn-1)。Mode F2: The n-1 th layer to be authenticated also determines the check sequence D=(Secret 0 , Secret 1 . . . , Secret n-1 ) according to the firmware password values of the n layers to be authenticated.
此时,目标认证凭证可以包括以下至少一项:第一设备的身份信息,第一设备的初始校验值Seed,初始认证凭证PSK,校验序列D。At this time, the target authentication credential may include at least one of the following: the identity information of the first device, the initial verification value Seed of the first device, the initial authentication credential PSK, and the verification sequence D.
其中,初始校验值Seed、初始认证凭证PSK和/或校验序列D可以是明文发送给认证方,也可以通过加密的方式发送,加密的方式可以是分别加密,也可以是单独加密,在此不做限定。具体发送方式在下述实施例中详细说明。Wherein, the initial check value Seed, the initial authentication certificate PSK and/or the check sequence D may be sent to the authenticator in plaintext, or may be sent in an encrypted manner. The encryption method may be separate encryption or separate encryption. This is not limited. The specific sending manner is described in detail in the following embodiments.
方式F3:考虑到在对各层的固件密码值进行校验时,可以分别发送相应层的固件密码值,因此,目标认证凭证可以包括:第一设备的身份信息,初始认证凭证PSK,Secreti。其中,Secreti为第i层的固件密码值。Mode F3: Considering that when verifying the firmware password value of each layer, the firmware password value of the corresponding layer can be sent respectively, therefore, the target authentication credential can include: the identity information of the first device, the initial authentication credential PSK, Secret i . Among them, Secret i is the firmware password value of the i-th layer.
本申请提供一种认证的方法,请参见图5,为该方法的流程图。以该方法由第一设备和第二设备执行为例,即以第一通信装置是第一设备,第二通信装置是第二设备为例,例如,第一设备为物联网设备,第二设备可以是认证方的服务器,或者是其他实体。如图5所示,包括:The present application provides an authentication method, please refer to FIG. 5 , which is a flowchart of the method. Take the method performed by the first device and the second device as an example, that is, take the first communication device as the first device and the second communication device as the second device as an example, for example, the first device is an IoT device, and the second device is used as an example. It can be the authenticator's server, or another entity. As shown in Figure 5, including:
步骤501:第一设备向第二设备发送第一认证消息。Step 501: The first device sends a first authentication message to the second device.
其中,认证请求包括触发认证请求的第一信息。The authentication request includes first information that triggers the authentication request.
例如,第一信息可以是用于认证的。第一信息也可以包括其他设备或者第一设备自身提供的其它触发条件的标识。例如,第一信息包括响应于其他设备周期上报的测量结果、触发标识、或信息报告的信息,或者可以包括第一设备或其他物联网设备的启动或重启、软硬件更新或即插即用的设备的引入的信息。For example, the first information may be for authentication. The first information may also include identifiers of other devices or other triggering conditions provided by the first device itself. For example, the first information includes measurement results, trigger identifiers, or information reported in response to other devices periodically, or may include startup or restart, software and hardware updates, or plug-and-play of the first device or other IoT devices. Information about the introduction of the device.
或者,第一信息也可以包括响应于其他事件的信息,其他事件例如为第一设备上电的事件,或者第一设备接收了来自其他设备的信息的事件,等等。例如,用户想要进行第一业务,则用户按下了某个或某些按钮,这就相当于输入了信息,而接收用户输入的信息的是其他设备。其他设备接收了用户输入的信息后,可以通知第一设备启动认证过程,则第一设备就可以执行步骤501。Alternatively, the first information may also include information in response to other events, such as the event that the first device is powered on, or the event that the first device receives information from other devices, and so on. For example, if the user wants to perform the first service, the user presses a certain button or some buttons, which is equivalent to inputting information, and other devices receive the information input by the user. After the other device receives the information input by the user, it can notify the first device to start the authentication process, and then the first device can execute step 501 .
另外,认证请求还可以包括第一设备的身份信息和第一设备在该次启动时生成的初始校验值Seed。In addition, the authentication request may further include the identity information of the first device and the initial verification value Seed generated by the first device during this startup.
其中,第一设备的身份信息可以包括以下至少一项:设备的ID,固件版本号FirmwareVersion,设备的标识等。The identity information of the first device may include at least one of the following: an ID of the device, a firmware version number FirmwareVersion, an identifier of the device, and the like.
步骤502:第二设备对第一认证消息进行认证。Step 502: The second device authenticates the first authentication message.
第二设备可以根据认证请求,对第一设备的身份信息,及第一设备在该次启动时生成的初始校验值Seed进行认证。The second device may, according to the authentication request, authenticate the identity information of the first device and the initial verification value Seed generated by the first device during this startup.
第一设备在该次启动时生成的初始校验值Seed可以为:随机数、时间戳、计数器等。The initial check value Seed generated by the first device during this startup may be: a random number, a timestamp, a counter, and the like.
下面以方式G1-G3举例说明对初始校验值Seed的认证方式。The following takes the modes G1-G3 as an example to illustrate the authentication mode for the initial check value Seed.
方式G1:Seed为计数器,则第二设备根据认证请求中的初始校验值Seed的值,与历史中第一设备提供的初始校验值Seed的值比较,确定初始校验值Seed的验证结果。Mode G1: Seed is a counter, then the second device compares the value of the initial verification value Seed in the authentication request with the value of the initial verification value Seed provided by the first device in the history to determine the verification result of the initial verification value Seed .
例如,初始校验值Seed为递增计数器,此时若第一设备提供的第一认证消息中的计数器的值小于或等于历史中第一设备提供的计数器数值时,则确定第一认证消息认证不通过。若第一设备提供的认证请求中的计数器的值大于其历史中第一设备提供的计数器数值时,确定第一认证消息中的Seed值有效,则可以继续对其他信息进行认证。For example, the initial check value Seed is an incrementing counter. At this time, if the value of the counter in the first authentication message provided by the first device is less than or equal to the value of the counter provided by the first device in the history, it is determined that the authentication of the first authentication message is not valid. pass. If the value of the counter in the authentication request provided by the first device is greater than the value of the counter provided by the first device in its history, it is determined that the Seed value in the first authentication message is valid, and other information can be authenticated.
再比如,初始校验值Seed为递减计数器,此时,若第一设备提供的第一认证消息中的计数器的值大于或等于历史中第一设备提供的计数器数值时,则确定第一认证消息认证不通过。若第一设备提供的认证请求中的计数器的值小于历史中第一设备提供的计数器数值时,确定第一认证消息中的Seed值有效,则可以继续对其他信息进行认证。For another example, the initial check value Seed is a decrementing counter. At this time, if the value of the counter in the first authentication message provided by the first device is greater than or equal to the counter value provided by the first device in the history, the first authentication message is determined. Authentication failed. If the value of the counter in the authentication request provided by the first device is smaller than the value of the counter provided by the first device in the history, it is determined that the Seed value in the first authentication message is valid, and other information can be authenticated.
方式G2:初始校验值Seed为时间戳,则第二设备根据认证请求中的初始校验值Seed的值,与历史中第一设备提供的Seed中的最大时间戳比较,确定Seed的验证结果。Mode G2: The initial verification value Seed is a timestamp, then the second device compares the value of the initial verification value Seed in the authentication request with the maximum timestamp in the Seed provided by the first device in the history to determine the verification result of the Seed .
其中,若第一设备提供的第一认证消息中的时间戳小于或等于历史中第一设备提供的最大时间戳时,则确定第一认证消息认证不通过。若第一设备提供的认证请求中的时间戳大于其历史中第一设备提供的最大时间戳时,确定第一认证消息中的Seed值有效,则可以继续对其他信息进行认证。Wherein, if the timestamp in the first authentication message provided by the first device is less than or equal to the maximum timestamp provided by the first device in the history, it is determined that the authentication of the first authentication message fails. If the timestamp in the authentication request provided by the first device is greater than the maximum timestamp provided by the first device in its history, it is determined that the Seed value in the first authentication message is valid, and other information can be authenticated.
方式G3:初始校验值Seed为随机数,则第二设备根据认证请求中的初始校验值Seed的值,与历史中第一设备提供的所有Seed比较,确定Seed的验证结果。Mode G3: The initial verification value Seed is a random number, and the second device compares the value of the initial verification value Seed in the authentication request with all seeds provided by the first device in the history to determine the verification result of the Seed.
其中,若第一设备提供的第一认证消息中的随机数与历史中第一设备提供的任一个随机数重复时,则确定第一认证消息认证不通过。若第一设备提供的认证请求中的随机数未与历史中第一设备提供的随机数重复时,确定第一认证消息中的Seed值有效,则可以继续对其他信息进行认证。Wherein, if the random number in the first authentication message provided by the first device is repeated with any random number provided by the first device in the history, it is determined that the authentication of the first authentication message fails. If the random number in the authentication request provided by the first device does not overlap with the random number provided by the first device in the history, it is determined that the Seed value in the first authentication message is valid, and other information can be authenticated.
在初始校验值Seed值有效的情况下,根据接收到的初始校验值Seed,更新初始校验值Seed的历史数值,并执行步骤503。In the case that the initial check value Seed is valid, the historical value of the initial check value Seed is updated according to the received initial check value Seed, and step 503 is executed.
步骤502a:第二设备对第一设备的目标认证凭证进行认证。Step 502a: The second device authenticates the target authentication credential of the first device.
其中,目标认证凭证可以是第一设备生成的初始认证凭证PSK,也可以是加密后的初始认证凭证PSK。The target authentication credential may be an initial authentication credential PSK generated by the first device, or an encrypted initial authentication credential PSK.
一种可能的实现方式,第二设备可以根据第一设备的ID,及设备的ID与UDS的对应关系,确定,第一设备对应的UDS。并根据第一设备的固件版本号,确定该版本固件各层标准哈希值M0*~Mn*。In a possible implementation manner, the second device may determine the UDS corresponding to the first device according to the ID of the first device and the corresponding relationship between the ID of the device and the UDS. And according to the firmware version number of the first device, the standard hash values M 0 *˜M n * of each layer of the firmware of this version are determined.
从而,根据第一设备每层的第一校验值确定方式,第二设备确定每层的标准第一校验值,根据第一设备每层的固件密码值确定方式,第二设备确定每层的标准固件密码值,从而,第二设备确定出标准校验秘钥PSK*。Thus, according to the method of determining the first check value of each layer of the first device, the second device determines the standard first check value of each layer, and according to the method of determining the firmware password value of each layer of the first device, the second device determines each layer. Therefore, the second device determines the standard verification key PSK*.
结合方式A1-A2,方式B1-B2,方式C1-C2,第二设备可以基于第一设备相应的确定第一校验值、固件密码值及初始认证凭证PSK的方式,相应确定每层的标准第一校验值及每层的标准固件密码值。下面以方式A1,B1和C1,确定标准校验秘钥PSK*。例如,第0层固件标准第一校验值满足:KEY0*=HMAC(UDS,Seed);第i层固件标准第一校验值满足:KEYi=H(KEYi-1);第0层固件标准固件密码值满足:Secret0*=HMAC(UDS,M0*);第i层固件标准固件密码值满足:Secreti*=HMAC(KEYi,Mi*);从而,确定出标准校验秘钥PSK*=H(D*),其中,标准校验序列D*可以满足:D*=(Secret0*,Secret1*,…,Secretn*)。Combining the modes A1-A2, B1-B2, and C1-C2, the second device can determine the standard of each layer correspondingly based on the first device correspondingly determining the first check value, the firmware password value and the initial authentication credential PSK The first check value and the standard firmware password value of each layer. The standard verification key PSK* is determined in the following manners A1, B1 and C1. For example, the first check value of the layer 0 firmware standard satisfies: KEY 0 *=HMAC(UDS, Seed); the first check value of the layer i firmware standard satisfies: KEY i =H(KEY i-1 ); The layer firmware standard firmware password value satisfies: Secret 0 *=HMAC(UDS, M 0 *); the i-th layer firmware standard firmware password value satisfies: Secret i *=HMAC(KEY i , M i *); thus, it is determined that the standard The verification key PSK*=H(D*), wherein the standard verification sequence D* can satisfy: D*=(Secret 0 *, Secret 1 *, . . . , Secret n *).
从而,第二设备可以基于标准校验秘钥PSK*判断第一设备的初始认证凭证PSK的合法性,若标准校验秘钥PSK*等于初始认证凭证PSK,则第二设备确定第一设备身份合法且固件版本真实;在确定第一设备身份合法且固件版本真实时,可以确定第一设备认证成功,此时可以执行步骤503,以返回认证结果。若标准校验秘钥PSK*不等于初始认证凭证PSK,则第二设备确定第一设备因固件遭到篡改导致设备身份不合法。此时,可以向第一设备返回第一认证消息的认证结果,即第一认证凭证认证失败。Therefore, the second device can determine the validity of the initial authentication credential PSK of the first device based on the standard verification key PSK*, and if the standard verification key PSK* is equal to the initial authentication credential PSK, the second device determines the identity of the first device It is legal and the firmware version is real; when it is determined that the identity of the first device is legal and the firmware version is real, it can be determined that the authentication of the first device is successful, and step 503 can be performed at this time to return the authentication result. If the standard verification key PSK* is not equal to the initial authentication certificate PSK, the second device determines that the device identity of the first device is illegal because the firmware of the first device has been tampered with. At this time, the authentication result of the first authentication message may be returned to the first device, that is, the authentication of the first authentication credential fails.
步骤503:第二设备向第一设备返回第一认证响应。Step 503: The second device returns a first authentication response to the first device.
其中,第一认证响应可以包括第一认证消息的认证结果。The first authentication response may include an authentication result of the first authentication message.
进一步的,在设备身份合法且固件版本真实的情况下,第二设备还可依据设备固件版本是否为被认可的有效版本,确定第一设备是否认证成功的另一条件。Further, when the device identity is legal and the firmware version is real, the second device may also determine another condition for whether the first device is authenticated successfully according to whether the device firmware version is an approved valid version.
在第二设备向第一设备返回第一认证消息的认证结果为初始认证凭证PSK认证失败时,若第一认证消息中未携带校验序列,此时,可以直接执行步骤504b:第一设备可以向第二设备发送第二认证请求消息。When the authentication result of the first authentication message returned by the second device to the first device is that the initial authentication credential PSK authentication failed, if the first authentication message does not carry the verification sequence, at this time, step 504b can be directly executed: the first device can Send a second authentication request message to the second device.
其中,第二认证请求消息可以携带有每个待认证层的固件密码值,该固件密码值可以是分别进行加密后的固件密码值。第二认证消息还可以携带有校验序列,该校验序列也可以是进行加密后的校验序列,以提高第一设备的安全性。The second authentication request message may carry the firmware password value of each layer to be authenticated, and the firmware password value may be the respectively encrypted firmware password value. The second authentication message may also carry a check sequence, and the check sequence may also be an encrypted check sequence, so as to improve the security of the first device.
另一种可能的实现方式,还可以是执行步骤504a:第二设备向第一设备发送第三认证请求消息,第三认证请求消息用于获取第一设备的校验序列,之后,执行步骤504b:第一设备向第二设备发送第二认证请求消息,以发送校验序列的。Another possible implementation manner may also be to perform step 504a: the second device sends a third authentication request message to the first device, the third authentication request message is used to obtain the verification sequence of the first device, and then step 504b is performed : The first device sends a second authentication request message to the second device to send the verification sequence.
再一种可能的实现方式,还可以是执行步骤504a:二设备向第一设备发送第三认证请求消息,第三认证请求消息用于获取第i个待验证层的固件密码值,之后,执行步骤504b:第一设备向第二设备发送第二认证请求消息,该第二认证请求消息中携带有第i个待验证层的固件密码值。在此不做限定。Another possible implementation mode can also be to perform step 504a: the second device sends a third authentication request message to the first device, and the third authentication request message is used to obtain the firmware password value of the i-th layer to be verified, and then execute Step 504b: The first device sends a second authentication request message to the second device, where the second authentication request message carries the firmware password value of the i-th layer to be authenticated. This is not limited.
步骤504:第二设备对第一设备的每个待认证层的固件密码值进行认证。Step 504: The second device authenticates the firmware password value of each layer to be authenticated of the first device.
结合方式F1-F3,此时,第二设备可以有多种认证方式,下面以方式H1-H3举例说明。Combining the modes F1-F3, at this time, the second device may have multiple authentication modes, and the modes H1-H3 are exemplified below.
方式H1,以第一设备向第二设备发送校验序列为例,通过对比标准校验序列D*=(Secret0*,Secret1*,…,Secretn*)与校验序列D=(Secret0,Secret1…,Secretn),可以确定出具体的遭到篡改的固件层级。例如,若Secreti*不等于Secreti时,第二设备可以确定出第i层固件即为遭到篡改的固件层级。Mode H1, taking the first device sending the check sequence to the second device as an example, by comparing the standard check sequence D*=(Secret 0 *,Secret 1 *,...,Secret n *) with the check sequence D=(Secret 0 ,Secret 1…, Secret n ), the specific tampered firmware level can be determined. For example, if Secret i * is not equal to Secret i , the second device can determine that the i-th layer of firmware is the tampered firmware layer.
方式H2,以第一设备向第二设备发送第i个待验证层的固件密码值Secreti为例,通过对比标准校验序列中的第i个待验证层的标准固件密码值Secreti*,与第一设备向第二设备发送的第i个待验证层的固件密码值Secreti比较,若Secreti*不等于Secreti时,第二设备可以确定出第i层固件即为遭到篡改的固件层级。Mode H2, taking the first device sending the firmware password value Secret i of the i-th layer to be verified to the second device as an example, by comparing the standard firmware password value Secret i * of the i-th layer to be verified in the standard check sequence, Compared with the firmware password value Secret i of the i-th layer to be verified sent by the first device to the second device, if Secret i * is not equal to Secret i , the second device can determine that the layer-i firmware is tampered with Firmware level.
另一种可能的实现方式,以第一设备向第二设备发送加密后的第i个待验证层的固件密码值Si(第i个待验证层的第一固件密码值),例如,第二设备可以基于第二设备生成的随机数N1,对第i个待验证层的固件密码值Secreti进行加密,加密后的第i个待验证层的固件密码值Si可以满足:Si=HMAC(Secreti,N1).从而,第二设备在接收到随机数N1后,可以根据随机数N1及第i个待验证层的标准固件密码值Secreti*,确定加密后的第i个待验证层的标准固件密码值Si*,从而,根据加密的标准固件密码值Si*与第一设备发送的加密后的第i个待验证层的固件密码值Si比较,以确定第i个待验证层是否合法。Another possible implementation is that the first device sends the encrypted firmware password value S i of the i-th layer to be verified (the first firmware password value of the i-th layer to be verified) to the second device, for example, the The second device can encrypt the firmware password value Secret i of the i-th layer to be verified based on the random number N1 generated by the second device, and the encrypted firmware password value S i of the i-th layer to be verified can satisfy: S i = HMAC(Secret i ,N1). Therefore, after receiving the random number N1, the second device can determine the encrypted i-th pending layer according to the random number N1 and the standard firmware password value Secret i * of the i-th layer to be verified. The standard firmware password value S i * of the verification layer, thus, according to the encrypted standard firmware password value S i * and the encrypted firmware password value S i of the i-th layer to be verified sent by the first device is compared to determine the i-th Whether the layer to be verified is legal.
进一步的,第二设备可以执行步骤504c:向第一设备发送第二认证响应,所述第二认证响应用于指示所述n个待认证层中认证失败的待认证层。Further, the second device may perform step 504c: send a second authentication response to the first device, where the second authentication response is used to indicate a to-be-authenticated layer of the n to-be-authenticated layers whose authentication fails.
下面以一个具体的场景举例说明本申请的认证过程,如图6所示,图6为一个物联网设备与服务器在建立DTLS握手过程中的认证过程,在该举例中,第一设备的DICE模块使用一个递增计数器(Counter)作为DICE模块中的Seed。当第一设备完全启动后,第一设备的第n层固件可以确定该次启动的初始认证凭证PSK。认证过程可以包括以下步骤:The following uses a specific scenario to illustrate the authentication process of this application. As shown in FIG. 6, FIG. 6 shows the authentication process of an IoT device and a server in the process of establishing a DTLS handshake. In this example, the DICE module of the first device Use an incrementing counter (Counter) as the Seed in the DICE module. After the first device is fully booted, the nth layer firmware of the first device may determine the initial authentication credential PSK for this boot. The authentication process can include the following steps:
步骤601:第一设备向第二设备发送握手请求消息;Step 601: the first device sends a handshake request message to the second device;
其中,该握手请求消息可以为Client Hello消息;该握手请求消息中可以携带第一设备的身份信息,例如,第一设备的ID,第一设备的固件版本号等。该握手请求消息中还可以携带该握手请求消息对应的业务标识。以使第二设备可以基于业务标识对该握手请求消息进行验证。The handshake request message may be a Client Hello message; the handshake request message may carry the identity information of the first device, for example, the ID of the first device, the firmware version number of the first device, and the like. The handshake request message may also carry a service identifier corresponding to the handshake request message. So that the second device can verify the handshake request message based on the service identifier.
步骤602:第二设备基于该握手请求消息,生成第一随机数。Step 602: The second device generates a first random number based on the handshake request message.
其中,第一随机数可以表示为Nonce-1,进一步的,第二设备还可以为第一设备生成会话标识。该会话标识可以为临时标识Cookie。The first random number may be represented as Nonce-1, and further, the second device may also generate a session identifier for the first device. The session identifier can be a temporary identifier cookie.
步骤603:第二设备向第一设备返回握手响应消息。Step 603: The second device returns a handshake response message to the first device.
其中,该握手响应消息可以为Server Hello消息,其该握手响应消息可以包括会话标识和第一随机数。The handshake response message may be a Server Hello message, and the handshake response message may include a session identifier and a first random number.
步骤604:第一设备基于第二设备的握手响应消息,确定向第二设备发送的目标认证凭证PSK。Step 604: The first device determines the target authentication credential PSK sent to the second device based on the handshake response message of the second device.
其中,向第二设备发送的目标认证凭证PSK可以是加密后的初始认证凭证PSK。加密的初始认证凭证PSK可以有多种加密方式,下面以方式J1-方式J2举例说明。The target authentication credential PSK sent to the second device may be an encrypted initial authentication credential PSK. The encrypted initial authentication credential PSK may have various encryption modes, and the following uses mode J1-mode J2 as an example.
方式J1:第一设备基于第二设备的握手响应消息,生成第二随机数。Manner J1: The first device generates a second random number based on the handshake response message of the second device.
其中,第二随机数可以表示为Nonce-2,第二随机数可以是根据第一随机数生成的,也可以是任一随机数,在此不做限定。从而,第一设备可以基于第一随机数和第二随机数对初始认证凭证PSK进行加密,从而生成目标认证凭证。一种可能的实现方式,加密的初始认证凭证PSK可以满足:R=HMAC(PSK,Nonce-1|Nonce-2);其中,|表示第一随机数和第二随机数的连接符,Nonce-1|Nonce-2表示将第一随机数和第二随机数连接生成一个新的参数,作为对初始认证凭证PSK加密的参数。The second random number may be expressed as Nonce-2, and the second random number may be generated according to the first random number, or may be any random number, which is not limited herein. Thus, the first device may encrypt the initial authentication credential PSK based on the first random number and the second random number, thereby generating the target authentication credential. A possible implementation manner, the encrypted initial authentication credential PSK can satisfy: R=HMAC(PSK, Nonce-1|Nonce-2); where | represents the connector between the first random number and the second random number, and Nonce- 1|Nonce-2 indicates that a new parameter is generated by connecting the first random number and the second random number as a parameter for encrypting the initial authentication credential PSK.
或者,加密的初始认证凭证PSK可以满足:R=HMAC(PSK,Nonce-2|Nonce-1);当然,加密的初始认证凭证PSK还可以根据第一随机数和第二随机数生成的第三随机数确定,第三随机数的生成方式不限于上述连接的方式,还可以是通过运算的方式确定的,在此不做限定。Alternatively, the encrypted initial authentication credential PSK can satisfy: R=HMAC(PSK, Nonce-2|Nonce-1); of course, the encrypted initial authentication credential PSK can also be generated according to the first random number and the second random number. The random number is determined. The generation method of the third random number is not limited to the above-mentioned connection method, and may also be determined by an operation method, which is not limited here.
方式J2:第一设备基于第二设备的第一随机数,确定目标认证凭证PSK。Manner J2: The first device determines the target authentication credential PSK based on the first random number of the second device.
一种可能的实现方式,目标认证凭证PSK可以是加密的初始认证凭证PSK,加密的初始认证凭证PSK可以满足:R=HMAC(PSK,Nonce-1)。In a possible implementation manner, the target authentication credential PSK may be an encrypted initial authentication credential PSK, and the encrypted initial authentication credential PSK may satisfy: R=HMAC(PSK, Nonce-1).
需要说明的是,上述加密函数还可以是其他加密函数,例如,KDF函数,也可以是伪随机函数PRF,还可以是哈希函数为基础的密钥导出函数HKDF,在此不做限定。It should be noted that the above encryption function may also be other encryption functions, for example, a KDF function, a pseudo-random function PRF, or a hash function-based key derivation function HKDF, which is not limited here.
步骤605:第一设备向第二设备发送第一认证消息。Step 605: The first device sends a first authentication message to the second device.
其中,第一认证消息可以包括以下至少一项:设备ID,固件版本号,初始校验值Seed计数器的值Counter,目标认证凭证,校验序列D。需要说明的是,为节省认证消息的长度,第一认证消息中可以先不携带校验序列D,在确定目标认证凭证认证失败时,再发送校验序列以确定具体的校验失败的层。或者,在第一设备需要验证具体的校验失败的层时,才向第二设备发送校验序列,以验证具体的校验失败的层。The first authentication message may include at least one of the following: device ID, firmware version number, initial check value Seed counter value Counter, target authentication credential, and check sequence D. It should be noted that, in order to save the length of the authentication message, the first authentication message may not carry the verification sequence D, and when it is determined that the target authentication credential fails to authenticate, the verification sequence is sent to determine the specific layer that failed the verification. Alternatively, only when the first device needs to verify the specific layer that fails the verification, it sends a verification sequence to the second device to verify the layer that fails to verify the specific verification.
一种可能的实现方式,第一认证消息可以为Client Hello消息,该第一认证消息可以包括以下至少一项:会话标识、第二随机数,设备ID,固件版本号,Seed计数器的值Counter,加密的初始认证凭证PSK(目标认证凭证),加密的校验序列D(可以是包括n个待认证层的加密固件密码值)。其中,加密的校验序列D可以是与加密的初始认证凭证PSK(目标认证凭证)相同的生成方式,例如,生成的加密的校验序列D可以满足:A possible implementation manner, the first authentication message may be a Client Hello message, and the first authentication message may include at least one of the following: a session identifier, a second random number, a device ID, a firmware version number, and a Seed counter value Counter, The encrypted initial authentication credential PSK (target authentication credential), the encrypted check sequence D (which may be an encrypted firmware password value including n layers to be authenticated). Wherein, the encrypted verification sequence D can be generated in the same manner as the encrypted initial authentication credential PSK (target authentication credential). For example, the generated encrypted verification sequence D can satisfy:
X=(X1,X2,…,Xn)X=(X 1 , X 2 , . . . , X n )
其中,针对n个待认证层的第i个加密固件密码值,可以满足:Among them, for the i-th encrypted firmware password value of the n layers to be authenticated, it can satisfy:
Xi=(HMAC(Secreti,Nonce-1|Nonce-2)X i =(HMAC(Secret i ,Nonce-1|Nonce-2)
或者,针对n个待认证层的第i个加密固件密码值,可以满足:Or, for the i-th encrypted firmware password value of the n layers to be authenticated, it can satisfy:
Xi=(HMAC(Secreti,Nonce-1)X i =(HMAC(Secret i ,Nonce-1)
具体可以参考方式J1和方式J2,在此不再赘述。For details, reference may be made to manners J1 and J2, which will not be repeated here.
在第一认证消息中,设备ID可以通过Client Hello消息中的pre-share-key扩展(Extension)中的PSK Identity携带。固件版本号,Seed计数器的值、加密的初始认证凭证PSK,加密的校验序列D可以通过Client Hello消息中的新增自定义扩展项携带,当然,还可以有其他携带方式,在此不做限定。In the first authentication message, the device ID may be carried by the PSK Identity in the pre-share-key extension (Extension) in the Client Hello message. Firmware version number, Seed counter value, encrypted initial authentication certificate PSK, and encrypted check sequence D can be carried through the new custom extension in the Client Hello message. limited.
步骤606:第二设备对第一认证消息中的初始校验值Seed进行认证。Step 606: The second device authenticates the initial verification value Seed in the first authentication message.
具体认证方式,可以参考步骤502,在此不再赘述。For the specific authentication method, reference may be made to step 502, which will not be repeated here.
在步骤606中,当初始校验值Seed认证失败时,则执行步骤609;当初始校验值Seed认证成功时,执行步骤607;In step 606, when the initial verification value Seed authentication fails, execute step 609; when the initial verification value Seed authentication succeeds, execute step 607;
步骤607:第二设备对目标认证凭证进行认证。Step 607: The second device authenticates the target authentication credential.
具体认证方式,可以参考步骤502a,在此不再赘述。For the specific authentication method, reference may be made to step 502a, which will not be repeated here.
以目标认证凭证为通过第一随机数和第二随机数据加密后的初始认证凭证为例,第二设备可以确定PSK*,从而确定加密的PSK*,即标准校验秘钥R*=HMAC(PSK*,Nonce-1|Nonce-2);若R*=R,且Firmware Version被服务器认定为可接受,则判定设备固件合法,执行步骤608;否则,执行步骤609;Taking the target authentication credential as the initial authentication credential encrypted by the first random number and the second random data as an example, the second device can determine the PSK*, thereby determining the encrypted PSK*, that is, the standard verification key R*=HMAC( PSK*, Nonce-1|Nonce-2); if R*=R, and the Firmware Version is determined as acceptable by the server, it is determined that the device firmware is legal, and step 608 is performed; otherwise, step 609 is performed;
步骤608:第二设备与第一设备进行会话协商,执行DTLS后续标准握手过程。Step 608: The second device performs session negotiation with the first device, and performs a DTLS subsequent standard handshake process.
具体的,可以包括:第一设备与第二设备发起对会话秘钥的协商过程,并验证会话秘钥的一致性,从而完成握手过程,以便后续第一设备可以向第二设备发送数据。Specifically, it may include: the first device and the second device initiate a negotiation process for the session key, and verify the consistency of the session key, thereby completing the handshake process, so that the first device can send data to the second device subsequently.
步骤609:DTLS握手过程断开,本流程结束。Step 609: The DTLS handshake process is disconnected, and the process ends.
需要说明的是,步骤601-步骤609中第二设备向第一设备发送第一随机数的过程从而实现认证的过程,也可以被其他的认证过程所替换,或者,也可以有任意的一个或多个步骤不必执行,例如步骤601可以不必执行,即第二设备可以无需向第一设备发送第一随机数,第一设备可以根据设备的标识生成加密的初始认证凭证PSK,无需第一随机数。只要能够完成第二设备对第一设备的认证即可。It should be noted that the process of the second device sending the first random number to the first device in steps 601 to 609 to realize the authentication process can also be replaced by other authentication processes, or, there can be any one or Multiple steps do not have to be performed, for example, step 601 does not have to be performed, that is, the second device does not need to send the first random number to the first device, and the first device can generate an encrypted initial authentication credential PSK according to the device's identity, without the first random number. . It only needs to be able to complete the authentication of the first device by the second device.
进一步的,步骤607中,还可以对每个待认证层中的固件代码进行验证,例如,在确定设备固件不合法时,第二设备可以向第一设备发送第一认证响应,以向第一设备返回目标认证凭证验证失败的消息。具体可以包括:Further, in step 607, the firmware code in each layer to be authenticated can also be verified. For example, when it is determined that the device firmware is invalid, the second device can send a first authentication response to the first device to send the first authentication response to the first device. The device returns a message that the target authentication credential verification failed. Specifically, it can include:
步骤6010:第二设备向第一设备发送第一认证响应消息。Step 6010: The second device sends a first authentication response message to the first device.
其中,第一认证响应消息可以为Server Hello消息。The first authentication response message may be a Server Hello message.
在该Server Hello消息中的新增自定义扩展选项,携带“目标认证凭证验证失败”的指示信息。A new custom extension option is added in the Server Hello message, carrying the indication information of "Target Authentication Credential Verification Failed".
步骤6011:第一设备向第二设备发送第二认证请求消息。Step 6011: The first device sends a second authentication request message to the second device.
其中,该第二认证请求消息可以携带n个待认证层的加密固件密码值,或者,第i个待认证层的加密固件密码值。The second authentication request message may carry the encrypted firmware password values of n layers to be authenticated, or the encrypted firmware password value of the i-th layer to be authenticated.
一种可能的实现方式,第一设备可以基于与方式J1和方式J2中的确定加密的初始认证凭证PSK的方式,确定n个待认证层的加密固件密码值。举例来说,针对第i个待认证层的加密固件密码值可以满足:In a possible implementation manner, the first device may determine the encrypted firmware password values of the n layers to be authenticated based on the manner of determining the encrypted initial authentication credential PSK in manners J1 and J2. For example, the encrypted firmware password value for the ith layer to be authenticated can satisfy:
Xi=(HMAC(Secreti,Nonce-1|Nonce-2)X i =(HMAC(Secret i ,Nonce-1|Nonce-2)
其中,第一设备可以仅携带第i个待认证层的加密固件密码值,也可以将n个待认证层的加密固件密码值全部发送给第二设备,在此不做限定。The first device may only carry the encrypted firmware password value of the i-th layer to be authenticated, or may send all the encrypted firmware password values of the n layers to be authenticated to the second device, which is not limited herein.
举例来说,待认证层的加密固件密码值可以在Client Hello消息中新增自定义扩展选项中携带,也可以是与原扩展选项复用,在此不做限定。For example, the encrypted firmware password value of the layer to be authenticated can be carried in the custom extension option added in the Client Hello message, or it can be multiplexed with the original extension option, which is not limited here.
步骤6012:第一设备向第二设备发送第二认证响应消息。Step 6012: The first device sends a second authentication response message to the second device.
第二认证响应消息用于指示第一设备中的认证失败的待认证层。例如,若确定n个待认证层中,有2个待认证层认证失败,(例如,第0层,第2层),则可以在第二认证响应消息中携带第0层和第二层认证失败的指示信息。The second authentication response message is used to indicate the to-be-authenticated layer in the first device whose authentication has failed. For example, if it is determined that among the n layers to be authenticated, 2 layers to be authenticated fail to be authenticated (for example, layer 0, layer 2), the second authentication response message can carry layer 0 and layer 2 authentication Indication of failure.
进一步的,第二设备还可以根据第一认证响应或第二认证响应,确定响应的安全策略。Further, the second device may also determine the security policy of the response according to the first authentication response or the second authentication response.
第一执行策略例如包括,第一设备停止工作,或第一设备停止使用该第一设备的部分功能。以第一设备来说,第一执行策略可以包括,第一设备停止工作,或第一设备停止使用第一设备的部分功能。这里的部分功能,可以是与第i个待认证层相关的功能。第一执行策略可以是第一设备执行,也可以是第二设备执行。如果第一执行策略应该由第一设备执行,则第二设备可以向第一设备发送指示信息,第一设备接收来自第二设备的指示信息,指示信息用于指示第一执行策略。或者,第一执行策略可以由第二设备执行,则第二设备可以不向第一设备发送指示信息,而是自行执行第一执行策略即可,即阻止第i个待认证层相关的功能的相关业务的请求。The first execution strategy includes, for example, that the first device stops working, or the first device stops using some functions of the first device. For the first device, the first execution strategy may include that the first device stops working, or the first device stops using some functions of the first device. Some of the functions here may be functions related to the i-th layer to be authenticated. The first execution policy may be executed by the first device or executed by the second device. If the first execution strategy should be executed by the first device, the second device may send indication information to the first device, and the first device receives indication information from the second device, where the indication information is used to indicate the first execution strategy. Alternatively, the first execution strategy may be executed by the second device, and the second device may not send the instruction information to the first device, but execute the first execution strategy by itself, that is, prevent the function of the i-th layer to be authenticated. related business requests.
下面结合附图介绍本申请实施例中用来实现上述方法的装置。因此,上文中的内容均可以用于后续实施例中,重复的内容不再赘述。The apparatus for implementing the above method in the embodiments of the present application will be described below with reference to the accompanying drawings. Therefore, the above content can be used in subsequent embodiments, and repeated content will not be repeated.
图7为本申请实施例提供的通信装置700的示意性框图。通信装置700可以是通信设备,或是能够支持通信设备实现该方法所需的功能的装置,例如芯片系统。示例性地,通信设备为物联网设备。示例性地,通信设备例如为第一设备700。FIG. 7 is a schematic block diagram of a communication apparatus 700 according to an embodiment of the present application. The communication apparatus 700 may be a communication device, or a device capable of supporting the communication device to implement the functions required by the method, such as a chip system. Illustratively, the communication device is an Internet of Things device. Exemplarily, the communication device is, for example, the first device 700 .
通信装置700包括处理模块710和收发模块720。示例性地,通信装置700可以是第一设备,也可以是应用于第一设备中的芯片或者其他具有上述第一设备功能的组合器件、部件等。当通信装置700是第一设备时,收发模块720可以是收发器,可以包括天线和射频电路等,处理模块710可以是处理器,例如基带处理器,基带处理器中可以包括一个或多个中央处理单元(central processing unit,CPU)。当通信装置700是具有上述第一设备的功能的部件时,收发模块720可以是射频单元,处理模块710可以是处理器,例如基带处理器。当通信装置700是芯片系统时,收发模块720可以是芯片系统(例如基带芯片)的输入输出接口、处理模块可以是芯片系统的处理器,可以包括一个或多个中央处理单元。The communication device 700 includes a
其中,处理模块710可以用于执行图4a所示的实施例中由第一设备所执行的除了收发操作之外的全部操作,和/或用于支持本文所描述的技术的其它过程。收发模块720可以用于执行图4a所示的实施例中由第一设备所执行的全部收发操作。The
或者,处理模块710可以用于执行图5或图6所示的实施例中由第一设备所执行的除了收发操作之外的全部操作,和/或用于支持本文所描述的技术的其它过程。收发模块720可以用于执行图5或图6所示的实施例中由第一设备所执行的全部收发操作。Alternatively, the
另外,收发模块720可以是一个功能模块,该功能模块既能完成发送操作也能完成接收操作,例如收发模块720可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为收发模块720是发送模块,而在执行接收操作时,可以认为收发模块720是接收模块;或者,收发模块720也可以是两个功能模块的统称,这两个功能模块分别为发送模块和接收模块,发送模块用于完成发送操作,例如发送模块可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作,接收模块用于完成接收操作,例如接收模块可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部接收操作。In addition, the
例如,处理模块710,用于在启动认证过程时,确定初始校验值;所述初始校验值用于标记本次认证过程;依次针对所述n个待认证层的第i个待认证层执行下述处理,得到第n个待认证层的固件密码值:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;所述i大于等于1且小于或等于n-1的正整数;根据所述第i+1个待认证层的代码和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;所述第1个待认证层的固件密码值为根据所述第1个待认证层的代码确定的;第一设备根据所述第n个待认证层的固件密码值,生成初始认证凭证;所述初始认证凭证用于通过所述收发模块720向认证方进行认证。For example, the
作为一种可选的实施方式,处理模块710,用于对所述第i+1个待认证层的代码进行哈希,得到第i+1个待认证层的哈希值;对所述第i+1个待认证层的哈希值和所述第i个待认证层的第一校验值加密,得到所述第i+1个待认证层的固件密码值。As an optional implementation manner, the
作为一种可选的实施方式,处理模块710,用于对所述第i个待认证层的第一校验值进行哈希,得到所述第i+1个待认证层的第一校验值。As an optional implementation manner, the
作为一种可选的实施方式,处理模块710,用于确定所述第i个待认证层的固件密码值后,通过收发模块720向第i+1个待认证层输出所述第i+1个待认证层的第一校验值、所述第i+1个待认证层的固件密码值和所述初始校验值。As an optional implementation manner, the
作为一种可选的实施方式,处理模块710,还可以用于删除所述第i个待认证层的第一校验值、所述第i个待认证层的固件密码值。As an optional implementation manner, the
作为一种可选的实施方式,所述初始校验值为以下任一项:时间戳、计数器或随机数。As an optional implementation manner, the initial check value is any one of the following: a timestamp, a counter, or a random number.
结合如图5和图6所示的实施例,处理模块710,用于通过收发模块720向认证方发送第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;通过收发模块720接收来自所述认证方的第一认证响应;所述第一认证响应用于指示所述第一设备的认证结果。With reference to the embodiments shown in FIG. 5 and FIG. 6 , the
作为一种可选的实施方式,处理模块710,还用于在所述第一设备的认证结果为认证失败时,通过所述收发模块向所述认证方发送第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;As an optional implementation manner, the
收发模块720,还用于接收来自所述认证方的第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。The
作为一种可选的实施方式,收发模块720向所述认证方发送第二认证请求消息之前,还用于接收来自所述认证方的第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。As an optional implementation manner, before sending the second authentication request message to the authenticating party, the
一种可能的实现方式,所述第一认证请求消息还包括:所述n个待认证层的n个加密固件密码值;所述n个待认证层中的第i个待认证层的加密固件密码值为根据所述第i个待认证层的固件密码值进行加密后确定的;所述第一认证响应还用于指示所述n个待认证层中认证失败的待认证层。A possible implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the encrypted firmware of the i-th layer to be authenticated in the n layers to be authenticated The password value is determined after encryption according to the firmware password value of the i-th layer to be authenticated; the first authentication response is further used to indicate a layer to be authenticated that fails to be authenticated among the n layers to be authenticated.
一种可能的实现方式,收发模块720,还用于接收来自所述认证方的第一随机数;In a possible implementation manner, the
处理模块710,还用于根据所述第一随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;或者,根据所述第一随机数、第二随机数和所述初始认证凭证,生成加密后的所述初始认证凭证;所述第二随机数为所述第一设备确定的;所述目标认证凭证为根据加密后的所述初始认证凭证确定的。The
一种可能的实现方式,处理模块710,用于根据所述第一随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值;或者,处理模块710,用于根据所述第一随机数、所述第二随机数和所述第i个待认证层的固件密码值,生成所述第i个待认证层的加密固件密码值。A possible implementation, the
一种可能的实现方式,所述第一认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败;所述第二认证响应,包括以下至少一项:所述初始校验值认证失败、所述目标认证凭证认证失败、所述第i个待认证层认证失败。A possible implementation manner, the first authentication response includes at least one of the following: the initial verification value authentication fails, the target authentication credential authentication fails; the second authentication response includes at least one of the following: The authentication of the initial check value fails, the authentication of the target authentication credential fails, and the authentication of the i-th layer to be authenticated fails.
应理解,本申请实施例中的处理模块710可以由处理器或处理器相关电路组件实现,收发模块720可以由收发器或收发器相关电路组件实现。It should be understood that the
如图8所示,本申请实施例还提供一种通信装置800。示例性地,通信装置800例如为第一设备800。示例性地,通信装置800可以是通信设备,例如为物联网设备,或者也可以是芯片系统等。通信装置800包括处理器810。可选的,还可以包括存储器820。可选的,还可以包括收发器830。其中,存储器820中存储计算机指令或程序,处理器810可以执行存储器820中存储的计算机指令或程序。存储器820中存储的计算机指令或程序被执行时,该处理器810用于执行上述实施例中处理模块710执行的操作,收发器830用于执行上述实施例中收发模块720执行的操作。或者,通信装置800也可以不包括存储器820,例如存储器位于通信装置800外部,在外部存储器所存储的计算机指令或程序被执行时,该处理器810用于执行上述实施例中处理模块710执行的操作,收发器830用于执行上述实施例中收发模块720执行的操作。As shown in FIG. 8 , an embodiment of the present application further provides a communication apparatus 800 . Exemplarily, the communication apparatus 800 is, for example, the first device 800 . Exemplarily, the communication apparatus 800 may be a communication device, such as an IoT device, or may also be a chip system or the like. The communication device 800 includes a
其中,收发器830可以是一个功能单元,该功能单元既能完成发送操作也能完成接收操作,例如收发器830可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为收发器830是发送器,而在执行接收操作时,可以认为收发器830是接收器;或者,收发器830也可以是两个功能单元的统称,这两个功能单元分别为发送器和接收器,发送器用于完成发送操作,例如发送器可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作,接收器用于完成接收操作,例如接收器可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部接收操作。Wherein, the
另外,如果通信装置800是芯片系统,则收发器830也可以通过该芯片系统的通信接口实现,该通信接口与通信设备中的射频收发组件连接,以通过射频收发组件实现信息的收发。通信接口可以是一个功能单元,该功能单元既能完成发送操作也能完成接收操作,例如通信接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为通信接口是发送接口,而在执行接收操作时,可以认为通信接口是接收接口;或者,通信接口也可以是两个功能单元的统称,这两个功能单元分别为发送接口和接收接口,发送接口用于完成发送操作,例如发送接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部发送操作,接收接口用于完成接收操作,例如接收接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第一设备所执行的全部接收操作。In addition, if the communication apparatus 800 is a chip system, the
应理解,根据本申请实施例的通信装置700或通信装置800可实现图4a所示的实施例至图6所示的实施例中的任一个实施例中的第一设备的功能,并且通信装置700或通信装置800中的各个模块的操作和/或功能分别为了实现图4a所示的实施例至图6所示的实施例中的任一个实施例中的相应流程,为了简洁,在此不再赘述。It should be understood that the communication apparatus 700 or the communication apparatus 800 according to this embodiment of the present application may implement the function of the first device in any one of the embodiments shown in FIG. 4a to the embodiments shown in FIG. 6 , and the communication apparatus The operations and/or functions of the modules in 700 or the communication device 800 are respectively to implement the corresponding process in any one of the embodiments shown in FIG. 4a to the embodiment shown in FIG. Repeat.
图9为本申请实施例提供的通信装置900的示意性框图。通信装置900可以是通信设备,或是能够支持通信设备实现该方法所需的功能的装置,例如芯片系统。示例性地,通信设备为第二设备。示例性地,通信设备例如为认证方的服务器等。FIG. 9 is a schematic block diagram of a communication apparatus 900 provided by an embodiment of the present application. The communication apparatus 900 may be a communication device, or a device capable of supporting the communication device to implement the functions required by the method, such as a chip system. Exemplarily, the communication device is the second device. Illustratively, the communication device is, for example, an authenticator's server or the like.
通信装置900包括处理模块910和收发模块920。示例性地,通信装置900可以是第二设备,也可以是应用于第二设备中的芯片或者其他具有上述第二设备功能的组合器件、部件等。当通信装置900是第二设备时,收发模块920可以是收发器,可以包括天线和射频电路等,处理模块910可以是处理器,例如基带处理器,基带处理器中可以包括一个或多个中央处理单元(central processing unit,CPU)。当通信装置900是具有上述第二设备的功能的部件时,收发模块920可以是射频单元,处理模块910可以是处理器,例如基带处理器。当通信装置900是芯片系统时,收发模块920可以是芯片系统(例如基带芯片)的输入输出接口、处理模块可以是芯片系统的处理器,可以包括一个或多个中央处理单元。The communication device 900 includes a
其中,处理模块910可以用于执行图4a所示的实施例中由第二设备所执行的除了收发操作之外的全部操作,和/或用于支持本文所描述的技术的其它过程。收发模块920可以用于执行图4a所示的实施例中由第二设备所执行的全部收发操作。The
或者,处理模块910可以用于执行图5或图6所示的实施例中由第二设备所执行的除了收发操作之外的全部操作,和/或用于支持本文所描述的技术的其它过程。收发模块920可以用于执行图5或图6所示的实施例中由第二设备所执行的全部收发操作。Alternatively, the
另外,收发模块920可以是一个功能模块,该功能模块既能完成发送操作也能完成接收操作,例如收发模块920可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为收发模块920是发送模块,而在执行接收操作时,可以认为收发模块920是接收模块;或者,收发模块920也可以是两个功能模块的统称,这两个功能模块分别为发送模块和接收模块,发送模块用于完成发送操作,例如发送模块可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作,接收模块用于完成接收操作,例如接收模块可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部接收操作。In addition, the
例如,收发模块920,用于接收来自第一设备的第一认证请求消息;所述第一认证请求消息包括:所述初始校验值和目标认证凭证;所述目标认证凭证为根据所述初始认证凭证确定的;所述第一认证请求消息用于对所述第一设备请求认证;For example, the
处理模块910,用于对所述第一认证请求消息进行认证;根据所述第一认证请求消息的认证结果,通过所述收发模块向所述第一设备发送第一认证响应;所述第一认证响应用于指示所述第一设备认证结果。A
作为一种可选的实施方式,所述初始校验值为时间戳,则处理模块910,用于根据当前时间,对所述初始校验值进行认证;或者,As an optional implementation manner, if the initial verification value is a timestamp, the
所述第一校验值为计数器,则处理模块910,用于将所述初始校验值与第二校验值比较,对所述初始校验值进行认证;所述第二校验值为所述第一设备上一次发送的初始校验值;If the first check value is a counter, the
所述第一校验值为随机数,则处理模块910,用于根据所述初始校验值与所述第一设备发送的所有历史初始校验值比较,对所述第一校验值进行认证。The first check value is a random number, then the
作为一种可选的实施方式,处理模块910,用于根据所述第一设备的n个待认证层的n个标准哈希值及所述第一校验值,生成n个标准固件密码值;根据所述n个标准固件密码值,生成标准校验秘钥;将所述标准校验秘钥与所述目标认证凭证比较,确定所述目标认证凭证是否认证成功。As an optional implementation manner, the
作为一种可选的实施方式,处理模块910,用于针对n个待认证层中的第i个待认证层,执行:根据所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的第一校验值;所述第1个待认证层的第一校验值为根据所述初始校验值确定的;i为大于等于1且小于或等于n-1的正整数;根据所述第i+1个待认证层的标准哈希值和所述第i个待认证层的第一校验值,确定所述第i+1个待认证层的固件密码值;所述第1个待认证层的固件密码值为根据所述第1个待认证层的标准哈希值确定的。As an optional implementation manner, the
作为一种可选的实施方式,处理模块910,用于在所述第一设备认证结果为所述目标认证凭证的认证结果为失败,则通过所述收发模块接收来自所述第一设备的第二认证请求消息;所述第二认证请求消息包括:第i个待认证层的加密固件密码值;所述加密固件密码值为根据所述第i个待认证层的固件密码值确定的;所述第二认证请求消息用于对所述第一设备的所述第i个待认证层请求认证;对所述第i个待认证层的加密固件密码值进行认证,根据所述第i个待认证层的加密固件密码值的认证结果,通过所述收发模块向所述第一设备发送第二认证响应;所述第二认证响应用于指示所述第i个待认证层的认证结果。As an optional implementation manner, the
作为一种可选的实施方式,收发模块920,还用于向所述第一设备发送第三认证请求消息;所述第三认证请求消息用于请求获取所述第i个待认证层的加密固件密码值。As an optional implementation manner, the
作为一种可选的实施方式,处理模块910,还用于根据所述n个标准固件密码值中的第i个标准固件密码值,确定加密后的第i个标准固件密码值;将所述加密后的第i个标准固件密码值与所述第i个待认证层的加密固件密码值进行比较,确定所述第i个待认证层是否认证成功。As an optional implementation manner, the
作为一种可选的实施方式,所述第一认证请求消息还包括:n个待认证层的n个加密固件密码值;处理模块910,还用于对所述n个待认证层的n个加密固件密码值分别进行认证,以确定认证失败的待认证层;所述第一认证响应还用于指示认证失败的待认证层。As an optional implementation manner, the first authentication request message further includes: n encrypted firmware password values of the n layers to be authenticated; the
作为一种可选的实施方式,处理模块910,还用于通过所述收发模块向所述第一设备发送第一随机数;其中,所述目标认证凭证为根据所述第一随机数和所述初始认证凭证生成的;或者,所述目标认证凭证为根据所述第一随机数、第二随机数和所述初始认证凭证生成的;所述第二随机数为所述第一设备确定的。As an optional implementation manner, the
作为一种可选的实施方式,所述第i个待认证层的加密固件密码值为根据所述第一随机数和所述第i个待认证层的固件密码值生成的;或者,所述第i个待认证层的加密固件密码值为根据所述第一随机数、第二随机数和所述第i个待认证层的固件密码值生成的。As an optional implementation manner, the encrypted firmware password value of the i-th layer to be authenticated is generated according to the first random number and the firmware password value of the i-th layer to be authenticated; or, the The encrypted firmware password value of the i-th layer to be authenticated is generated according to the first random number, the second random number, and the firmware password value of the i-th layer to be authenticated.
应理解,本申请实施例中的处理模块910可以由处理器或处理器相关电路组件实现,收发模块920可以由收发器或收发器相关电路组件实现。It should be understood that the
如图10所示,本申请实施例还提供一种通信装置1000。示例性地,通信装置1000例如为第二设备。示例性地,通信装置1000可以是通信设备,例如为物联网设备,或者也可以是芯片系统等。通信装置1000包括处理器1010。可选的,还可以包括存储器1020。可选的,还可以包括收发器1030。其中,存储器1020中存储计算机指令或程序,处理器1010可以执行存储器1020中存储的计算机指令或程序。存储器1020中存储的计算机指令或程序被执行时,该处理器1010用于执行上述实施例中处理模块910执行的操作,收发器1030用于执行上述实施例中收发模块920执行的操作。或者,通信装置1000也可以不包括存储器1020,例如存储器位于通信装置1000外部,在外部存储器所存储的计算机指令或程序被执行时,该处理器1010用于执行上述实施例中处理模块910执行的操作,收发器1030用于执行上述实施例中收发模块920执行的操作。As shown in FIG. 10 , an embodiment of the present application further provides a communication apparatus 1000 . Exemplarily, the communication apparatus 1000 is, for example, the second device. Exemplarily, the communication apparatus 1000 may be a communication device, such as an IoT device, or may also be a chip system or the like. The communication device 1000 includes a processor 1010 . Optionally, a memory 1020 may also be included. Optionally, a transceiver 1030 may also be included. The memory 1020 stores computer instructions or programs, and the processor 1010 can execute the computer instructions or programs stored in the memory 1020 . When the computer instructions or programs stored in the memory 1020 are executed, the processor 1010 is configured to perform the operations performed by the
其中,收发器1030可以是一个功能单元,该功能单元既能完成发送操作也能完成接收操作,例如收发器1030可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为收发器1030是发送器,而在执行接收操作时,可以认为收发器1030是接收器;或者,收发器1030也可以是两个功能单元的统称,这两个功能单元分别为发送器和接收器,发送器用于完成发送操作,例如发送器可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作,接收器用于完成接收操作,例如接收器可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部接收操作。Wherein, the transceiver 1030 may be a functional unit, and the functional unit can complete both the sending operation and the receiving operation. For example, the transceiver 1030 may be used to execute the embodiment shown in FIG. 4a to the embodiment shown in FIG. 6 . All transmit operations and receive operations performed by the second device in any embodiment, for example, when performing a transmit operation, the transceiver 1030 can be considered as a transmitter, and when performing a receive operation, the transceiver 1030 can be considered as a receiver. Alternatively, the transceiver 1030 may also be a general term for two functional units, the two functional units are a transmitter and a receiver respectively, the transmitter is used to complete the transmission operation, for example, the transmitter can be used to perform the implementation shown in FIG. 4a. For example to all the sending operations performed by the second device in any of the embodiments shown in FIG. 6, the receiver is used to complete the receiving operation. For example, the receiver may be used to perform the embodiment shown in FIG. 4a to FIG. All receiving operations performed by the second device in any of the embodiments shown in 6.
另外,如果通信装置1000是芯片系统,则收发器1030也可以通过该芯片系统的通信接口实现,该通信接口与通信设备中的射频收发组件连接,以通过射频收发组件实现信息的收发。通信接口可以是一个功能单元,该功能单元既能完成发送操作也能完成接收操作,例如通信接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作和接收操作,例如,在执行发送操作时,可以认为通信接口是发送接口,而在执行接收操作时,可以认为通信接口是接收接口;或者,通信接口也可以是两个功能单元的统称,这两个功能单元分别为发送接口和接收接口,发送接口用于完成发送操作,例如发送接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部发送操作,接收接口用于完成接收操作,例如接收接口可以用于执行图4a所示的实施例至图6所示的实施例中的任一个实施例中由第二设备所执行的全部接收操作。In addition, if the communication apparatus 1000 is a chip system, the transceiver 1030 can also be implemented through a communication interface of the chip system, and the communication interface is connected to a radio frequency transceiver component in the communication device to realize information transmission and reception through the radio frequency transceiver component. The communication interface can be a functional unit, which can complete both the sending operation and the receiving operation. For example, the communication interface can be used to execute any one of the embodiments shown in FIG. 4a to the embodiments shown in FIG. 6 . All sending operations and receiving operations performed by the second device in the It can also be a general term for two functional units. These two functional units are respectively a sending interface and a receiving interface. The sending interface is used to complete the sending operation. For example, the sending interface can be used to execute the embodiment shown in FIG. 4a to the one shown in FIG. 6 For all sending operations performed by the second device in any of the above embodiments, the receiving interface is used to complete the receiving operation. For example, the receiving interface may be used to perform the embodiment shown in FIG. 4a to the implementation shown in FIG. 6 . All receive operations performed by the second device in any of the examples.
应理解,根据本申请实施例的通信装置900或通信装置1000可实现图4a所示的实施例至图6所示的实施例中的任一个实施例中的第二设备的功能,并且通信装置900或通信装置1000中的各个模块的操作和/或功能分别为了实现图4a所示的实施例至图6所示的实施例中的任一个实施例中的相应流程,为了简洁,在此不再赘述。It should be understood that the communication apparatus 900 or the communication apparatus 1000 according to the embodiment of the present application may implement the function of the second device in any one of the embodiments shown in FIG. 4a to the embodiment shown in FIG. 6 , and the communication apparatus The operations and/or functions of each module in 900 or the communication device 1000 are respectively in order to realize the corresponding process in any one of the embodiments shown in FIG. 4a to the embodiment shown in FIG. Repeat.
本申请实施例还提供一种通信系统,该通信系统包括通信装置700或通信装置800,以及包括通信装置900或通信装置1000。An embodiment of the present application further provides a communication system, where the communication system includes the communication apparatus 700 or the communication apparatus 800 , and includes the communication apparatus 900 or the communication apparatus 1000 .
本申请实施例还提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如图4a中的任意一种可能的实施方式中所述的方法。Embodiments of the present application further provide a computer storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer can execute any one of the possibilities shown in FIG. 4a. The method described in the embodiment of .
本申请实施例还提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如图5中的任意一种可能的实施方式中所述的方法。Embodiments of the present application further provide a computer storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer can execute any one of the possibilities shown in FIG. 5 . The method described in the embodiment of .
本申请实施例还提供一种计算机存储介质,所述计算机可读存储介质用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如图6中的任意一种可能的实施方式中所述的方法。Embodiments of the present application further provide a computer storage medium, where the computer-readable storage medium is used to store a computer program, and when the computer program runs on a computer, the computer can execute any one of the possibilities shown in FIG. 6 . The method described in the embodiment of .
本申请实施例还提供一种包含指令的计算机程序产品,所述计算机程序产品用于存储计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行图4a至图6中的任意一种可能的实施方式中所述的方法。Embodiments of the present application further provide a computer program product including instructions, the computer program product is used to store a computer program, and when the computer program runs on a computer, the computer can execute any of the steps in FIG. 4a to FIG. 6 . The method described in a possible embodiment.
应理解,本申请实施例中提及的处理器可以是CPU,还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specificintegratedcircuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor mentioned in the embodiments of the present application may be a CPU, and may also be other general-purpose processors, digital signal processors (digital signal processors, DSPs), application specific integrated circuits (application specific integrated circuits, ASICs), off-the-shelf programmable processors Gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-onlymemory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double datarate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhancedSDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。It should also be understood that the memory mentioned in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable Except programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double datarate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and Direct memory bus random access memory (direct rambus RAM, DR RAM).
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)集成在处理器中。It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, the memory (storage module) is integrated in the processor.
应注意,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be noted that the memory described herein is intended to include, but not be limited to, these and any other suitable types of memory.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应所述以权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes within the technical scope disclosed in the embodiments of the present application. Or alternatives, all should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.
Claims (27)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010888232.0A CN114124394A (en) | 2020-08-28 | 2020-08-28 | A method and device for generating authentication credential and device authentication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010888232.0A CN114124394A (en) | 2020-08-28 | 2020-08-28 | A method and device for generating authentication credential and device authentication |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114124394A true CN114124394A (en) | 2022-03-01 |
Family
ID=80374994
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010888232.0A Pending CN114124394A (en) | 2020-08-28 | 2020-08-28 | A method and device for generating authentication credential and device authentication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114124394A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016633A (en) * | 2022-12-06 | 2023-04-25 | 上海哔哩哔哩科技有限公司 | Communication establishment method and system |
WO2024239280A1 (en) * | 2023-05-24 | 2024-11-28 | Oppo广东移动通信有限公司 | Communication methods and devices |
CN119046920A (en) * | 2023-05-29 | 2024-11-29 | 华为技术有限公司 | Authentication method, controller and computer equipment |
-
2020
- 2020-08-28 CN CN202010888232.0A patent/CN114124394A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016633A (en) * | 2022-12-06 | 2023-04-25 | 上海哔哩哔哩科技有限公司 | Communication establishment method and system |
WO2024239280A1 (en) * | 2023-05-24 | 2024-11-28 | Oppo广东移动通信有限公司 | Communication methods and devices |
CN119046920A (en) * | 2023-05-29 | 2024-11-29 | 华为技术有限公司 | Authentication method, controller and computer equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111095963B (en) | Method and apparatus for secure ranging | |
US10979412B2 (en) | Methods and apparatus for secure device authentication | |
US10972259B2 (en) | Lightweight and escrow-less authenticated key agreement for the internet of things | |
US11432150B2 (en) | Method and apparatus for authenticating network access of terminal | |
US10003966B2 (en) | Key configuration method and apparatus | |
US8331567B2 (en) | Methods and apparatuses for generating dynamic pairwise master keys using an image | |
TWI429254B (en) | Techniques for secure channelization between uicc and a terminal | |
US8010780B2 (en) | Methods and apparatus for providing integrity protection for management and control traffic of wireless communication networks | |
CA2956590C (en) | Apparatus and method for sharing a hardware security module interface in a collaborative network | |
CN109413645B (en) | Method and device for access authentication | |
CN112912878B (en) | Secure crypto processor | |
US12361412B2 (en) | Authentication method and apparatus of biometric payment device, computer device, and storage medium | |
US20050149730A1 (en) | Multi-authentication for a computing device connecting to a network | |
CN109361669A (en) | Identity authentication method, device and equipment of communication equipment | |
CN106101068A (en) | Terminal communicating method and system | |
JP2014180062A (en) | Secure session key generation | |
CN101807998A (en) | Authentication | |
CN111836260B (en) | Authentication information processing method, terminal and network equipment | |
CN114124394A (en) | A method and device for generating authentication credential and device authentication | |
Gupta et al. | An improved authentication scheme for BLE devices with no I/O capabilities | |
CN105307164B (en) | A kind of authentication method of wearable device | |
CN114189343A (en) | Mutual authentication method and device | |
CN116438822B (en) | Method and device for security authentication applied to WiFi | |
WO2022087984A1 (en) | Method and apparatus for software defined network handover | |
Asang et al. | Data Security on Internet of Things Device Using Hybrid Encryption Models |
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 |