[go: up one dir, main page]

CN117675285A - An identity verification method, chip and device - Google Patents

An identity verification method, chip and device Download PDF

Info

Publication number
CN117675285A
CN117675285A CN202311491646.XA CN202311491646A CN117675285A CN 117675285 A CN117675285 A CN 117675285A CN 202311491646 A CN202311491646 A CN 202311491646A CN 117675285 A CN117675285 A CN 117675285A
Authority
CN
China
Prior art keywords
authentication
message
server
session
algorithm
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
Application number
CN202311491646.XA
Other languages
Chinese (zh)
Inventor
晋兆雨
张忠培
韩永祥
李耘
邹兰榕
郑鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huada Jiutian Technology Co ltd
Higher Research Institute Of University Of Electronic Science And Technology Shenzhen
Original Assignee
Shenzhen Huada Jiutian Technology Co ltd
Higher Research Institute Of University Of Electronic Science And Technology Shenzhen
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huada Jiutian Technology Co ltd, Higher Research Institute Of University Of Electronic Science And Technology Shenzhen filed Critical Shenzhen Huada Jiutian Technology Co ltd
Priority to CN202311491646.XA priority Critical patent/CN117675285A/en
Publication of CN117675285A publication Critical patent/CN117675285A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3247Cryptographic 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 involving digital signatures

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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及通信安全技术领域,尤其涉及一种身份验证方法,该方法包括:在与服务器端建立连接后,通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将认证消息发送至服务器端,以使服务器端根据认证消息得到认证通过消息;获取认证通过消息,通过预存的服务器端的公钥对认证通过消息的数字签名进行验证,得到签名结果;如果签名结果为通过验证结果,则通过SM4算法的解密算法解密认证通过消息得到会话时长和会话密钥参数,其中,会话密钥参数用于在会话时长内,通过会话密钥参数与服务器端之间的进行通信。该方法保证设备与服务器之间的认证和通信需求,很大程度上抵御经典攻击,提高设备的防伪能力和信息安全。

The invention relates to the technical field of communication security, and in particular to an identity verification method. The method includes: after establishing a connection with a server, obtaining an authentication message from the target response signal of a pre-stored physical unclonable function through the SM3 algorithm, and sending the authentication message Send to the server, so that the server can obtain the authentication passing message based on the authentication message; obtain the authentication passing message, verify the digital signature of the authentication passing message through the pre-stored server-side public key, and obtain the signature result; if the signature result is the verification result , then the session duration and session key parameters are obtained by decrypting the authentication message through the decryption algorithm of the SM4 algorithm, where the session key parameter is used to communicate with the server through the session key parameter within the session duration. This method ensures the authentication and communication requirements between the device and the server, resists classic attacks to a large extent, and improves the anti-counterfeiting capability and information security of the device.

Description

一种身份验证方法、芯片及设备An identity verification method, chip and device

技术领域Technical field

本发明涉及通信安全技术领域,尤其涉及一种身份验证方法、芯片及设备。The present invention relates to the field of communication security technology, and in particular to an identity verification method, chip and equipment.

背景技术Background technique

物联网(Internet ofThings)可以将数量呈指数增长,规模达数十亿的异构设备互联。物联网的目标是使计算机/设备/节点能够在没有或最少的人类输入的情况下收集、处理和决策。伴随着物联网系统的复杂性的增加,物联网设备之间的通信数据的安全性是相当复杂的。惠普的一项研究发现,70%的物联网设备在连接到互联网时容易受到各种攻击。还有文献指出全球超过85%的组织将以不同的方式利用物联网设备,其中约90%的企业对其物联网设备的安全性不确定。因此,物联网面临着紧迫的安全挑战,包括更多的漏洞和安全攻击。The Internet of Things can interconnect heterogeneous devices that are growing exponentially and reaching billions in scale. The goal of IoT is to enable computers/devices/nodes to collect, process and make decisions with no or minimal human input. As the complexity of IoT systems increases, the security of communication data between IoT devices is quite complicated. A study by HP found that 70% of IoT devices are vulnerable to various attacks when connected to the internet. There is also literature stating that more than 85% of organizations worldwide will utilize IoT devices in different ways, and about 90% of them are unsure about the security of their IoT devices. As a result, IoT faces pressing security challenges, including more vulnerabilities and security attacks.

为了保证物联网设备的信息安全,通常采用安全芯片。通过安全芯片的身份验证方法能够为物联网设备或系统提供安全配置、数据加密、安全存储、密钥管理和数字签名等安全功能。安全芯片也被广泛应用在服务器、通讯终端、智能卡和电子标签等众多信息终端设备上。In order to ensure the information security of IoT devices, security chips are usually used. Authentication methods through security chips can provide security functions such as secure configuration, data encryption, secure storage, key management, and digital signatures for IoT devices or systems. Security chips are also widely used in many information terminal equipment such as servers, communication terminals, smart cards and electronic labels.

现有物理网设备的身份验证方法通常会采用哈希等密码运算,以防止网络攻击、伪装或暴力破解等情况。但是仍然存在容易被网络攻破的风险,引发现有的身份验证方法存在安全性较低的问题。The authentication methods of existing physical network devices usually use cryptographic operations such as hashing to prevent network attacks, disguise, or brute force cracking. However, there is still the risk of being easily breached by the network, causing the existing authentication methods to be less secure.

发明内容Contents of the invention

本申请实施例通过提供一种身份验证方法、芯片及设备,解决了现有技术中存在安全性较低的技术问题,实现了保证设备与服务器之间的认证和通信需求,很大程度上抵御经典攻击,提高设备的防伪能力和信息安全,为海量的物联网节点提供高级别的安全机制,保障各节点的数据安全等技术效果。By providing an identity verification method, chip and equipment, the embodiments of this application solve the technical problems of low security in the existing technology, achieve the authentication and communication requirements between the equipment and the server, and largely resist the Classic attacks improve the anti-counterfeiting capabilities and information security of devices, provide high-level security mechanisms for massive IoT nodes, and ensure the data security of each node and other technical effects.

第一方面,本发明实施例提供一种身份验证方法,应用于设备端,所述方法包括:In a first aspect, an embodiment of the present invention provides an identity verification method, which is applied to the device side. The method includes:

在与服务器端建立连接后,通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将所述认证消息发送至所述服务器端,以使所述服务器端根据所述认证消息得到认证通过消息;After establishing a connection with the server, use the SM3 algorithm to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, and send the authentication message to the server, so that the server can use the SM3 algorithm to obtain the authentication message according to the authentication message. Get the certification pass message;

获取所述认证通过消息,通过预存的所述服务器端的公钥对所述认证通过消息的数字签名进行验证,得到签名结果;Obtain the authentication passing message, verify the digital signature of the authentication passing message through the pre-stored server-side public key, and obtain a signature result;

如果签名结果为通过验证结果,则通过SM4算法的解密算法解密所述认证通过消息得到会话时长和会话密钥参数,其中,所述会话密钥参数用于在所述会话时长内,通过所述会话密钥参数与所述服务器端之间的进行通信。If the signature result is a passing verification result, the authentication passing message is decrypted using the decryption algorithm of the SM4 algorithm to obtain the session duration and session key parameters, wherein the session key parameter is used to pass the authentication within the session duration. Session key parameters are communicated with the server side.

优选的,在与所述服务器端建立连接之前,还包括:Preferably, before establishing a connection with the server, the method further includes:

在安全信道中,向所述服务器端发送注册请求信号,以使所述服务器端根据接受到的所述注册请求信号,发送初始激励信号和所述服务器端的公钥,其中,所述注册请求信号包括所述设备端的设备编号,所述服务器端的公钥为通过SM2算法加密的公钥;In the secure channel, a registration request signal is sent to the server, so that the server sends an initial stimulus signal and the public key of the server according to the received registration request signal, wherein the registration request signal Includes the device number of the device, and the public key of the server is a public key encrypted by the SM2 algorithm;

接收所述初始激励信号和所述服务器端的公钥,并根据所述初始激励信号和所述物理不可克隆函数,得到所述目标响应信号;Receive the initial excitation signal and the public key of the server, and obtain the target response signal based on the initial excitation signal and the physical unclonable function;

存储所述目标响应信号和所述服务器端的公钥,并将所述目标响应信号发送至所述服务器端,以使所述服务器端存储所述目标响应信号和所述设备编号。Store the target response signal and the public key of the server, and send the target response signal to the server, so that the server stores the target response signal and the device number.

优选的,所述通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,包括:Preferably, the SM3 algorithm is used to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, including:

通过所述SM3算法处理所述目标响应信号和当前时间戳,得到认证激励信号,再根据所述物理不可克隆函数和所述认证激励信号,得到认证响应信号;Process the target response signal and the current timestamp through the SM3 algorithm to obtain an authentication excitation signal, and then obtain an authentication response signal based on the physical unclonable function and the authentication excitation signal;

根据所述认证激励信号、所述认证响应信号、所述目标响应信号、所述当前时间戳和所述设备编号,得到所述认证消息。The authentication message is obtained according to the authentication stimulus signal, the authentication response signal, the target response signal, the current timestamp and the device number.

优选的,所述通过SM4算法解密所述认证通过消息得到会话时长和会话密钥参数,包括:Preferably, the session duration and session key parameters are obtained by decrypting the authentication pass message through the SM4 algorithm, including:

对所述认证通过消息进行验证,得到第一随机数和密文;Verify the authentication pass message to obtain the first random number and ciphertext;

根据第一随机数和所述目标响应信号,得到临时密钥;Obtain the temporary key according to the first random number and the target response signal;

通过所述SM4算法和所述临时密钥对所述密文进行解密,得到所述会话时长和所述会话密钥参数,所述会话密钥参数包括会话密钥和所述密文的第二随机数。The ciphertext is decrypted using the SM4 algorithm and the temporary key to obtain the session duration and the session key parameters. The session key parameters include the session key and the second part of the ciphertext. random number.

优选的,所述在所述会话时长内,还包括:Preferably, within the session duration, it also includes:

根据所述会话密钥参数和所述SM4算法得到会话消息,并将所述会话消息发送至所述服务器端,以使所述服务器端根据所述会话消息得到会话反馈消息,用于实现与所述服务器端之间的通信。Obtain a session message according to the session key parameter and the SM4 algorithm, and send the session message to the server, so that the server can obtain a session feedback message according to the session message, which is used to implement the communication with the server. Describes communication between servers.

基于同一发明构思,第二方面,本发明还提供一种身份验证方法,应用于服务器端,所述方法包括:Based on the same inventive concept, in a second aspect, the present invention also provides an identity verification method, which is applied to the server side. The method includes:

在与设备端建立连接后,获取所述设备端发送的认证消息;After establishing a connection with the device, obtain the authentication message sent by the device;

根据所述认证消息的设备编号搜索到预存的目标响应信号,根据所述目标响应信号和SM3算法,得到目标哈希值;Search for the pre-stored target response signal according to the device number of the authentication message, and obtain the target hash value based on the target response signal and the SM3 algorithm;

若所述目标哈希值与预存的哈希值一致,则获取认证通过消息,并将所述认证通过消息发送至所述设备端。If the target hash value is consistent with the pre-stored hash value, an authentication pass message is obtained, and the authentication pass message is sent to the device.

优选的,所述获取认证通过消息,包括:Preferably, the obtaining the authentication pass message includes:

获取会话密钥、第一随机数和第二随机数;Get the session key, the first random number and the second random number;

根据所述目标响应信号、所述第一随机数和所述SM3算法,得到临时密钥;Obtain a temporary key according to the target response signal, the first random number and the SM3 algorithm;

通过SM4算法的加密算法对所述设备编号、所述会话密钥、会话时长和所述第二随机数进行加密,得到密文;Encrypt the device number, the session key, the session duration and the second random number using the encryption algorithm of the SM4 algorithm to obtain ciphertext;

通过所述服务器端的私钥对当前时间戳、所述第一随机数和所述密文进行数字签名处理,得到数字签名,再根据所述当前时间戳、所述第一随机数和所述数字签名,得到所述认证通过消息。The current timestamp, the first random number and the ciphertext are digitally signed using the private key of the server to obtain a digital signature, and then the digital signature is obtained based on the current timestamp, the first random number and the digital Sign, and get the authentication passed message.

优选的,在将所述认证通过消息发送至所述设备端之后,还包括:Preferably, after sending the authentication pass message to the device, the method further includes:

在所述会话时长内,获取所述设备端发送的会话消息;Within the session duration, obtain the session message sent by the device;

对所述会话消息进行解密,得到所述会话消息的消息内容和验证随机值;Decrypt the session message to obtain the message content and verification random value of the session message;

若所述验证随机值与所述第二随机值一致,则与所述设备端进行通信。If the verification random value is consistent with the second random value, communication is performed with the device.

基于同一发明构思,第三方面,本发明提供一种芯片,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现身份验证方法的步骤。Based on the same inventive concept, in a third aspect, the present invention provides a chip, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, an identity verification method is implemented. A step of.

基于同一发明构思,第四方面,本发明提供一种电子设备,包括上述的芯片。Based on the same inventive concept, in a fourth aspect, the present invention provides an electronic device including the above-mentioned chip.

本发明实施例中的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:

在本发明实施例中,设备端在与服务器端建立连接后,设备端通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将认证消息发送至服务器端,以使服务器端根据认证消息得到认证通过消息。这里,设备端预先存储通过物理不可克隆函数得到的一个目标响应信号,并且通过SM3算法处理得到认证消息,将认证消息发送至服务器端,以使服务器端验证设备端的身份。通过目标响应信号实现设备端与服务器端后续认证过程和会话过程,无需预先存储大量PUF响应,减少设备端的计算量,更适用于物联网设备,实现设备端与服务器端之间的轻量级通信过程。结合SM3算法,提高了设备端的通信过程的安全性和保密性。In the embodiment of the present invention, after the device side establishes a connection with the server side, the device side uses the SM3 algorithm to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, and sends the authentication message to the server side, so that the server side Obtain the authentication pass message according to the authentication message. Here, the device pre-stores a target response signal obtained through the physical unclonable function, obtains the authentication message through SM3 algorithm processing, and sends the authentication message to the server, so that the server can verify the identity of the device. The subsequent authentication process and session process between the device side and the server side are realized through the target response signal. There is no need to store a large number of PUF responses in advance, which reduces the calculation amount on the device side. It is more suitable for IoT devices and realizes lightweight communication between the device side and the server side. process. Combined with the SM3 algorithm, the security and confidentiality of the communication process on the device side are improved.

接着,获取认证通过消息,通过预存的服务器端的公钥对认证通过消息的数字签名进行验证,得到签名结果。如果签名结果为通过验证结果,则通过SM4算法解密认证通过消息得到会话时长和会话密钥参数,其中,会话密钥参数用于在会话时长内,通过会话密钥参数与服务器端之间的进行通信。通过SM4算法和会话密钥的匹配使用,设备端与服务器端通过网络先建立安全的共享会话密钥再进行保密通信,保障了设备端与服务器端之间通信的加解密效率和通信安全,使设备端具有较高的抗差分攻击能力,很大程度上抵御经典攻击,提高通信效率。Then, obtain the authentication-passed message, verify the digital signature of the authentication-passed message through the pre-stored server-side public key, and obtain the signature result. If the signature result is a verification result, the SM4 algorithm is used to decrypt the authentication message to obtain the session duration and session key parameters. The session key parameter is used to communicate with the server through the session key parameter within the session duration. communication. Through the matching use of SM4 algorithm and session key, the device and the server first establish a secure shared session key through the network and then conduct confidential communication, ensuring the encryption and decryption efficiency and communication security of the communication between the device and the server. The device side has high resistance to differential attacks, can resist classic attacks to a large extent, and improves communication efficiency.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考图形表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be construed as limiting the invention. Also throughout the drawings, the same reference figures are used to represent the same components. In the attached picture:

图1示出了本发明实施例中的应用于设备端的身份验证方法的步骤流程示意图;Figure 1 shows a schematic flowchart of the steps of the identity verification method applied to the device side in an embodiment of the present invention;

图2示出了本发明实施例中的注册阶段和认证阶段的流程示意图;Figure 2 shows a schematic flow chart of the registration phase and authentication phase in the embodiment of the present invention;

图3示出了本发明实施例中的密钥建立阶段的流程示意图;Figure 3 shows a schematic flow chart of the key establishment phase in the embodiment of the present invention;

图4a示出了本发明实施例中的SM2算法执行生成公私钥、私钥签名、公钥验签、公钥加密、私钥解密、协商会话密钥和密钥交换等功能的速度的示意图;Figure 4a shows a schematic diagram of the speed at which the SM2 algorithm in the embodiment of the present invention performs functions such as generating public and private keys, private key signatures, public key signature verification, public key encryption, private key decryption, negotiation of session keys, and key exchange;

图4b示出了本发明实施例中的SM2算法执行公私钥、私钥签名、公钥验签、公钥加密、私钥解密、协商会话密钥和密钥交换等功能的所含用内存的示意图;Figure 4b shows the memory used by the SM2 algorithm in the embodiment of the present invention to perform functions such as public and private keys, private key signatures, public key signature verification, public key encryption, private key decryption, negotiation of session keys, and key exchange. schematic diagram;

图5示出了本发明实施例中的SM2算法与RAS算法分别执行相应功能的速度的示意图;Figure 5 shows a schematic diagram of the speed at which the SM2 algorithm and the RAS algorithm perform corresponding functions respectively in the embodiment of the present invention;

图6a示出了本发明实施例中的SM4算法执行ECB、CBC、CFB以及OFB等算法模式所花费的时间的示意图;Figure 6a shows a schematic diagram of the time it takes for the SM4 algorithm to execute algorithm modes such as ECB, CBC, CFB and OFB in the embodiment of the present invention;

图6b示出了本发明实施例中的SM4算法执行ECB、CBC、CFB以及OFB等算法模式所占用的内存的示意图;Figure 6b shows a schematic diagram of the memory occupied by the SM4 algorithm in the embodiment of the present invention when executing algorithm modes such as ECB, CBC, CFB and OFB;

图7示出了本发明实施例中的应用于服务器端的身份验证方法的步骤流程示意图。Figure 7 shows a schematic flowchart of the steps of the identity verification method applied to the server side in the embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a thorough understanding of the disclosure, and to fully convey the scope of the disclosure to those skilled in the art.

实施例一Embodiment 1

本发明第一实施例提供了一种身份验证方法,如图1所示,应用于设备端,包括:The first embodiment of the present invention provides an identity verification method, as shown in Figure 1, applied to the device side, including:

S101,在与服务器端建立连接后,通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将认证消息发送至服务器端,以使服务器端根据认证消息得到认证通过消息;S101. After establishing a connection with the server, use the SM3 algorithm to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, and send the authentication message to the server, so that the server can obtain the authentication pass message based on the authentication message;

S102,获取认证通过消息,通过预存的服务器端的公钥对认证通过消息的数字签名进行验证,得到签名结果;S102, obtain the authentication passed message, verify the digital signature of the authentication passed message through the pre-stored server-side public key, and obtain the signature result;

S103,如果签名结果为通过验证结果,则通过SM4算法解密认证通过消息得到会话时长和会话密钥参数,其中,会话密钥参数用于在会话时长内,通过会话密钥参数与服务器端之间的进行通信。S103. If the signature result is a verification result, the SM4 algorithm is used to decrypt the authentication message to obtain the session duration and session key parameters. The session key parameter is used to communicate with the server through the session key parameter within the session duration. to communicate.

本实施例的身份验证方法应用在设备端中,设备端优选物联网设备,如智能家居设备、工业传感器设备、智能汽车、智能摄像头、医疗/健身设备等。The identity verification method in this embodiment is applied to the device side, and the device side is preferably Internet of Things equipment, such as smart home equipment, industrial sensor equipment, smart cars, smart cameras, medical/fitness equipment, etc.

下面,结合图1来详细介绍本实施例提供的身份验证方法的具体实施步骤:Next, the specific implementation steps of the identity verification method provided in this embodiment will be introduced in detail with reference to Figure 1:

在执行步骤S101之前,设备端需要向服务器端进行注册。在注册阶段,在安全信道中,向服务器端发送注册请求信号,以使服务器端根据接受到的注册请求信号,发送初始激励信号和服务器端的公钥,其中,注册请求信号包括设备端的设备编号,服务器端的公钥为通过SM2算法加密的公钥。接收初始激励信号和服务器端的公钥,并根据初始激励信号和物理不可克隆函数,得到目标响应信号。存储目标响应信号和服务器端的公钥,并将目标响应信号发送至服务器端,以使服务器端存储目标响应信号和设备编号。Before executing step S101, the device needs to register with the server. In the registration phase, in the secure channel, a registration request signal is sent to the server, so that the server sends an initial stimulus signal and the server's public key based on the received registration request signal, where the registration request signal includes the device number of the device, The public key on the server side is the public key encrypted by the SM2 algorithm. Receive the initial excitation signal and the server-side public key, and obtain the target response signal based on the initial excitation signal and the physical unclonable function. Store the target response signal and the public key of the server side, and send the target response signal to the server side, so that the server side stores the target response signal and the device number.

具体地,如图2所示,在安全信道中,设备端先向服务器端发起注册请求信号,注册请求信号包括设备端的设备编号IDA。设备编号可以是设备端的网络地址或MAC地址,或是根据实际需求而设置的编号。服务器端在接收到注册请求信号后,存储设备编号IDA,通过SM2算法加密自己的公钥,并向设备端发送一个初始激励信号CA和服务器端自己的公钥Pub_keySM2_B。需要说明的是下标带A的参数均表示设备端的参数,下标带B的参数均表示服务器端的参数,下表带SM2或SM3或SM4的参数分别表示被SM2算法或被SM3算法或被SM4算法处理的参数,如服务器端的公钥Pub_keySM2_B为通过SM2算法加密自己的公钥。安全信道为符合预设要求的信道,如安全信道是能够防止窃听、数据复制、数据篡改和中间人攻击等攻击方式,保证通信设备之间数据传输的机密性、完整性和真实性的通信信道。预设要求可根据实际需求而设置。Specifically, as shown in Figure 2, in the secure channel, the device first initiates a registration request signal to the server, and the registration request signal includes the device number ID A of the device. The device number can be the network address or MAC address of the device, or a number set according to actual needs. After receiving the registration request signal, the server side stores the device number ID A , encrypts its own public key through the SM2 algorithm, and sends an initial stimulus signal C A and the server side's own public key Pub_key SM2_B to the device side. It should be noted that the parameters with subscript A all represent device-side parameters, and the parameters with subscript B all represent server-side parameters. The parameters with SM2 or SM3 or SM4 in the table below represent the SM2 algorithm or the SM3 algorithm or the SM4 respectively. Parameters processed by the algorithm, such as the server-side public key Pub_key SM2_B is the public key encrypted through the SM2 algorithm. A secure channel is a channel that meets preset requirements. For example, a secure channel is a communication channel that can prevent attacks such as eavesdropping, data copying, data tampering, and man-in-the-middle attacks, and ensure the confidentiality, integrity, and authenticity of data transmission between communication devices. Preset requirements can be set according to actual needs.

设备端根据接收到的初始激励信号和物理不可克隆函数PUF,得到目标响应信号RA。即RA=pufA(CA)。设备端还会将目标响应信号RA发送至服务器端,以使服务器端存储目标响应信号RA。其中,物理不可克隆函数(PUF)是物理对象(如集成电路、晶体、磁铁、透镜或太阳能电池)的独特纳米结构及其对随机事件的反应构建的物理单向函数。PUF是无序的物理系统,当输入激励Ci时,通过PUF生成独特的、不可预测的、可重复的响应Ri。所有可能的激励及其相应响应的集合通常被称为挑战响应对(CRP)。The device side obtains the target response signal RA based on the received initial excitation signal and the physical unclonable function PUF. That is, RA = puf A (C A ). The device side will also send the target response signal RA to the server side, so that the server side stores the target response signal RA . Among them, a physical unclonable function (PUF) is a physical one-way function constructed from the unique nanostructure of a physical object (such as an integrated circuit, crystal, magnet, lens or solar cell) and its response to random events. PUF is a disordered physical system that generates a unique, unpredictable, and repeatable response R i when an input excites C i . The set of all possible stimuli and their corresponding responses is often called a challenge-response pair (CRP).

通过上述注册过程,完成设备端向服务器端的申请注册。在注册阶段中,设备端无需预存大量对服务器端发送的激励信号的PUF响应信号。只需在注册过程中存储一个目标响应信号,以通过该目标响应信号实现设备端与服务器端之间的会话密钥协商过程和通信过程,减少设备端的计算量,更适用于物联网设备,保证会话密钥协商过程的安全性和保密性。Through the above registration process, the application registration from the device side to the server side is completed. In the registration phase, the device does not need to pre-store a large number of PUF response signals to the stimulus signals sent by the server. It is only necessary to store a target response signal during the registration process, so that the session key negotiation process and communication process between the device side and the server side can be realized through the target response signal, which reduces the calculation amount on the device side and is more suitable for Internet of Things devices to ensure Security and confidentiality of the session key negotiation process.

并且,在注册阶段中,设备端需要向服务器端发送消息,保证只有服务器端能够正确读取。那么,需要依靠服务器端的公钥对目标响应信号RA进行加密,以确保只有拥有正确私钥的通信方才能解密。所以,此阶段要选用合适的非对称加密算法。国密算法SM2算法与经典的RSA算法相比,提供了相同级别的安全性,且密钥大小相对较小,需要的存储空间也更少。在资源受限的环境下能更好的完成加密和签名操作,十分适用于物联网设备端,提高信息安全。同时,应用国密算法有助于保护国家和个人信息安全,降低对国外算法的依赖。Moreover, during the registration phase, the device needs to send a message to the server to ensure that only the server can read it correctly. Then, the target response signal R A needs to be encrypted by relying on the public key on the server side to ensure that only the communicating party with the correct private key can decrypt it. Therefore, an appropriate asymmetric encryption algorithm must be selected at this stage. Compared with the classic RSA algorithm, the national secret algorithm SM2 algorithm provides the same level of security, and the key size is relatively smaller and requires less storage space. It can better complete encryption and signature operations in resource-constrained environments, and is very suitable for IoT devices to improve information security. At the same time, the application of national secret algorithms can help protect national and personal information security and reduce reliance on foreign algorithms.

在完成设备端的注册过程后,执行步骤S101,在与服务器端建立连接后,通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将认证消息发送至服务器端,以使服务器端根据认证消息得到认证通过消息。After completing the registration process on the device side, step S101 is executed. After establishing a connection with the server side, the target response signal of the pre-stored physical unclonable function is used to obtain the authentication message through the SM3 algorithm, and the authentication message is sent to the server side, so that the server The terminal obtains the authentication pass message based on the authentication message.

具体来讲,在完成设备端的注册过程后,在设备端与服务器端每次建立通信时,设备端需要向服务器端进行认证,即验证身份。如图2所示,A表示设备端,B表示服务器端。在认证阶段中,无论在安全信道条件下或是不安全信道条件下,设备端通过SM3算法HSM3()处理目标响应信号RA和当前时间戳T1,得到认证激励信号C'A,即C'A=HSM3(T1||RA)。再根据物理不可克隆函数PUF和认证激励信号C'A,得到认证响应信号R'A,即R'A=pufA(C'A)。Specifically, after completing the registration process on the device side, each time communication is established between the device side and the server side, the device side needs to authenticate to the server side, that is, verify the identity. As shown in Figure 2, A represents the device side and B represents the server side. In the authentication phase, whether under secure channel conditions or unsafe channel conditions, the device processes the target response signal R A and the current timestamp T 1 through the SM3 algorithm H SM3 () to obtain the authentication excitation signal C' A , that is C' A =H SM3 (T 1 || RA ). Then, based on the physical unclonable function PUF and the authentication excitation signal C' A , the authentication response signal R' A is obtained, that is, R' A =puf A (C' A ).

根据认证激励信号C'A、认证响应信号R'A、目标响应信号RA、当前时间戳T1和设备编号IDA,得到认证消息。具体地,设备端得到认证消息M1=(IDA,T1,τ,σ),其中,第一哈希值τ=HSM3(C'A||R'A),第二哈希值第一哈希值和第二哈希值均为中间计算值。The authentication message is obtained according to the authentication excitation signal C' A , the authentication response signal R' A , the target response signal RA , the current timestamp T 1 and the device number ID A . Specifically, the device side obtains the authentication message M 1 =(ID A ,T 1 ,τ,σ), where the first hash value τ=H SM3 (C' A ||R' A ) and the second hash value Both the first hash value and the second hash value are intermediate calculated values.

在得到认证消息后,设备端将认证消息发送至服务器端。服务器端接收到认证消息M1=(IDA,T1,τ,σ)后,根据认证消息的设备编号IDA搜索到预存的目标响应信号RA,根据目标响应信号RA和SM3算法HSM3(),得到目标哈希值。After getting the authentication message, the device sends the authentication message to the server. After receiving the authentication message M 1 = (ID A , T 1 , τ, σ), the server searches for the pre-stored target response signal RA according to the device number ID A of the authentication message. According to the target response signal RA and SM3 algorithm H SM3 (), get the target hash value.

具体地,服务器端对认证消息进行解密,得到认证密文HSM3(Pub_keySM2_B(RA)||RA)、认证激励信号C'A=HSM3(T1||RA)、第一哈希值τ=HSM3(C'A||R'A)和第二哈希值根据第二哈希值得到认证响应信号服务器端根据认证激励信号C'A和认证响应信号R'A,得到目标哈希值τ',即τ'=HSM3(C'A||R'A)。Specifically, the server decrypts the authentication message and obtains the authentication ciphertext H SM3 (Pub_key SM2_B ( RA )|| RA ), the authentication excitation signal C' A =H SM3 (T 1 ||RA ) , and the first Hash value τ=H SM3 (C' A ||R' A ) and the second hash value According to the second hash value Get authentication response signal The server side obtains the target hash value τ' based on the authentication stimulus signal C' A and the authentication response signal R' A , that is, τ' = H SM3 (C' A ||R' A ).

在得到目标哈希值后,需要对目标哈希值进行判断,以确定认证消息是否是被篡改。若目标哈希值τ'与预存的哈希值τ一致,表示认证消息是未被篡改且是合法设备端发送的,则获取认证通过消息,并将认证通过消息发送至设备端。若目标哈希值τ'与预存的哈希值τ未一致,表示认证消息是被篡改或是非合法设备端发送的,则服务器端与设备端断开连接。After obtaining the target hash value, the target hash value needs to be judged to determine whether the authentication message has been tampered with. If the target hash value τ' is consistent with the pre-stored hash value τ, it means that the authentication message has not been tampered with and was sent by a legitimate device, then the authentication pass message is obtained and the authentication pass message is sent to the device. If the target hash value τ' is not consistent with the pre-stored hash value τ, it means that the authentication message has been tampered with or sent by an illegal device, and the server will disconnect from the device.

在认证阶段中,需要对认证消息进行压缩,固定数据格式。因此,需要采用一种散列函数创建消息“指纹”。SM3是一种密码散列函数,用于数据的摘要计算。它采用了非线性的置换和代换运算,结合了椭圆曲线等复杂运算,具有较高的抗碰撞性和抗攻击性。其是一种被广泛被广泛认可为安全可靠的密码散列算法。它的设计考虑了硬件实现和软件优化的需求,适用于各种平台和设备上的数据摘要计算。SM3已成为国内外多个领域的密码应用标准,包括数字证书、电子签名、身份认证、数据完整性校验等。使用SM3可以满足密码应用的安全需求,并与其他系统和设备进行兼容和互操作。并且,通过认证阶段的验证设备端身份的过程,进一步提高设备端的防伪能力和信息安全,提供高级别的安全机制。In the authentication phase, the authentication message needs to be compressed and the data format fixed. Therefore, a hash function is needed to create a "fingerprint" of the message. SM3 is a cryptographic hash function used for digest computation of data. It uses nonlinear replacement and substitution operations, combined with complex operations such as elliptic curves, and has high collision resistance and attack resistance. It is a cryptographic hashing algorithm that is widely recognized as safe and reliable. It is designed taking into account the needs of hardware implementation and software optimization, and is suitable for data summary calculations on various platforms and devices. SM3 has become a cryptographic application standard in many fields at home and abroad, including digital certificates, electronic signatures, identity authentication, data integrity verification, etc. Using SM3 can meet the security needs of cryptographic applications and be compatible and interoperable with other systems and devices. Moreover, through the process of verifying the identity of the device in the authentication phase, the anti-counterfeiting capabilities and information security of the device are further improved, providing a high-level security mechanism.

如图3所示,在服务器端认证通过设备端后,即认证消息被认证通过后,进入会话密钥协商阶段。在此阶段,服务器端获取会话密钥ks、第一随机数r1和第二随机数r2。根据预存的目标响应信号RA、第一随机数r1和SM3算法HSM3(),得到临时密钥kt,即kt=HSM3(r1||RA)。其中,会话密钥ks、第一随机数r1和第二随机数r2可随机设置,如通过服务器端的随机函数生成,也可根据实际需求而设置。As shown in Figure 3, after the server-side authentication passes the device side, that is, after the authentication message is authenticated, the session key negotiation phase is entered. At this stage, the server side obtains the session key k s , the first random number r 1 and the second random number r 2 . According to the pre-stored target response signal RA , the first random number r 1 and the SM3 algorithm H SM3 (), the temporary key k t is obtained, that is, k t =H SM3 (r 1 ||RA ) . Among them, the session key k s , the first random number r 1 and the second random number r 2 can be set randomly, such as generated by a random function on the server side, or can be set according to actual needs.

通过SM4算法的加密算法ESM4_k()对设备编号IDA、会话密钥ks、会话时长ΔT和第二随机数r2进行加密,得到密文ESM4_kt(IDA||ks||ΔT||r2)。其中,会话时长ΔT为会话密钥ks的有效时间,也是设备端与服务器端之间的有效通信时间。其中,SM4算法的加密算法可以根据实际需求而选择相应的加密模式进行加密。The device number ID A , the session key k s , the session duration ΔT and the second random number r 2 are encrypted through the encryption algorithm E SM4_k () of the SM4 algorithm to obtain the ciphertext E SM4_kt (ID A ||k s ||ΔT ||r 2 ). Among them, the session duration ΔT is the effective time of the session key k s , and is also the effective communication time between the device and the server. Among them, the encryption algorithm of the SM4 algorithm can select the corresponding encryption mode for encryption according to actual needs.

服务器端通过服务端的私钥Pri_keySM2_B对当前时间戳T1、第一随机数r1和密文ESM4_kt(IDA||ks||ΔT||r2)进行数字签名处理,得到数字签名SigB=Pri_keySM2_B(T1||r1||ESM4_kt(IDA||ks||ΔT||r2))。再根据当前时间戳T1、第一随机数r1和数字签名SigB=Pri_keySM2_B(T1||r1||ESM4_kt(IDA||ks||ΔT||r2)),得到认证通过消息M2=(T1,r1,SigB)。并服务器端将认证通过消息发送至设备端。The server uses the server's private key Pri_key SM2_B to digitally sign the current timestamp T 1 , the first random number r 1 and the ciphertext E SM4_kt (ID A ||k s ||ΔT||r 2 ) to obtain a digital signature Sig B =Pri_key SM2_B (T 1 ||r 1 ||E SM4_kt (ID A ||k s ||ΔT||r 2 )). Then based on the current timestamp T 1 , the first random number r 1 and the digital signature Sig B =Pri_key SM2_B (T 1 ||r 1 ||E SM4_kt (ID A ||k s ||ΔT||r 2 )), The authentication passing message M 2 =(T 1 , r 1 , Sig B ) is obtained. And the server sends the authentication message to the device.

在会话密钥协商阶段,在服务器端将认证通过消息发送至设备端之后,执行步骤S102,获取认证通过消息,通过预存的服务器端的公钥对认证通过消息的数字签名进行验证,得到签名结果。In the session key negotiation phase, after the server sends the authentication pass message to the device, step S102 is performed to obtain the authentication pass message, and the digital signature of the authentication pass message is verified using the pre-stored server-side public key to obtain the signature result.

具体来讲,设备端接收到认证通过消息M2=(T1,r1,SigB)后,利用预存的服务器端的公钥Pub_keySM2_B对M2=(T1,r1,SigB)中服务器端的数字签名进行验证,得到签名结果。得到签名结果之后,需要对签名结果进行判断,以确保设备端接收到会话密钥等参数,保障设备端与服务器点之间的正常通信,提高设备端的信息安全。Specifically, after the device receives the authentication message M 2 = (T 1 , r 1 , Sig B ), it uses the pre-stored server-side public key Pub_key SM2_B to match M 2 = (T 1 , r 1 , Sig B ). The digital signature on the server side is verified and the signature result is obtained. After obtaining the signature result, it is necessary to judge the signature result to ensure that the device side receives parameters such as the session key, to ensure normal communication between the device side and the server point, and to improve the information security of the device side.

接着,执行步骤S103,如果签名结果为通过验证结果,表示认证通过消息M2=(T1,r1,SigB)中的数字签名是正确的,则通过SM4算法的解密算法解密认证通过消息得到会话时长和会话密钥参数,其中,会话密钥参数用于在会话时长内,通过会话密钥参数与服务器端之间的进行通信。Next, step S103 is executed. If the signature result is a verification result, indicating that the digital signature in the authentication passed message M 2 =(T 1 , r 1 , Sig B ) is correct, the authentication passed message is decrypted through the decryption algorithm of the SM4 algorithm. Get the session duration and session key parameters, where the session key parameter is used to communicate with the server through the session key parameter within the session duration.

具体来讲,在签名结果为通过验证结果的条件下,设备端对认证通过消息M2=(T1,r1,SigB)进行验证,得到第一随机数r1和密文ESM4_kt(IDA||ks||ΔT||r2)。根据第一随机数r1和目标响应信号RA,得到临时密钥kt。通过SM4算法的解密算法DSM4_k()和临时密钥kt对密文ESM4_kt(IDA||ks||ΔT||r2)进行解密,得到设备编号、会话时长ΔT和会话密钥参数,会话密钥参数包括会话密钥ks和密文的第二随机数r2。这样,完成设备端在与服务端进行通信之间的身份认证过程。Specifically, under the condition that the signature result is a verification result, the device verifies the authentication passing message M 2 = (T 1 , r 1 , Sig B ), and obtains the first random number r 1 and the ciphertext E SM4_kt ( ID A ||k s ||ΔT||r 2 ). According to the first random number r 1 and the target response signal RA , the temporary key k t is obtained. Decrypt the ciphertext E SM4_kt (ID A ||k s ||ΔT||r 2 ) through the decryption algorithm D SM4_k () of the SM4 algorithm and the temporary key k t to obtain the device number, session duration ΔT and session key Parameters, the session key parameter includes the session key k s and the second random number r 2 of the ciphertext. In this way, the identity authentication process between the device and the server is completed.

如果签名结果为通过验证结果,表示认证通过消息M2=(T1,r1,SigB)中的数字签名出错了,设备端可能遭遇中间人攻击,即有人冒充服务器端与设备端通信,则设备端丢弃该认证通过消息,表示设备端不再与中间人攻击者通信,设备端等待服务器端再次发送的认证通过消息或设备端重新发送认证消息至服务器端。If the signature result is a verification result, it means that the digital signature in the authentication passed message M 2 = (T 1 , r 1 , Sig B ) is wrong, and the device may encounter a man-in-the-middle attack, that is, someone pretends to be the server to communicate with the device, then The device discards the authentication pass message, which means that the device no longer communicates with the man-in-the-middle attacker. The device waits for the authentication pass message sent again by the server or the device resends the authentication message to the server.

并且,在会话时长ΔT内,设备端与服务器端进行通信时,设备端根据会话密钥参数和SM4算法得到会话消息,即利用会话密钥ks,通过SM4算法的加密算法加密会话消息的会话内容message和第二随机值r2,得到会话消息M3=ESM4_ks(message||r2)。设备端将会话消息M3=ESM4_ks(message||r2)发送至服务器端,以使服务器端根据会话消息得到会话反馈消息,用于实现与服务器端之间的通信。Moreover, within the session duration ΔT, when the device communicates with the server, the device obtains the session message based on the session key parameters and the SM4 algorithm, that is, using the session key k s , the session encrypts the session message through the encryption algorithm of the SM4 algorithm. The content message and the second random value r 2 are used to obtain the session message M 3 =E SM4_ks (message||r 2 ). The device sends the session message M 3 =E SM4_ks (message||r 2 ) to the server, so that the server can obtain the session feedback message based on the session message for communication with the server.

服务器端在接受到会话消息M3=ESM4_ks(message||r2)后,通过SM4算法对会话消息进行解密,得到会话消息的会话内容message和会话随机值r2 *,验证会话随机值r2 *是否与第二随机值r2一致。如果验证会话随机值r2 *与第二随机值r2一致/相等,表明设备端和服务器端会话密钥已经协商完成,则在会话时长ΔT内,设备端与服务器端进行通信,或是设备端与服务器端之间建立新的会话密钥。如果验证会话随机值r2 *与第二随机值r2未一致/不相等,表明会话消息可能遭到伪造或篡改,或服务器端受到拒绝服务攻击,则服务器端丢弃该会话消息,以保证通信安全,提高数据安全。After receiving the session message M 3 =E SM4_ks (message||r 2 ), the server decrypts the session message through the SM4 algorithm, obtains the session content message of the session message and the session random value r 2 * , and verifies the session random value r 2 * is consistent with the second random value r 2 . If the verification session random value r 2 * is consistent/equal with the second random value r 2 , it indicates that the session key negotiation between the device side and the server side has been completed, and within the session duration ΔT, the device side communicates with the server side, or the device Establish a new session key between the client and the server. If the verification session random value r 2 * is not consistent/equal to the second random value r 2 , it indicates that the session message may have been forged or tampered with, or the server is subject to a denial of service attack, the server will discard the session message to ensure communication. Security, improve data security.

在会话密钥协商阶段中,临时密钥是根据设备端和服务器端双方通信过程中都知道的目标响应信号RA计算出来的。因此,服务器端只要将第一随机值r1发送给设备端,那么设备端就可以通过r1和RA计算出临时密钥,从而得到会话密钥。在认证阶段中,设备端只是向服务器端证明了自己的身份。在服务器端向设备端发送认证通过消息后,设备端通过第一随机值r1得到临时密钥,通过临时密钥解密得到设备编号IDA、会话密钥ks、会话时长ΔT和第二随机数r2等信息之后才能验证服务器端的身份。所以,不能将临时密钥直接作为会话密钥。如果使用临时密钥作为会话密钥,那么设备端可能收到攻击者通过服务器端的公钥生成的伪签名和虚假的随机值,从而生成无效的会话密钥。In the session key negotiation phase, the temporary key is calculated based on the target response signal RA known by both the device side and the server side during the communication process. Therefore, as long as the server side sends the first random value r 1 to the device side, the device side can calculate the temporary key through r 1 and RA , thereby obtaining the session key. In the authentication phase, the device only proves its identity to the server. After the server sends an authentication pass message to the device, the device obtains the temporary key through the first random value r 1 and decrypts the temporary key to obtain the device number ID A , session key k s , session duration ΔT and the second random The identity of the server can be verified only after receiving several r 2 and other information. Therefore, the temporary key cannot be used directly as the session key. If a temporary key is used as the session key, the device may receive a fake signature and a false random value generated by the attacker through the server's public key, thereby generating an invalid session key.

因此,通过临时密钥获得会话密钥,设备端和服务器端双方之间以会话密钥进行通信,提高会话密钥的安全级别,很大程度上抵御经典攻击,提高设备的防伪能力和信息安全,为海量的物联网节点提供高级别的安全机制,保障各节点的数据安全。Therefore, the session key is obtained through the temporary key, and the device side and the server side communicate with the session key, which improves the security level of the session key, resists classic attacks to a large extent, and improves the anti-counterfeiting capability and information security of the device. , providing a high-level security mechanism for massive IoT nodes to ensure the data security of each node.

会话密钥用于在会话时长内,设备端与服务器端凭借会话密钥进行正常通信的,避免设备端与服务器端之间的通信被网络攻击、信息伪装等情况。还保障二者的通信安全,进一步为设备端提供高级别的安全机制,保障各节点的数据安全。The session key is used for normal communication between the device and the server within the session duration to avoid network attacks, information camouflage, etc. in the communication between the device and the server. It also ensures the communication security between the two, further provides a high-level security mechanism for the device side, and ensures the data security of each node.

在设备端与服务器端的会话过程中,实际设备端(尤其是物联网设备)与服务器端通信的过程中,为了保证加解密的效率,应该采用对称加密算法。作为对称加密算法的一种,SM4算法采用了复杂的S盒变换和32轮迭代设计,具有较高的抗差分攻击能力。差分攻击是一种密码分析方法,通过观察加密算法在不同输入差分下的行为,推导出密钥信息。SM4算法的设计考虑了抵御差分攻击的需求,增强了算法的安全性。SM4的密钥长度为128位,提供了足够的安全性保障。128位的密钥空间足够大,难以通过穷举搜索等暴力破解方法进行密钥攻击。所以,设备端与服务器端在密钥协商阶段和会话过程中,采用SM4算法进行加密解密,进一步保障了设备端的通信安全和数据安全,很大程度上抵御经典攻击,提高通信效率。During the conversation process between the device side and the server side, and during the communication process between the actual device side (especially IoT devices) and the server side, in order to ensure the efficiency of encryption and decryption, a symmetric encryption algorithm should be used. As a type of symmetric encryption algorithm, the SM4 algorithm uses complex S-box transformation and 32 rounds of iterative design, and has high resistance to differential attacks. A differential attack is a cryptanalysis method that deduces key information by observing the behavior of an encryption algorithm under different input differences. The design of the SM4 algorithm takes into account the need to resist differential attacks and enhances the security of the algorithm. The key length of SM4 is 128 bits, which provides sufficient security. The 128-bit key space is large enough to make it difficult to carry out key attacks through brute force cracking methods such as exhaustive search. Therefore, the device and server use the SM4 algorithm for encryption and decryption during the key negotiation phase and session process, which further ensures communication security and data security on the device, resists classic attacks to a large extent, and improves communication efficiency.

下面,阐述本实施例的设备端的身份验证方法的测试过程和测试结果:Next, the test process and test results of the device-side identity verification method in this embodiment are described:

Golang语言编写本实施例的设备端的身份验证方法,包括在安全信道上执行的设备端注册过程及在公共信道上设备端与服务器端的通信过程。测试过程主要围绕在公共信道上通信的效率展开。The device-side authentication method written in Golang language in this embodiment includes a device-side registration process executed on a secure channel and a communication process between the device side and the server side on a public channel. The testing process mainly revolves around the efficiency of communication on public channels.

在测试过程中,测试用的设备端为一台个人电脑。SM2算法、SM3算法和SM4算法的实现过程是,基于github开源项目gmsm实现的国密算法库为我们提出的协议编写SM2、SM3及SM4算法实现。During the test, the test device was a personal computer. The implementation process of the SM2 algorithm, SM3 algorithm and SM4 algorithm is to write SM2, SM3 and SM4 algorithm implementations for the protocol we proposed based on the national secret algorithm library implemented by the github open source project gmsm.

通信实现:为了实现测试设备端和服务器端之间的相互通信,采用了Golang标准库“net”提供的可移植的网络I/O接口执行对网络原语的访问,基于Dial、Listen和Accept函数提供的基本接口建立网络连接。Communication implementation: In order to realize mutual communication between the test equipment side and the server side, the portable network I/O interface provided by the Golang standard library "net" is used to perform access to network primitives, based on the Dial, Listen and Accept functions Provides a basic interface for establishing network connections.

协议实现:先通过Golang实现了本发明提出的身份认证阶段和会话密钥协商阶段的协议。再使用Visual Studio Code编译协议,通过编写设备端和服务器端的代码发出认证请求和密钥协商请求完成测试。Protocol implementation: First, the protocol of the identity authentication phase and session key negotiation phase proposed by this invention is implemented through Golang. Then use the Visual Studio Code compilation protocol to complete the test by writing device-side and server-side code to issue authentication requests and key agreement requests.

执行时间和内存占用:利用Golang标准库“testing”包提供的对Go包的自动化测试的支持来编写测试套件并反馈测试的执行时间和内存占用等信息。Execution time and memory usage: Use the Golang standard library "testing" package to provide support for automated testing of Go packages to write test suites and feedback information such as test execution time and memory usage.

测试过程:为了保证测试结果的可信性,共进行15轮测试,测试中的加密数据长度均为512字节,公私钥、共同密钥长度和分组长度均为128位。Test process: In order to ensure the credibility of the test results, a total of 15 rounds of tests were conducted. The length of the encrypted data in the test was all 512 bytes, and the public and private keys, common key length and group length were all 128 bits.

测试结果如下:The test results are as follows:

图4a为在15轮测试下的SM2算法执行公私钥生成、私钥签名、公钥验签、公钥加密、私钥解密、协商会话密钥和密钥交换等功能的速度的示意图,其横坐标为轮次,纵坐标为速度,单位(千次/秒s)。在图4a中,公私钥生成用填充斜下线图案的基准柱表示,密钥交换用填充竖线图案的基准柱表示,私钥签名用未填充图案的基准柱表示,公钥验签用填充横线图案的基准柱表示,公钥加密用填充黑白格图案的基准柱表示,私钥加密用填充交叉线图案的基准柱表示。图4b为在15轮测试下的SM2算法执行公私钥生成、私钥签名、公钥验签、公钥加密、私钥解密、协商会话密钥和密钥交换等功能的所含用内存的示意图,单位(KB/op)。从图4a和图4b可见,基于SM2算法执行的密钥生成和私钥签名等基础操作速度较快远高于公钥验签、公钥加密、私钥解密等操作,相比起其他操作,执行私钥签名操作占用的内存较大。Figure 4a is a schematic diagram of the speed at which the SM2 algorithm performs functions such as public and private key generation, private key signature, public key signature verification, public key encryption, private key decryption, negotiated session key and key exchange under 15 rounds of testing. The horizontal The coordinates are rounds, and the ordinate is speed, unit (thousand times per second). In Figure 4a, the public and private key generation is represented by a datum column filled with a diagonal underline pattern, the key exchange is represented by a datum bar filled with a vertical line pattern, the private key signature is represented by a datum bar without a filled pattern, and the public key signature verification is represented by a filled datum bar. The datum bar is represented by a horizontal line pattern, public key encryption is represented by a datum bar filled with a black and white grid pattern, and private key encryption is represented by a datum bar filled with a crosshatch pattern. Figure 4b is a schematic diagram of the memory used by the SM2 algorithm to perform functions such as public and private key generation, private key signature, public key signature verification, public key encryption, private key decryption, negotiation of session keys and key exchange under 15 rounds of testing. , unit (KB/op). It can be seen from Figure 4a and Figure 4b that basic operations such as key generation and private key signature based on the SM2 algorithm are much faster than operations such as public key signature verification, public key encryption, and private key decryption. Compared with other operations, Performing private key signing operations takes up a lot of memory.

图5为SM2算法与RAS算法分别执行相应功能的速度的示意图,SM2算法和RSA算法分别执行签名&验签、加密&解密等功能的速度,且二者均执行共15次测试。在图5中,SM2签名&验签用填充黑底白点图案的基准柱表示,SM2加密&解密用填充横线图案的基准柱表示,RSA签名&验签用未填充图案的基准柱表示,RSA加密&解密用填充白底黑点图案的基准柱表示。从图5可见,SM2的签名&验签的速度与加解密速度都快于RSA。这是由于SM2算法基于ECC(Elliptic Curve Cryptography,基于离散对数的椭圆曲线密码)实现的。在相同安全强度下,ECC比RSA的密钥位长及系统参数更小,即所需的存储空间也更小,传输所的带宽要求更低,硬件实现ECC所需逻辑电路的逻辑门数较RSA也更少,功耗更低。Figure 5 is a schematic diagram of the speed at which the SM2 algorithm and the RAS algorithm perform corresponding functions respectively. The speed at which the SM2 algorithm and the RSA algorithm perform functions such as signature & verification, encryption & decryption respectively, and both are tested a total of 15 times. In Figure 5, SM2 signature & verification are represented by reference bars filled with white dot patterns on a black background, SM2 encryption & decryption are represented by reference bars filled with horizontal lines, and RSA signature & verification are represented by reference bars without filled patterns. RSA encryption & decryption are represented by reference bars filled with a black dot pattern on a white background. As can be seen from Figure 5, SM2’s signature & verification speed and encryption and decryption speed are faster than RSA. This is because the SM2 algorithm is implemented based on ECC (Elliptic Curve Cryptography, elliptic curve cryptography based on discrete logarithms). Under the same security strength, ECC has smaller key bit length and smaller system parameters than RSA, that is, it requires smaller storage space, lower transmission bandwidth requirements, and the number of logic gates in the logic circuit required to implement ECC in hardware is smaller. There are also fewer RSAs and lower power consumption.

图6a为SM4(分组数据)算法执行ECB(Electronic Codebook,电子密码本)、CBC(Cipher-block chaining,密码分组链接)、CFB(Cipher feedback,密文反馈)以及OFB(output feedback,输出反馈)等算法模式所花费的时间的示意图。图6a的横坐标为轮次,共15轮测试。图6a的纵坐标为执行时间,单位:us。图6b为SM4算法执行ECB、CBC、CFB以及OFB等算法模式所占用的内存的示意图,单位:Byte/op,共15轮测试。在图6a中,ECB用填充白底黑点图案的基准柱表示,CFB用填充横线图案的基准柱表示,OFB用填充斜线图案的基准柱表示,CBC用未填充图案的基准柱表示。Figure 6a shows the SM4 (packet data) algorithm executing ECB (Electronic Codebook, electronic codebook), CBC (Cipher-block chaining, cipher block chaining), CFB (Cipher feedback, ciphertext feedback) and OFB (output feedback, output feedback) Illustration of time spent waiting for algorithm mode. The abscissa in Figure 6a is the rounds, with a total of 15 rounds of testing. The ordinate of Figure 6a is the execution time, unit: us. Figure 6b is a schematic diagram of the memory occupied by the SM4 algorithm when executing algorithm modes such as ECB, CBC, CFB and OFB. Unit: Byte/op, a total of 15 rounds of testing. In Figure 6a, ECB is represented by a reference column filled with a black dot pattern on a white background, CFB is represented by a reference column filled with a horizontal line pattern, OFB is represented by a reference column filled with a diagonal pattern, and CBC is represented by a reference column without a pattern filled.

从图6a和图6b可见,不同分组密码模式下SM4算法的执行时间,加解密的信息为设备端与服务器端协商的共同密钥,即会话密钥,长度为128bits。其中,CBC模式运行所需时间和占用的内存高于其他三种模式。OFB模式运行占用的内存和CFB模式运行占用的内存一致。在具体实践中,可以根据设备端的情况自行选择。因为不同的加密模式的加密过程和解密过程有差距,会导致运行时间和占用内存的差异。在测试过程中,只是测试了不同加密模式在该验证方案中的具体表现,但并不指定使用某种加密模式。It can be seen from Figure 6a and Figure 6b that the execution time of the SM4 algorithm in different block cipher modes is that the encrypted and decrypted information is the common key negotiated between the device and the server, that is, the session key, with a length of 128 bits. Among them, the CBC mode takes longer to run and consumes more memory than the other three modes. The memory occupied by OFB mode operation is the same as the memory occupied by CFB mode operation. In specific practice, you can choose according to the situation on the device side. Because there are differences between the encryption and decryption processes of different encryption modes, this will lead to differences in running time and memory usage. During the test, the specific performance of different encryption modes in the verification scheme was tested, but the use of a certain encryption mode was not specified.

如表1所示,表1展示协议性能测试结果,主要是对身份认证过程及密钥协商通信过程中的SM2数字签名生成、SM2数字签名验证、SM2加密、SM2解密、SM3摘要生成、SM4加密、SM4解密的速率进行测试。从协议性能测试结果来看,通过15轮的测试,SM2加解密速度约为900次/s,SM3的执行速度也约为2000次/s,SM4加解密速度约为3000多次/s。由于因为SM3是哈希算法,则没有分解成多个过程。因此,经过多轮测试后发现,各个协议运行稳定,各项功能表现较好,能够达到预期的效果。As shown in Table 1, Table 1 shows the protocol performance test results, mainly for SM2 digital signature generation, SM2 digital signature verification, SM2 encryption, SM2 decryption, SM3 digest generation, and SM4 encryption during the identity authentication process and key negotiation communication process. , SM4 decryption rate is tested. Judging from the protocol performance test results, after 15 rounds of testing, the encryption and decryption speed of SM2 is about 900 times/s, the execution speed of SM3 is also about 2000 times/s, and the encryption and decryption speed of SM4 is about 3000 times/s. Since SM3 is a hash algorithm, it is not broken down into multiple processes. Therefore, after multiple rounds of testing, it was found that each protocol runs stably, various functions perform well, and can achieve the expected results.

从上述测试结果可知,本实施例的身份验证方法结合SM2算法、SM3算法和SM4算法实施,在提高设备端的通信安全和数据安全的同时,优化了设备端的计算量和处理量,实现轻量级、适应于设备端和服务器端双方使用的安全认证和会话密钥建立方案。并为海量的物联网节点提供高级别的安全机制,保证各节点的数据安全。It can be seen from the above test results that the identity verification method of this embodiment is implemented in combination with the SM2 algorithm, SM3 algorithm and SM4 algorithm. While improving the communication security and data security of the device, it also optimizes the calculation and processing volume of the device and achieves lightweight , adapted to the security authentication and session key establishment scheme used by both the device side and the server side. It also provides a high-level security mechanism for massive IoT nodes to ensure the data security of each node.

本发明实施例中的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:

在本发明实施例中,设备端在与服务器端建立连接后,设备端通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将认证消息发送至服务器端,以使服务器端根据认证消息得到认证通过消息。这里,设备端预先存储通过物理不可克隆函数得到的一个目标响应信号,并且通过SM3算法处理得到认证消息,将认证消息发送至服务器端,以使服务器端验证设备端的身份。通过目标响应信号实现设备端与服务器端后续认证过程和会话过程,无需预先存储大量PUF响应,减少设备端的计算量,更适用于物联网设备,实现设备端与服务器端之间的轻量级通信过程。结合SM3算法,提高了设备端的通信过程的安全性和保密性。In the embodiment of the present invention, after the device side establishes a connection with the server side, the device side uses the SM3 algorithm to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, and sends the authentication message to the server side, so that the server side Obtain the authentication pass message according to the authentication message. Here, the device pre-stores a target response signal obtained through the physical unclonable function, obtains the authentication message through SM3 algorithm processing, and sends the authentication message to the server, so that the server can verify the identity of the device. The subsequent authentication process and session process between the device side and the server side are realized through the target response signal. There is no need to store a large number of PUF responses in advance, which reduces the calculation amount on the device side. It is more suitable for IoT devices and realizes lightweight communication between the device side and the server side. process. Combined with the SM3 algorithm, the security and confidentiality of the communication process on the device side are improved.

接着,获取认证通过消息,通过预存的服务器端的公钥对认证通过消息的数字签名进行验证,得到签名结果。如果签名结果为通过验证结果,则通过SM4算法解密认证通过消息得到会话时长和会话密钥参数,其中,会话密钥参数用于在会话时长内,通过会话密钥参数与服务器端之间的进行通信。通过SM4算法和会话密钥的匹配使用,设备端与服务器端通过网络先建立安全的共享会话密钥再进行保密通信,保障了设备端与服务器端之间通信的加解密效率和通信安全,使设备端具有较高的抗差分攻击能力,很大程度上抵御经典攻击,提高通信效率。Then, obtain the authentication-passed message, verify the digital signature of the authentication-passed message through the pre-stored server-side public key, and obtain the signature result. If the signature result is a verification result, the SM4 algorithm is used to decrypt the authentication message to obtain the session duration and session key parameters. The session key parameter is used to communicate with the server through the session key parameter within the session duration. communication. Through the matching use of SM4 algorithm and session key, the device and the server first establish a secure shared session key through the network and then conduct confidential communication, ensuring the encryption and decryption efficiency and communication security of the communication between the device and the server. The device side has high resistance to differential attacks, can resist classic attacks to a large extent, and improves communication efficiency.

实施例二Embodiment 2

本发明第一实施例提供了一种身份验证方法,如图7所示,应用于服务器端,所述方法包括:The first embodiment of the present invention provides an identity verification method, as shown in Figure 7, applied to the server side. The method includes:

S201,在与设备端建立连接后,获取所述设备端发送的认证消息;S201: After establishing a connection with the device, obtain the authentication message sent by the device;

S202,根据所述认证消息的设备编号搜索到预存的目标响应信号,根据所述目标响应信号和SM3算法,得到目标哈希值;S202, search for a pre-stored target response signal according to the device number of the authentication message, and obtain the target hash value according to the target response signal and the SM3 algorithm;

S203,若所述目标哈希值与预存的哈希值一致,则获取认证通过消息,并将所述认证通过消息发送至所述设备端。S203. If the target hash value is consistent with the pre-stored hash value, obtain an authentication pass message and send the authentication pass message to the device.

优选的,所述获取认证通过消息,包括:Preferably, the obtaining the authentication pass message includes:

获取会话密钥、第一随机数和第二随机数;Get the session key, the first random number and the second random number;

根据所述目标响应信号、所述第一随机数和所述SM3算法,得到临时密钥;Obtain a temporary key according to the target response signal, the first random number and the SM3 algorithm;

通过SM4算法的加密算法对所述设备编号、所述会话密钥、会话时长和所述第二随机数进行加密,得到密文;Encrypt the device number, the session key, the session duration and the second random number using the encryption algorithm of the SM4 algorithm to obtain ciphertext;

通过所述服务器端的私钥对当前时间戳、所述第一随机数和所述密文进行数字签名处理,得到数字签名,再根据所述当前时间戳、所述第一随机数和所述数字签名,得到所述认证通过消息。The current timestamp, the first random number and the ciphertext are digitally signed using the private key of the server to obtain a digital signature, and then the digital signature is obtained based on the current timestamp, the first random number and the digital Sign, and get the authentication passed message.

优选的,在将所述认证通过消息发送至所述设备端之后,还包括:Preferably, after sending the authentication pass message to the device, the method further includes:

在所述会话时长内,获取所述设备端发送的会话消息;Within the session duration, obtain the session message sent by the device;

对所述会话消息进行解密,得到所述会话消息的消息内容和验证随机值;Decrypt the session message to obtain the message content and verification random value of the session message;

若所述验证随机值与所述第二随机值一致,则与所述设备端进行通信。If the verification random value is consistent with the second random value, communication is performed with the device.

实施例三Embodiment 3

基于相同的发明构思,本发明第二实施例还提供了一种芯片,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述身份验证方法中的任一方法的步骤。Based on the same inventive concept, a second embodiment of the present invention also provides a chip, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program Steps to implement any of the above authentication methods.

由于本实施例所介绍的芯片为实施本申请实施例一中身份验证方法所采用的芯片,故而基于本申请实施例一中所介绍的身份验证方法,本领域所属技术人员能够了解本实施例的芯片的具体实施方式以及其各种变化形式,所以在此对于该芯片如何实现本申请实施例一中的方法不再详细介绍。只要本领域所属技术人员实施本申请实施例一中身份验证方法所采用的芯片,都属于本申请所欲保护的范围。Since the chip introduced in this embodiment is the chip used to implement the identity verification method in Embodiment 1 of this application, based on the identity verification method introduced in Embodiment 1 of this application, those skilled in the art can understand the method of this embodiment. The specific implementation mode of the chip and its various modifications, therefore, how the chip implements the method in Embodiment 1 of the present application will not be described in detail here. As long as those skilled in the art implement the chips used in the identity verification method in Embodiment 1 of this application, they all fall within the scope of protection intended by this application.

实施例四Embodiment 4

基于相同的发明构思,本发明第四实施例还提供了一种电子设备,包括上述的芯片。Based on the same inventive concept, a fourth embodiment of the present invention also provides an electronic device, including the above chip.

本领域内的技术人员应明白,本发明的实施例可提供为方法、设备(系统)、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will understand that embodiments of the present invention may be provided as methods, devices (systems), or computer program products. Thus, the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art will be able to make additional changes and modifications to these embodiments once the basic inventive concepts are apparent. Therefore, it is intended that the appended claims be construed to include the preferred embodiments and all changes and modifications that fall within the scope of the invention.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (10)

1.一种身份验证方法,其特征在于,应用于设备端,所述方法包括:1. An identity verification method, characterized in that it is applied to the device side, and the method includes: 在与服务器端建立连接后,通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,并将所述认证消息发送至所述服务器端,以使所述服务器端根据所述认证消息得到认证通过消息;After establishing a connection with the server, use the SM3 algorithm to obtain the authentication message from the target response signal of the pre-stored physical unclonable function, and send the authentication message to the server, so that the server can use the SM3 algorithm to obtain the authentication message according to the authentication message. Get the certification pass message; 获取所述认证通过消息,通过预存的所述服务器端的公钥对所述认证通过消息的数字签名进行验证,得到签名结果;Obtain the authentication passing message, verify the digital signature of the authentication passing message through the pre-stored server-side public key, and obtain a signature result; 如果签名结果为通过验证结果,则通过SM4算法的解密算法解密所述认证通过消息得到会话时长和会话密钥参数,其中,所述会话密钥参数用于在所述会话时长内,通过所述会话密钥参数与所述服务器端之间的进行通信。If the signature result is a passing verification result, the authentication passing message is decrypted using the decryption algorithm of the SM4 algorithm to obtain the session duration and session key parameters, wherein the session key parameter is used to pass the authentication within the session duration. Session key parameters are communicated with the server side. 2.如权利要求1所述的方法,其特征在于,在与所述服务器端建立连接之前,还包括:2. The method according to claim 1, characterized in that, before establishing a connection with the server, it further includes: 在安全信道中,向所述服务器端发送注册请求信号,以使所述服务器端根据接受到的所述注册请求信号,发送初始激励信号和所述服务器端的公钥,其中,所述注册请求信号包括所述设备端的设备编号,所述服务器端的公钥为通过SM2算法加密的公钥;In the secure channel, a registration request signal is sent to the server, so that the server sends an initial stimulus signal and the public key of the server according to the received registration request signal, wherein the registration request signal Includes the device number of the device, and the public key of the server is a public key encrypted by the SM2 algorithm; 接收所述初始激励信号和所述服务器端的公钥,并根据所述初始激励信号和所述物理不可克隆函数,得到所述目标响应信号;Receive the initial excitation signal and the public key of the server, and obtain the target response signal based on the initial excitation signal and the physical unclonable function; 存储所述目标响应信号和所述服务器端的公钥,并将所述目标响应信号发送至所述服务器端,以使所述服务器端存储所述目标响应信号和所述设备编号。Store the target response signal and the public key of the server, and send the target response signal to the server, so that the server stores the target response signal and the device number. 3.如权利要求2所述的方法,其特征在于,所述通过SM3算法将预存的物理不可克隆函数的目标响应信号得到认证消息,包括:3. The method according to claim 2, characterized in that obtaining the authentication message from the target response signal of the pre-stored physical unclonable function through the SM3 algorithm includes: 通过所述SM3算法处理所述目标响应信号和当前时间戳,得到认证激励信号,再根据所述物理不可克隆函数和所述认证激励信号,得到认证响应信号;Process the target response signal and the current timestamp through the SM3 algorithm to obtain an authentication excitation signal, and then obtain an authentication response signal based on the physical unclonable function and the authentication excitation signal; 根据所述认证激励信号、所述认证响应信号、所述目标响应信号、所述当前时间戳和所述设备编号,得到所述认证消息。The authentication message is obtained according to the authentication stimulus signal, the authentication response signal, the target response signal, the current timestamp and the device number. 4.如权利要求1所述的方法,其特征在于,所述通过SM4算法解密所述认证通过消息得到会话时长和会话密钥参数,包括:4. The method of claim 1, wherein the session length and session key parameters are obtained by decrypting the authentication pass message using the SM4 algorithm, including: 对所述认证通过消息进行验证,得到第一随机数和密文;Verify the authentication pass message to obtain the first random number and ciphertext; 根据第一随机数和所述目标响应信号,得到临时密钥;Obtain the temporary key according to the first random number and the target response signal; 通过所述SM4算法和所述临时密钥对所述密文进行解密,得到所述会话时长和所述会话密钥参数,所述会话密钥参数包括会话密钥和所述密文的第二随机数。The ciphertext is decrypted using the SM4 algorithm and the temporary key to obtain the session duration and the session key parameters. The session key parameters include the session key and the second part of the ciphertext. random number. 5.如权利要求1所述的方法,其特征在于,所述在所述会话时长内,还包括:5. The method of claim 1, wherein within the session duration, it further includes: 根据所述会话密钥参数和所述SM4算法得到会话消息,并将所述会话消息发送至所述服务器端,以使所述服务器端根据所述会话消息得到会话反馈消息,用于实现与所述服务器端之间的通信。Obtain a session message according to the session key parameter and the SM4 algorithm, and send the session message to the server, so that the server can obtain a session feedback message according to the session message, which is used to implement the communication with the server. Describes communication between servers. 6.一种身份验证方法,其特征在于,应用于服务器端,所述方法包括:6. An identity verification method, characterized in that it is applied to the server side, and the method includes: 在与设备端建立连接后,获取所述设备端发送的认证消息;After establishing a connection with the device, obtain the authentication message sent by the device; 根据所述认证消息的设备编号搜索到预存的目标响应信号,根据所述目标响应信号和SM3算法,得到目标哈希值;Search for the pre-stored target response signal according to the device number of the authentication message, and obtain the target hash value based on the target response signal and the SM3 algorithm; 若所述目标哈希值与预存的哈希值一致,则获取认证通过消息,并将所述认证通过消息发送至所述设备端。If the target hash value is consistent with the pre-stored hash value, an authentication pass message is obtained, and the authentication pass message is sent to the device. 7.如权利要求6所述的方法,其特征在于,所述获取认证通过消息,包括:7. The method of claim 6, wherein obtaining the authentication pass message includes: 获取会话密钥、第一随机数和第二随机数;Get the session key, the first random number and the second random number; 根据所述目标响应信号、所述第一随机数和所述SM3算法,得到临时密钥;Obtain a temporary key according to the target response signal, the first random number and the SM3 algorithm; 通过SM4算法的加密算法对所述设备编号、所述会话密钥、会话时长和所述第二随机数进行加密,得到密文;Encrypt the device number, the session key, the session duration and the second random number using the encryption algorithm of the SM4 algorithm to obtain ciphertext; 通过所述服务器端的私钥对当前时间戳、所述第一随机数和所述密文进行数字签名处理,得到数字签名,再根据所述当前时间戳、所述第一随机数和所述数字签名,得到所述认证通过消息。The current timestamp, the first random number and the ciphertext are digitally signed using the private key of the server to obtain a digital signature, and then the digital signature is obtained based on the current timestamp, the first random number and the digital Sign, and get the authentication passed message. 8.如权利要求7所述的方法,其特征在于,在将所述认证通过消息发送至所述设备端之后,还包括:8. The method of claim 7, wherein after sending the authentication pass message to the device, it further includes: 在所述会话时长内,获取所述设备端发送的会话消息;Within the session duration, obtain the session message sent by the device; 对所述会话消息进行解密,得到所述会话消息的消息内容和验证随机值;Decrypt the session message to obtain the message content and verification random value of the session message; 若所述验证随机值与所述第二随机值一致,则与所述设备端进行通信。If the verification random value is consistent with the second random value, communication is performed with the device. 9.一种芯片,其特征在于,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1-5中任一权利要求所述的方法步骤。9. A chip, characterized in that it includes a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the program, it implements claim 1- The method steps of any one of claims 5. 10.一种电子设备,包括如权利要求9所述的芯片。10. An electronic device, comprising the chip according to claim 9.
CN202311491646.XA 2023-11-10 2023-11-10 An identity verification method, chip and device Pending CN117675285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311491646.XA CN117675285A (en) 2023-11-10 2023-11-10 An identity verification method, chip and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311491646.XA CN117675285A (en) 2023-11-10 2023-11-10 An identity verification method, chip and device

Publications (1)

Publication Number Publication Date
CN117675285A true CN117675285A (en) 2024-03-08

Family

ID=90083569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311491646.XA Pending CN117675285A (en) 2023-11-10 2023-11-10 An identity verification method, chip and device

Country Status (1)

Country Link
CN (1) CN117675285A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118157859A (en) * 2024-05-09 2024-06-07 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) A device security communication method and device based on national secret security chip
CN118413334A (en) * 2024-07-04 2024-07-30 济南大学 A dual PUF identity authentication method for industrial Internet scenarios
CN119011137A (en) * 2024-07-30 2024-11-22 翼盾(上海)智能科技有限公司 Safety communication protocol method and system based on microchip fingerprint technology
CN119089460A (en) * 2024-08-06 2024-12-06 未来基因(北京)人工智能研究院有限公司 Data transmission protection method and computer device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118157859A (en) * 2024-05-09 2024-06-07 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) A device security communication method and device based on national secret security chip
CN118413334A (en) * 2024-07-04 2024-07-30 济南大学 A dual PUF identity authentication method for industrial Internet scenarios
CN119011137A (en) * 2024-07-30 2024-11-22 翼盾(上海)智能科技有限公司 Safety communication protocol method and system based on microchip fingerprint technology
CN119089460A (en) * 2024-08-06 2024-12-06 未来基因(北京)人工智能研究院有限公司 Data transmission protection method and computer device

Similar Documents

Publication Publication Date Title
US12375304B2 (en) Mutual authentication of confidential communication
US20210367753A1 (en) Trusted measurement and control network authentication method based on double cryptographic values and chaotic encryption
US11533297B2 (en) Secure communication channel with token renewal mechanism
US8670563B2 (en) System and method for designing secure client-server communication protocols based on certificateless public key infrastructure
CN113268715A (en) Software encryption method, device, equipment and storage medium
CN103532713B (en) Sensor authentication and shared key production method and system and sensor
WO2016058404A1 (en) Entity authentication method and device based on pre-shared key
CN117675285A (en) An identity verification method, chip and device
CN112351037B (en) Information processing method and device for secure communication
CN107800675A (en) A kind of data transmission method, terminal and server
CN106549751A (en) Key exchange apparatus and method
CN113918967B (en) Data transmission method, system, computer equipment, and medium based on security verification
CN114513339A (en) A security authentication method, system and device
WO2023284691A1 (en) Account opening method, system, and apparatus
CN115632797A (en) A secure authentication method based on zero-knowledge proof
CN119766433A (en) Encryption communication method, device and system supporting post quantum algorithm
CN114513316B (en) An identity-based anonymous authentication method, server and user terminal equipment
JP2004274134A (en) Communication method and communication system, server and client using this communication method
CN117714185A (en) Bank counter data processing method and system based on cryptographic algorithm
CN116760530A (en) A lightweight authentication key agreement method for power Internet of Things terminals
CN119172743B (en) Terminal identity identification method, device and system
CN109088728B (en) Electric power system debugging tool encrypted communication method based on shared secret key
CN119766447A (en) IPSEC VPN remote access method, system and computer equipment supporting post quantum algorithm
HK40045503B (en) Information processing method and device for secure communication
HK40045503A (en) Information processing method and device for secure communication

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