Internet of Things, identity authentication and secure communication methods, chips, devices and media
By combining security chips and white box cryptography algorithms, the problem of computing resource gap between IoT devices in identity authentication and confidential communication is solved, and efficient key management and secure communication is realized. It is suitable for a variety of IoT devices, reducing development costs and improving security.
Patent Information
- Application Number
- CN201911389934.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2039-12-30
AI Technical Summary
There is a large gap in computing resources between identity authentication and confidential communications in IoT devices. The existing cryptography-based identity authentication methods are difficult to ensure the security and update of keys on resource-constrained devices, and the cryptographic algorithms implemented by software are vulnerable to attacks.
The identity authentication method is adopted that combines security chips and white box cipher algorithms. The security chips are used for high-security devices, and the white box cipher algorithm is used for low-security devices. The session key is generated through the hardware cipher algorithm and the true random number generator, and the key is automatically updated during the communication process.
It provides cost-effective security protection, is suitable for IoT devices with different security requirements, shortens development and deployment cycles, reduces development costs, and improves the security of M2M communication and the reliability of key management.
Smart Images

Figure CN113132087B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication security technologies, and specifically relates to the Internet of Things, identity authentication and secure communication methods, chips, devices and media. Background Art
[0002] As an extension of the Internet, the Internet of Things is essentially the interconnection of things and things, M2M. Information is collected through various sensors distributed in different geographical locations, and the information is integrated through the network to achieve centralized management and processing. The openness of the Internet of Things makes the devices therein vulnerable to attacks. Therefore, to achieve "interconnection of all things", secure communication is required as a technical support, and the prerequisite for achieving secure communication is to ensure the authenticity of the identities of both communication parties, which requires the use of identity authentication technology for guarantee.
[0003] M2M is short for "Machine to Machine", and can also be extended to "Machine to Mobile" in a broad sense, referring to the connection and communication between machines and machines, and between machines and mobile devices. M2M is one of the important support technologies in the Internet of Things, but in the Internet of Things environment, the M2M system faces many security problems, especially security problems in communication, which need to be solved by this key technology of identity authentication. From the perspective of cryptography, identity authentication can be completed by means such as passwords, cryptographic keys, challenge-response mechanisms, etc.
[0004] There are various types of devices in the Internet of Things, including devices with high costs, rich resources, and strong computing capabilities, as well as devices with low costs, limited resources, and weak computing capabilities. Therefore, how to solve the identity authentication between devices with a large gap in computing resources to ensure the secure communication of M2M is a difficult problem in the security of the Internet of Things. Identity authentication based on cryptography is widely used in the Internet, but when extended to the Internet of Things, considering the scenario of resource-constrained devices, there are still great challenges in the creation, distribution, storage and management of keys. When performing identity authentication based on cryptography, it is impossible to guarantee the update of keys during the initial distribution of device keys and in the case of no management.
[0005] There are multiple implementations of M2M identity authentication methods based on cryptography. Usually, the most commonly used one is to implement based on pure software cryptographic algorithms. The disadvantage of this method is that the security is not high enough, because the software code stored in the device, that is, the firmware, is easily extracted, and then the specific algorithm or even the key can be reverse-analyzed. Moreover, even if the firmware is protected, the cryptographic algorithm implemented by software has side information leakage during operation and is difficult to resist side-channel attacks.
[0006] A secure chip is a device that can provide secure cryptographic operations and key storage, and can be loaded into key devices in the Internet of Things, such as gateway devices, to provide storage protection for cryptographic operations and sensitive information such as keys at a high security level.
[0007] White-box cryptography is a cryptographic implementation technology that can resist white-box attacks (the attacker has complete control over the device terminal and can observe and modify the internal data during program operation). Essentially, it increases the complexity of the encryption and decryption programs, so that even if the attacker obtains the source code, they cannot reverse-analyze and restore the key. For resource-constrained Internet of Things devices, lightweight white-box cryptography can be used to implement identity authentication and data encryption when communicating with other devices.
[0008] Both secure chips and white-box cryptography can be used for M2M identity authentication. Secure chips can provide the most secure cryptographic operations and key storage known, but the cost is relatively high, and they are suitable for devices with high security requirements. White-box cryptography also has improved security compared to ordinary software-implemented cryptographic algorithms, and the cost is relatively low, making it suitable for devices with moderate security requirements. Summary of the Invention
[0009] An embodiment of the present application provides an Internet of Things, which includes at least one first device and at least one second device. A secure chip is configured inside the first device; a white-box cryptographic algorithm is configured inside the second device; wherein, the first device performs identity authentication and secure communication with the second device through the secure chip.
[0010] According to some embodiments, the first device includes at least one of a gateway and a server.
[0011] According to some embodiments, the second device includes a user terminal device.
[0012] According to some embodiments, the secure chip includes an authentication key generation module and a first authentication module. The authentication key generation module generates a corresponding authentication key for the second device; the first authentication module uses a hardware cryptographic algorithm to encrypt the mapping information of the sequence number of the communication message and the session key with the authentication key, and performs identity authentication with the second device.
[0013] According to some embodiments, the algorithm adopted by the authentication key generation module includes the ALG algorithm.
[0014] According to some embodiments, the hardware cryptographic algorithm is the same as the white-box cryptographic algorithm.
[0015] According to some embodiments, when the sequence number is an integer multiple of a preset session key update threshold, the session key is updated.
[0016] The embodiment of the present application further provides an identity authentication and secure communication method, which is applied to the first device described above. The method includes: receiving, by using a security chip, an authentication request from a second device, where the authentication request includes a sequence number and an authentication code of a communication message; generating, based on the authentication code, an authentication key corresponding to the second device by using a preset authentication key generation algorithm; determining a session key by using a true random number generator; encrypting, by using a hardware cryptographic algorithm in the security chip, mapping information of the sequence number and the session key with the authentication key, and performing mutual authentication with the second device, where the hardware cryptographic algorithm is the same as a white-box cryptographic algorithm; receiving encrypted data from the second device, where the encrypted data is encrypted based on the session key.
[0017] According to some embodiments, before receiving, by using the security chip, the authentication request from the second device, the method further includes: sending, by using the security chip, an authentication invitation to the second device, where the authentication invitation includes the sequence number.
[0018] According to some embodiments, encrypting, by using the hardware cryptographic algorithm in the security chip, mapping information of the sequence number and the session key with the authentication key, and performing mutual authentication with the second device includes: encrypting, by using the hardware cryptographic algorithm, a combination of the sequence number and the session key with the authentication key to obtain a first ciphertext; sending the first ciphertext to the second device; receiving a second ciphertext encrypted by the second device by using the white-box cryptographic algorithm for a combination of first mapping information of the sequence number and the session key; decrypting and authenticating the second ciphertext by using the hardware cryptographic algorithm; and sending a response ciphertext to the second device.
[0019] According to some embodiments, before sending the response ciphertext to the second device, the method further includes: encrypting, by using the hardware cryptographic algorithm, a combination of second mapping information of the sequence number, a confirmation symbol, the session key, and a preset session key update threshold to obtain the response ciphertext.
[0020] According to some embodiments, when the sequence number is an integer multiple of the session key update threshold, the session key is updated.
[0021] The embodiment of the present application further provides an identity authentication and secure communication method, which is applied to the second device described above. The method includes: the second device sending an authentication request to the security chip, where the authentication request includes a sequence number and an authentication code of a communication message; receiving a first ciphertext sent by the security chip; decrypting the first ciphertext by using the white-box cryptographic algorithm to obtain a session key; encrypting, by using the white-box cryptographic algorithm, mapping information of the sequence number and the session key, and performing mutual authentication with the security chip; and sending encrypted data to the security chip, where the encrypted data is encrypted based on the session key by using a software cryptographic algorithm.
[0022] According to some embodiments, before the second device sends an authentication request to the security chip, it further includes: the second device receives an authentication invitation from the security chip, and the authentication invitation includes the serial number.
[0023] According to some embodiments, the mutual authentication with the security chip by encrypting the mapping information of the serial number and the session key using the white-box cryptographic algorithm includes: encrypting the combination of the first mapping information of the serial number and the session key using the white-box cryptographic algorithm to form a second ciphertext; sending the second ciphertext to the security chip; receiving a response ciphertext from the security chip; decrypting and authenticating the response ciphertext using the white-box cryptographic algorithm.
[0024] According to some embodiments, the first ciphertext is obtained by the security chip using a hardware cryptographic algorithm consistent with the white-box cryptographic algorithm to encrypt the combination of the serial number and the session key using an authentication key.
[0025] According to some embodiments, the response ciphertext is obtained by the security chip using the hardware cryptographic algorithm to encrypt the combination of the second mapping information of the serial number, a confirmation symbol, the session key, and a preset session key update threshold.
[0026] According to some embodiments, when the serial number is an integer multiple of the session key update threshold, the security chip updates the session key.
[0027] An embodiment of the present application further provides a security chip, including an authentication request receiving module, an authentication key generation module, a session key determination module, a first authentication module, and a data receiving module. The authentication request receiving module receives an authentication request from a second device, and the authentication request includes a serial number and an authentication code of a communication message; the authentication key generation module generates an authentication key corresponding to the second device based on the authentication code using a preset authentication key generation algorithm; the session key determination module determines a session key using a true random number generator; the first authentication module uses a hardware cryptographic algorithm to encrypt the mapping information of the serial number and the session key using the authentication key to perform mutual authentication with the second device, and the hardware cryptographic algorithm is consistent with the white-box cryptographic algorithm; the data receiving module receives encrypted data from the second device, and the encrypted data is encrypted based on the session key.
[0028] According to some embodiments, the security chip further includes an authentication invitation sending module, and the authentication invitation sending module sends an authentication invitation to the second device, and the authentication invitation includes the serial number.
[0029] According to some embodiments, the first authentication module includes a first ciphertext determination unit, a first ciphertext sending unit, a second ciphertext receiving unit, a second ciphertext decryption unit, and a response ciphertext sending unit. The first ciphertext determination unit uses the hardware cryptography algorithm to encrypt the combination of the serial number and the session key with the authentication key to obtain a first ciphertext. The first ciphertext sending unit sends the first ciphertext to the second device. The second ciphertext receiving unit receives a second ciphertext from the second device, which is encrypted by using the white-box cryptography algorithm for the combination of the first mapping information of the serial number and the session key. The second ciphertext decryption unit decrypts and authenticates the second ciphertext by using the hardware cryptography algorithm. The response ciphertext sending unit sends a response ciphertext to the second device.
[0030] An embodiment of the present application further provides a device, including an authentication request sending module, a receiving module, a decryption module, a second authentication module, and a data sending module. The authentication request sending module sends an authentication request to the security chip, and the authentication request includes the serial number and the authentication code of the communication message. The receiving module receives a first ciphertext sent from the security chip. The decryption module decrypts and authenticates the first ciphertext by using the white-box cryptography algorithm to obtain a session key. The second authentication module encrypts the mapping information of the serial number and the session key by using the white-box cryptography algorithm to perform mutual authentication with the security chip. The data sending module sends encrypted data to the security chip, and the encrypted data is encrypted based on the session key by using a software encryption algorithm.
[0031] According to some embodiments, the device further includes an authentication invitation receiving module, and the authentication invitation receiving module receives an authentication invitation from the security chip, and the authentication invitation includes the serial number.
[0032] According to some embodiments, the second authentication module includes an encryption unit, a sending unit, a receiving unit, and an authentication unit. The encryption unit encrypts the combination of the first mapping information of the serial number and the session key by using the white-box cryptography algorithm to form a second ciphertext. The sending unit sends the second ciphertext to the security chip. The receiving unit receives a response ciphertext from the security chip. The authentication unit decrypts and authenticates the response ciphertext by using the white-box cryptography algorithm.
[0033] An embodiment of the present application further provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method described above is executed.
[0034] The technical solution provided by the embodiments of the present application can well solve the initialization of device keys by using security chips and white-box cryptography respectively according to the security requirements of IoT terminal devices. In the era of the Internet of Everything where various devices and systems generally pursue security and low cost, it can provide cost-effective security protection for M2M authentication, encryption and decryption of communication data, and preservation of sensitive information. It has strong versatility and does not require specific designs for different application scenarios, which can shorten the development and deployment cycles of IoT systems and save development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0036] Figure 1 is a schematic diagram of the composition of an IoT provided by an embodiment of the present application;
[0037] Figure 2 is a schematic flow chart of an authentication and secure communication method provided by an embodiment of the present application;
[0038] Figure 3 is a schematic flow chart of an authentication process provided by an embodiment of the present application;
[0039] Figure 4 is another schematic flow chart of an authentication and secure communication method provided by an embodiment of the present application;
[0040] Figure 5 is another schematic flow chart of an authentication process provided by an embodiment of the present application;
[0041] Figure 6 is a functional block diagram of a security chip provided by an embodiment of the present application;
[0042] Figure 7 is a functional block diagram of the first authentication module of a security chip provided by an embodiment of the present application;
[0043] Figure 8 is a functional block diagram of a device provided by an embodiment of the present application;
[0044] Figure 9 is a functional block diagram of the second authentication module of a device provided by an embodiment of the present application;
[0045] Figure 10 is a functional block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0047] Figure 1 It is a schematic diagram of the composition of the Internet of Things provided by the embodiments of the present application.
[0048] The Internet of Things includes at least one first device M1 and at least one second device M2. A security chip SE is configured inside the first device M1. A white-box cryptographic algorithm is configured inside the second device M2. The first device M1 performs identity authentication and secure communication with the second device M2 through the security chip SE.
[0049] As an extension of the Internet, the Internet of Things is essentially the interconnection of things and M2M. Information is collected through various sensors distributed at different geographical locations and integrated through the network to achieve centralized management and processing. The openness of the Internet of Things makes the devices in it vulnerable to attacks. Therefore, to achieve "interconnection of all things", secure communication is required as a technical support, and the prerequisite for achieving secure communication is to ensure the authenticity of the identities of both communication parties, which requires the use of identity authentication technology for guarantee.
[0050] There are various types of devices in the Internet of Things, including both devices with high costs, rich resources, and strong computing capabilities, and devices with low costs, limited resources, and weak computing capabilities. Therefore, in the embodiments of the present application, in order to solve the identity authentication between devices with a large gap in computing resources to ensure the secure communication of M2M, a security chip SE is loaded on the Internet of Things terminal device (M1) with high security requirements to achieve secure encryption and decryption, execution of key algorithms, and storage of sensitive information. For the Internet of Things terminal device (M2) with low security requirements, white-box cryptographic algorithms and software cryptographic algorithms are used to achieve encryption and decryption. For the sake of distinction, the terminal device M1 is called the first device, and the device M2 is called the second device.
[0051] The first device M1 includes but is not limited to at least one of a gateway and a server. The second device includes but is not limited to user terminal devices.
[0052] The secure chip SE internally includes a pre-set authentication key generation algorithm, a hardware cryptographic algorithm, and a true random number generator. The authentication key generation algorithm includes, but is not limited to, the ALG algorithm, and the authentication key generation algorithm generates a corresponding authentication key for the second device M2. The hardware cryptographic algorithm HWC is consistent with the white-box cryptographic algorithm WBC. Using the hardware cryptographic algorithm HWC, the mapping information of the serial number of the communication message and the session key encrypted with the authentication key are used to perform identity authentication with the second device M2. The true random number generator TRNG is used to determine the session key.
[0053] The second device M2 includes a software cryptographic algorithm SWC. After successful authentication, the second device M2 uses the software cryptographic algorithm SWC to encrypt data based on the session key and sends it to the first device M1.
[0054] Optionally, during identity authentication, in the M2M communication process, the initial distribution of the session key and in the case of unattended management, it is impossible to guarantee the update of the key. In the embodiments of the present application, a session key update threshold is preset. When the serial number of the communication message is an integer multiple of the preset session key update threshold, the session key is updated. It realizes secure identity authentication during M2M communication at a lower cost, reduces the risk of key leakage and identity forgery, increases the difficulty of attack, and can improve security.
[0055] The technical solution provided by this embodiment can respectively adopt a secure chip and white-box cryptography according to the high or low security requirements of Internet of Things terminal devices, and can well solve the initialization of device keys. In the era of the Internet of Everything where various devices and systems generally pursue security and low cost, it can provide economical and effective security protection for M2M identity authentication, communication data encryption and decryption, and the preservation of sensitive information. It has strong versatility and does not require specific designs to be redone for different application scenarios, which can shorten the development and deployment cycle of the Internet of Things system and save development costs.
[0056] Figure 2 It is a schematic flow diagram of an identity authentication and secure communication method provided by an embodiment of the present application, showing the identity authentication and secure communication process between the secure chip and the second device.
[0057] In S110, the first device M1 uses the secure chip to receive an authentication request from the second device. The authentication request includes the serial number of the communication message and the authentication code SN.
[0058] According to the high or low security requirements of Internet of Things terminal devices, secure chips and ordinary devices are respectively adopted at both ends of M2M. M2M is short for "Machine to Machine", and in a broad sense, it can also be extended to "Machine to Mobile", referring to the connection and communication between machines and machines, and between machines and mobile devices. M2M is one of the important supporting technologies in the Internet of Things.
[0059] Secure chips can provide the most secure cryptographic operations and key storage known, but they are relatively costly and are suitable for devices with high security requirements. White-box cryptography also offers enhanced security compared to ordinary software-implemented cryptographic algorithms and has a relatively low cost, making it suitable for devices with moderate security requirements. Combining secure chips and white-box cryptography for M2M authentication, along with key initial distribution and automatic update strategies, can provide cost-effective security protection for M2M authentication, communication data encryption and decryption, and the preservation of sensitive information.
[0060] For Internet of Things (IoT) terminal devices with high security requirements (M1), a secure chip SE is loaded to achieve secure encryption and decryption, execution of critical algorithms, and preservation of sensitive information. For IoT terminal devices with low security requirements (M2), symmetric white-box cryptography and software cryptography are used to achieve encryption and decryption. For the sake of distinction, the terminal device M1 is referred to as the first device, and the device M2 is referred to as the second device. The authentication key of the second device M2 is generated according to its SN using a specific algorithm during the production phase and is then implemented in its white-box cryptography. When the second device M2 needs to communicate with the first device M1, mutual authentication is performed between the first device M1 and the second device M2.
[0061] The first device M1 uses the secure chip SE to receive an authentication request Seq||SN from the second device M2. The authentication request includes the sequence number Seq of the communication message and the authentication code SN. The sequence number Seq serves as the identifier for communication between the secure chip SE and the second device M2. The authentication code SN is the identity identifier of the second device M2 and is the unique serial number of the second device M2's main control chip at the factory or the value obtained after special transformation (such as hashing) of the unique serial number, which can be traced back to all links in chip manufacturing and forward to the distribution channels of a certain batch of products.
[0062] Optionally, both the first device M1 and the second device M2 can be the initiating party for authentication. The first device M1 can also use the secure chip SE to actively send an authentication invitation to the second device M2. The authentication invitation includes the sequence number of the communication message. After receiving the authentication invitation, the second device M2 sends an authentication request to the first device M1. The authentication request includes the sequence number of the communication message and the authentication code SN of the second device. The first device M1 uses the secure chip to receive the authentication request from the second device.
[0063] In S120, the first device M1 uses the secure chip SE to generate the authentication key K2 corresponding to the device M2 based on the authentication code SN using a pre-set authentication key generation algorithm.
[0064] The secure chip SE internally pre-sets an authentication key generation algorithm, and the authentication key generation algorithm includes but is not limited to the ALG algorithm. The ALG algorithm is an authentication key generation algorithm pre-set in the secure chip SE. One implementation of the ALG algorithm is to perform a byte position transformation on the value of the SN, that is, a scrambling operation. Another implementation of the ALG algorithm is to obtain the authentication key by calculating the hash value of the transformed SN. The authentication key generation algorithm is used to generate the authentication key K2 corresponding to the device M2 based on the authentication code SN.
[0065] According to some embodiments, the secure chip SE communicates with multiple devices, and each device generates a corresponding authentication key. Here, the authentication key K2 is the authentication key corresponding to the device M2.
[0066] In S130, the first device M1 uses the true random number generator of the secure chip SE to determine the session key.
[0067] The secure chip SE can provide a true random number generator TRNG with a high security level. The true random number generator is a device that generates random numbers by collecting random noise signals during the operation of the chip, which is different from the random numbers generated by computer programs. The random number R1 is obtained by using the true random number generator TRNG, and the random number R1 is used as the session key.
[0068] In S140, the first device M1 uses the hardware cryptographic algorithm of the secure chip SE to encrypt the mapping information of the serial number and the session key using the authentication key, and performs mutual authentication with the device M2. The hardware cryptographic algorithm is the same as the white-box cryptographic algorithm.
[0069] For the second device M2 with lower security requirements, the white-box cryptographic algorithm is used for encryption and decryption. Then, the cryptographic algorithm adopted by the secure chip should be consistent with the white-box cryptographic algorithm to facilitate mutual decryption between the two.
[0070] The hardware cryptographic algorithm HWC is a cryptographic algorithm implemented by integrated circuits, including but not limited to the international cryptographic algorithm AES and the domestic cryptographic algorithm SM4.
[0071] In S150, the secure chip SE receives the encrypted data from the device, and the encrypted data is encrypted based on the session key.
[0072] The device M2 encrypts the data to be transmitted based on the session key R1 using the software cryptographic algorithm. The software cryptographic algorithm SWC includes but is not limited to the international cryptographic algorithm AES and the domestic cryptographic algorithm SM4.
[0073] Optionally, each time the first device M1 receives an encrypted data packet sent by the device M2, it checks the serial number Seq of the communication data packet. Whenever the value of Seq is the preset session key update threshold W sWhen it is an integer multiple of, the first device M1 encrypts a new random number Rn with the authentication key of M2 as a new session key and sends it to M2 to ensure the regular update of the session key.
[0074] The technical solution provided in this embodiment can, according to the security requirements of Internet of Things terminal devices, respectively adopt a security chip and white-box cryptography, which can well solve the initialization of device keys and can automatically update the session key during the M2M secure communication process. In the era of Internet of Everything where various devices and systems generally pursue security and low cost, it can provide economical and effective security protection for M2M identity authentication, communication data encryption and decryption, and the preservation of sensitive information. It has strong versatility and does not require specific designs to be carried out again for different application scenarios, which can shorten the development and deployment cycle of the Internet of Things system and save development costs.
[0075] Figure 3 is a schematic diagram of an identity authentication process provided by an embodiment of the present application, showing Figure 2 the identity authentication process S140 between the security chip of and the second device.
[0076] As Figure 3 shown, in S141, the first device M1 uses the hardware cryptography algorithm of the security chip SE to encrypt the combination Seq||R1 of the serial number Seq and the session key R1 with the authentication key K2 to obtain the first ciphertext C1.
[0077] The hardware cryptography algorithm HWC is the same as the white-box cryptography algorithm. The hardware cryptography algorithm HWC includes at least one of the international cryptography algorithm AES and the domestic cryptography algorithm SM4.
[0078] In S142, the first device M1 uses the security chip SE to send the first ciphertext C1 to the second device M2.
[0079] In S143, the first device M1 uses the security chip SE to receive the second ciphertext encrypted by the second device M2 using the white-box cryptography algorithm for the combination of the first mapping information of the serial number and the session key.
[0080] After receiving the first ciphertext C1, the second device M2 calls the white-box cryptography algorithm WBC for decryption, and compares whether the serial number Seq in the decrypted Seq||R1 is correct. If it is correct, the first device M1 is considered trustworthy, and the second device M2 authenticates that the first device M1 passes.
[0081] M2 calls the white-box cryptography algorithm WBC to encrypt the combination (Seq + 1)||R1 of the first mapping information (Seq + 1) of the serial number and the session key R1 to obtain the second ciphertext C2, and sends the second ciphertext C2 to the first device M1.
[0082] In S144, the first device M1 decrypts and authenticates the second ciphertext C2 using the hardware cryptographic algorithm HWC of the secure chip SE.
[0083] The first device M1 invokes the hardware cryptographic algorithm HWC in the secure chip SE that is consistent with the WBC white-box cryptographic algorithm in M2, and uses the authentication key K2 to decrypt the second ciphertext C2 to obtain (Seq + 1)||R1. If the comparison of (Seq + 1)||R1 meets the expectation, it is considered that the second device M2 is trusted, and the first device M1 authenticates the second device M2 successfully.
[0084] In S145, the first device M1 uses the secure chip SE to send a response ciphertext to the second device M2.
[0085] The terminal M1 invokes the hardware cryptographic algorithm HWC in the secure chip SE that is consistent with the WBC white-box cryptographic algorithm in the second device M2, and uses the authentication key K2 to encrypt the combination of the second mapping information of the sequence number Seq, the confirmation symbol Ack, the session key R1, and the preset session key update threshold Ws, (Seq + 2)||Ack||R1||W s , to obtain the response ciphertext C3 and send it to the second device M2.
[0086] The second device M2 invokes the WBC white-box cryptographic algorithm to decrypt the response ciphertext C3 to obtain (Seq + 2)||Ack||R1||W s , and confirms that the mutual authentication is completed and data transmission can start. The session key is R1. Subsequently, the second device M2 invokes the software cryptographic algorithm SWC to encrypt data using the session key R1 and send it to the first device M1.
[0087] Figure 4 It is a schematic diagram of another identity authentication and secure communication method provided by an embodiment of the present application, showing the identity authentication and secure communication process between the second device and the secure chip.
[0088] In S210, the second device M2 sends an authentication request to the secure chip SE, and the authentication request includes the sequence number Seq and the authentication code SN of the communication message.
[0089] According to the security requirements of IoT terminal devices, secure chips and ordinary devices are respectively adopted at both ends of M2M. M2M is short for "Machine to Machine", and can also be extended to "Machine to Mobile" in a broad sense, referring to the connection and communication between machines and machines, and between machines and mobile devices. M2M is one of the important supporting technologies in the Internet of Things.
[0090] The secure element SE can provide the most secure known cryptographic operations and key storage, but at a relatively high cost, and is suitable for devices with high security requirements. White-box cryptography also offers enhanced security compared to ordinary software-implemented cryptographic algorithms and has a relatively low cost, making it suitable for devices with moderate security requirements. Combining the secure element SE and white-box cryptography for M2M authentication, along with key initial distribution and automatic update strategies, can provide cost-effective security protection for M2M authentication, communication data encryption and decryption, and the storage of sensitive information.
[0091] For Internet of Things (IoT) terminal devices with high security requirements (M1), a secure element SE is loaded to achieve secure encryption and decryption, execution of critical algorithms, and storage of sensitive information. For IoT terminal devices with low security requirements (M2), symmetric white-box cryptography and software cryptography are used to achieve encryption and decryption. For the sake of distinction, the terminal device M1 is referred to as the first device, and the device M2 is referred to as the second device. The authentication key of the second device M2 is generated according to its SN using a specific algorithm during the production phase and is then implemented in its white-box cryptography. When the second device M2 needs to communicate with the first device M1, two-way authentication is performed between the first device M1 and the second device M2.
[0092] The second device M2 sends an authentication request Seq||SN to the secure element SE. The authentication request Seq||SN includes the sequence number Seq of the communication message and the authentication code SN.
[0093] Optionally, both the first device M1 and the second device M2 can act as the active party initiating the authentication. The first device M1 can also use the secure element SE to actively send an authentication invitation to the second device M2. The authentication invitation includes the sequence number of the communication message. After receiving the authentication invitation, the second device M2 sends an authentication request to the first device M1, and the first device M1 uses the secure element to receive the authentication request from the second device.
[0094] In S220, the second device M2 receives the first ciphertext sent by the secure element SE.
[0095] The first device M1 uses the secure element SE to generate the authentication key K2 corresponding to the second device M2 based on the authentication code SN using a pre-set authentication key generation algorithm. The secure element SE has a pre-set authentication key generation algorithm inside, and the authentication key generation algorithm includes, but is not limited to, the ALG algorithm. The authentication key K2 corresponding to the second device M2 is generated based on the authentication code SN using the authentication key generation algorithm. The secure element SE can provide a true random number generator TRNG with a high security level, and the random number R1 is obtained using the true random number generator TRNG and used as the session key.
[0096] The first device M1 uses the security chip SE to encrypt the combination Seq||R1 of the serial number Seq and the session key R1 through the hardware cryptographic algorithm HWC using the authentication key K2, obtaining the first ciphertext C1. The second device M2 receives the first ciphertext C1 sent from the security chip SE.
[0097] In S230, the second device M2 decrypts and authenticates the first ciphertext using the white-box cryptographic algorithm to obtain the session key.
[0098] After receiving the first ciphertext C1, the second device M2 calls the white-box cryptographic algorithm WBC to decrypt it, obtaining the serial number Seq and the session key R1. It compares whether the serial number Seq is correct. If it is correct, the first device M1 is considered trustworthy, and the second device M2 authenticates that the first device M1 passes.
[0099] In S240, the second device M2 encrypts the mapping information of the serial number Seq and the session key R1 using the white-box cryptographic algorithm for mutual authentication with the security chip.
[0100] In S250, the second device M2 sends encrypted data to the security chip, and the encrypted data is encrypted using the software cryptographic algorithm based on the second mapping information of the session key and the serial number.
[0101] After the authentication passes, the second device M2 sends the encrypted data to the security chip SE. The software cryptographic algorithm includes at least one of the international cryptographic algorithm AES and the domestic cryptographic algorithm SM4 implemented by software.
[0102] Optionally, every time the first device M1 receives a data packet sent by the second device M2, it checks the serial number Seq of the communication data packet. Whenever the value of Seq is an integer multiple of the preset session key threshold W s the first device M1 encrypts a new random number Rn using the authentication key of the second device M2 as a new session key and sends it to the second device M2 to ensure the periodic update of the session key.
[0103] The technical solution provided in this embodiment can well solve the initialization of the device key and can automatically update the session key during the M2M secure communication process by respectively using the security chip and the white-box cipher according to the high or low security requirements of the Internet of Things terminal devices. In the era of the Internet of Everything where various devices and systems generally pursue security and low cost, it can provide economical and effective security protection for M2M identity authentication, communication data encryption and decryption, and the preservation of sensitive information. It has strong versatility and does not require specific designs for different application scenarios, which can shorten the development and deployment cycle of the Internet of Things system and save development costs.
[0104] Figure 5 is another schematic diagram of the identity authentication process provided by the embodiment of the present application, showingFigure 4 The identity authentication process S220 between the second device and the security chip.
[0105] In S221, the second device M2 uses the white-box cryptographic algorithm to encrypt the combination of the first mapping information of the serial number Seq and the session key R1 to form the second ciphertext.
[0106] The second device M2 invokes the white-box cryptographic algorithm WBC to encrypt the combination of the first mapping information of the serial number (Seq+1) and the session key R1, (Seq+1)||R1, to obtain the second ciphertext C2, and sends the second ciphertext C2 to the first device M1.
[0107] In S222, the second device M2 sends the second ciphertext to the security chip.
[0108] The first device M1 invokes the hardware cryptographic algorithm HWC in the security chip SE that is consistent with the white-box cryptographic algorithm WBC in the second device M2, and uses the authentication key K2 to decrypt the second ciphertext C2 to obtain (Seq+1)||R1. If the comparison of (Seq+1)||R1 meets the expectation, it is considered that the second device M2 is trusted, and the first device M1 authenticates the second device M2 successfully.
[0109] In S223, the second device M2 receives the response ciphertext from the security chip.
[0110] The first device M1 invokes the hardware cryptographic algorithm HWC in the security chip SE that is consistent with the WBC white-box cryptographic algorithm in the second device M2, and uses the authentication key K2 to encrypt the combination of the second mapping information of the serial number Seq, the confirmation symbol Ack, the session key R1, and the preset session key update threshold Ws, (Seq+2)||Ack||R1||W s , to obtain the response ciphertext C3, and sends it to the second device M2.
[0111] The second device M2 invokes the white-box cryptographic algorithm WBC to decrypt the response ciphertext C3 to obtain (Seq+2)||Ack||R1||W s , and confirms that the mutual authentication is completed and data transmission can start. The session key is R1. The second device M2 subsequently invokes SWC to encrypt the data using the session key R1 and sends it to the first device M1.
[0112] In S224, the second device M2 decrypts and authenticates the response ciphertext using the white-box cryptographic algorithm.
[0113] The second device M2 invokes the white-box cryptographic algorithm WBC to decrypt the response ciphertext C3 to obtain (Seq+2)||Ack||R1||W s, confirm that the mutual authentication is completed and data transmission can start. The session key is R1. Subsequently, the second device M2 calls the software cryptographic algorithm SWC to encrypt the data using the session key R1 and then sends it to the first device M1.
[0114] Figure 6 It is a functional block diagram of a security chip provided by an embodiment of the present application. The security chip SE includes an authentication request receiving module 11, an authentication key generation module 12, a session key determination module 13, a first authentication module 14, and a data receiving module 15.
[0115] The authentication request receiving module 11 receives an authentication request from the second device M2. The authentication request includes the sequence number Seq of the communication message and the authentication code SN. The authentication key generation module 12 generates an authentication key K2 based on the authentication code SN using a preset authentication key generation algorithm. The session key determination module 13 determines the session key R1 using a true random number generator. The first authentication module 14 uses the hardware cryptographic algorithm HWC to encrypt the mapping information of the sequence number Seq and the session key R1 with the authentication key K2 and performs mutual authentication with the second device M2. The hardware cryptographic algorithm HWC is the same as the white box cryptographic algorithm and can decrypt each other. The data receiving module 15 receives the encrypted data from the second device M2. The encrypted data is encrypted based on the mapping information of the session key R1 and the sequence number Seq.
[0116] Optionally, both the first device M1 and the second device M2 can be the active party initiating the authentication. The first device M1 can also actively send an authentication invitation to the second device M2 using the security chip SE. The authentication invitation includes the sequence number of the communication message. After receiving the authentication invitation, the second device M2 sends an authentication request to the first device M1. At this time, the security chip SE further includes an authentication invitation sending module, and the authentication invitation sending module sends an authentication invitation to the second device M2. The authentication invitation includes, but is not limited to, the sequence number Seq.
[0117] According to some embodiments, the first authentication module 14 includes a first ciphertext determination unit 141, a first ciphertext sending unit 142, a second ciphertext receiving unit 143, a second ciphertext decryption unit 144, and a response ciphertext sending unit 145, as Figure 7 shown.
[0118] The first ciphertext determination unit 141 uses the hardware cryptographic algorithm HWC to encrypt the combination of the serial number Seq and the session key R1 using the authentication key K2, obtaining the first ciphertext C1. The first ciphertext sending unit 142 sends the first ciphertext C1 to the second device M2. The second ciphertext receiving unit 143 receives the second ciphertext C2 from the second device M2, which is the encryption of the combination of the first mapping information of the serial number Seq and the session key R1 using the white-box cryptographic algorithm. The second ciphertext decryption unit 144 decrypts and authenticates the second ciphertext C2 using the hardware cryptographic algorithm HWC. The response ciphertext sending unit 145 sends the response ciphertext C3 to the second device M2.
[0119] Figure 8 It is a block diagram of the functional components of a device provided by an embodiment of the present application. The second device M2 includes an authentication request sending module 21, a receiving module 22, a decryption module 23, a second authentication module 24, and a data sending module 25.
[0120] The authentication request sending module 21 sends an authentication request Seq||SN to the secure chip SE. The authentication request Seq||SN includes the serial number Seq of the communication message and the authentication code SN. The receiving module 22 receives the first ciphertext C1 sent from the secure chip SE. The decryption module 23 decrypts and authenticates the first ciphertext C1 using the white-box cryptographic algorithm to obtain the session key R1. The second authentication module 24 encrypts the mapping information of the serial number Seq and the session key R1 using the white-box cryptographic algorithm and performs mutual authentication with the secure chip SE. The session key R1 is from the first ciphertext C1 sent by the secure chip SE. The data sending module 25 sends encrypted data to the secure chip SE, and the encrypted data is encrypted based on the session key R1 using the software cryptographic algorithm.
[0121] Optionally, both the first device M1 and the second device M2 can be the active parties initiating authentication. The first device M1 can also actively send an authentication invitation to the second device M2 using the secure chip SE. The authentication invitation includes the serial number of the communication message. After receiving the authentication invitation, the second device M2 sends an authentication request to the first device M1. At this time, the second device M2 also includes an authentication invitation receiving module, and the authentication invitation receiving module receives the authentication invitation from the secure chip SE. The authentication invitation includes the serial number Seq.
[0122] According to some embodiments, the second authentication module 24 includes an encryption unit 241, a sending unit 242, a receiving unit 243, and an authentication unit 244, as Figure 9 shown.
[0123] The encryption unit 241 encrypts the combination of the first mapping information of the serial number Seq and the session key R1 using a white-box cryptography algorithm to form a second ciphertext C2. The sending unit 242 sends the second ciphertext C2 to the secure chip SE. The receiving unit 243 receives the response ciphertext C3 from the secure chip SE. The authentication unit 244 decrypts and authenticates the response ciphertext C3 using a white-box cryptography algorithm.
[0124] Figure 10 It is a functional block diagram of an electronic device provided by an embodiment of the present application.
[0125] The electronic device may include an output unit 301, an input unit 302, a processor 303, a memory 304, a communication interface 305, and a memory unit 306.
[0126] The memory 304, as a non-transitory computer-readable memory, can be used to store software programs, computer-executable programs, and modules. When one or more programs are executed by one or more processors 303, one or more processors 303 implement the method described above.
[0127] The memory 304 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function. The data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 304 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory 304 may optionally include a memory remotely set relative to the processor 303, and these remote memories can be connected to the electronic device through a network.
[0128] The above has introduced the embodiments of the present application in detail. Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the idea of the present application, within the specific implementation manners and application scope of the present application, all belong to the protection scope of the present application. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. An identity authentication and secure communication method, applied to a first device, the method comprising: Receiving, by using a security chip of the first device, an authentication request from a second device, the authentication request including a sequence number and an authentication code of a communication message; Generating, based on the authentication code, an authentication key corresponding to the second device by using a preset authentication key generation algorithm; Determining a session key by using a true random number generator; Mutually authenticating with the second device by using a hardware cryptographic algorithm in the security chip to encrypt mapping information of the sequence number and the session key with the authentication key, the hardware cryptographic algorithm being consistent with a white-box cryptographic algorithm configured inside the second device; Receiving encrypted data from the second device, the encrypted data being encrypted based on the session key.
2. The method according to claim 1, wherein, Before receiving, by using the security chip of the first device, the authentication request from the second device, further comprising: Sending, by using the security chip, an authentication invitation to the second device, the authentication invitation including the sequence number.
3. The method according to claim 1 or 2, wherein Mutually authenticating with the second device by using a hardware cryptographic algorithm in the security chip to encrypt mapping information of the sequence number and the session key with the authentication key, comprising: Using the hardware cryptographic algorithm to encrypt a combination of the sequence number and the session key to obtain a first ciphertext; Sending the first ciphertext to the second device; Receiving a second ciphertext from the second device, which is encrypted by using the white-box cryptographic algorithm for a combination of first mapping information of the sequence number and the session key; Decrypting and authenticating the second ciphertext by using the hardware cryptographic algorithm; Sending a response ciphertext to the second device.
4. The method according to claim 3, wherein Before sending the response ciphertext to the second device, further comprising: Encrypting, by using the hardware cryptographic algorithm, a combination of second mapping information of the sequence number, a confirmation symbol, the session key, and a preset session key update threshold to obtain a response ciphertext.
5. The method according to claim 4, wherein, When the sequence number is an integer multiple of the session key update threshold, updating the session key.
6. The method according to claim 1 or 2, wherein The first device includes: At least one of a gateway and a server.
7. The method according to claim 1 or 2, wherein The second device includes: a user terminal device.
8. An identity authentication and secure communication method, applied to a second device, the method comprising: The second device sending an authentication request to a security chip of a first device, the authentication request including a sequence number and an authentication code of a communication message; Receiving a first ciphertext sent from the security chip; Decrypting the first ciphertext by using a white-box cryptographic algorithm to obtain a session key; Mutually authenticating with the security chip by using the white-box cryptographic algorithm to encrypt mapping information of the sequence number and the session key; Sending encrypted data to the security chip, the encrypted data being encrypted based on the session key by using a software cryptographic algorithm.
9. The method according to claim 8, wherein, Before the second device sends the authentication request to the security chip, further comprising: The second device receiving an authentication invitation from the security chip, the authentication invitation including the sequence number.
10. The method according to claim 8 or 9, wherein, Mutually authenticating with the security chip by using the white-box cryptographic algorithm to encrypt mapping information of the sequence number and the session key, comprising: Encrypt the combination of the first mapping information of the serial number and the session key using the white-box cryptographic algorithm to form a second ciphertext; Send the second ciphertext to the security chip; Receive the response ciphertext from the security chip; Decrypt and authenticate the response ciphertext using the white-box cryptographic algorithm.
11. The method according to claim 8, wherein, The first ciphertext is obtained by the security chip using a hardware cryptographic algorithm consistent with the white-box cryptographic algorithm to encrypt the combination of the serial number and the session key using an authentication key.
12. The method according to claim 10, wherein, The response ciphertext is obtained by the security chip using a hardware cryptographic algorithm to encrypt the combination of the second mapping information of the serial number, the confirmation symbol, the session key, and a preset session key update threshold.
13. The method according to claim 12, wherein, When the serial number is an integer multiple of the session key update threshold, the security chip updates the session key.
14. A security chip, comprising: An authentication request receiving module, which receives an authentication request from a second device, and the authentication request includes a serial number and an authentication code of a communication message; An authentication key generation module, which generates an authentication key corresponding to the second device based on the authentication code using a preset authentication key generation algorithm; A session key determination module, which determines a session key using a true random number generator; A first authentication module, which uses a hardware cryptographic algorithm to encrypt the mapping information of the serial number and the session key using the authentication key, and performs mutual authentication with the second device, and the hardware cryptographic algorithm is consistent with the white-box cryptographic algorithm; A data receiving module, which receives encrypted data from the second device, and the encrypted data is encrypted based on the session key.
15. The security chip according to claim 14, further comprising: An authentication invitation sending module, which sends an authentication invitation to the second device, and the authentication invitation includes the serial number.
16. The secure chip according to claim 14 or 15, wherein, The first authentication module includes: A first ciphertext determination unit, which uses the hardware cryptographic algorithm to encrypt the combination of the serial number and the session key using the authentication key to obtain a first ciphertext; A first ciphertext sending unit, which sends the first ciphertext to the second device; A second ciphertext receiving unit, which receives a second ciphertext from the second device that encrypts the combination of the first mapping information of the serial number and the session key using the white-box cryptographic algorithm; A second ciphertext decryption unit, which decrypts and authenticates the second ciphertext using the hardware cryptographic algorithm; A response ciphertext sending unit, which sends a response ciphertext to the second device.
17. The secure chip according to claim 14 or 15, wherein, The algorithm adopted by the authentication key generation module includes the ALG algorithm.
18. A terminal device, comprising: An authentication request sending module, which sends an authentication request to a security chip, and the authentication request includes a serial number and an authentication code of a communication message; A receiving module, which receives a first ciphertext sent from the security chip; A decryption module, which decrypts and authenticates the first ciphertext using the white-box cryptographic algorithm to obtain a session key; A second authentication module, which encrypts the mapping information of the serial number and the session key using the white-box cryptographic algorithm, and performs mutual authentication with the security chip; A data sending module, which sends encrypted data to the security chip, and the encrypted data is encrypted based on the session key using a software encryption algorithm.
19. The device according to claim 18, further comprising: An authentication invitation receiving module, which receives an authentication invitation from the security chip, and the authentication invitation includes the serial number.
20. The device according to claim 18 or 19, wherein The second authentication module includes: An encryption unit, which encrypts the combination of the first mapping information of the serial number and the session key by using the white box cryptographic algorithm to form a second ciphertext; A sending unit, which sends the second ciphertext to the security chip; A receiving unit, which receives a response ciphertext from the security chip; An authentication unit, which decrypts and authenticates the response ciphertext by using the white box cryptographic algorithm.
21. A computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it executes the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Method and apparatus for white box cryptography
KR1020180007459A