[go: up one dir, main page]

CN114417309A - Bidirectional identity authentication method, device, equipment and storage medium - Google Patents

Bidirectional identity authentication method, device, equipment and storage medium Download PDF

Info

Publication number
CN114417309A
CN114417309A CN202210064883.7A CN202210064883A CN114417309A CN 114417309 A CN114417309 A CN 114417309A CN 202210064883 A CN202210064883 A CN 202210064883A CN 114417309 A CN114417309 A CN 114417309A
Authority
CN
China
Prior art keywords
sender
receiver
communication entity
random number
signature value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210064883.7A
Other languages
Chinese (zh)
Other versions
CN114417309B (en
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.)
Digital Guangdong Network Construction Co Ltd
Original Assignee
Digital Guangdong Network Construction Co Ltd
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 Digital Guangdong Network Construction Co Ltd filed Critical Digital Guangdong Network Construction Co Ltd
Priority to CN202210064883.7A priority Critical patent/CN114417309B/en
Publication of CN114417309A publication Critical patent/CN114417309A/en
Application granted granted Critical
Publication of CN114417309B publication Critical patent/CN114417309B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention discloses a bidirectional identity authentication method, a bidirectional identity authentication device, bidirectional identity authentication equipment and a bidirectional identity authentication storage medium. The method comprises the following steps: receiving a sender identification, a sender random number and a sender signature value; generating a sender identification public key according to the pre-acquired public parameters and the sender identification, and verifying the sender random number and the sender signature value by using the sender identification public key; and if the verification result is successful, generating a receiver time stamp signature value according to a pre-acquired receiver private key, and sending the receiver time stamp signature value and a receiver identifier corresponding to the receiver communication entity to the sender communication entity. The technical scheme of the embodiment of the invention improves the efficiency of the identity authentication of both sides of the communication entity, reduces the management cost of the authentication information in the authentication process, and simultaneously improves the safety of the identity authentication of both sides of the communication entity by combining the identification number, the time and the random number during the bidirectional authentication.

Description

一种双向身份验证方法、装置、设备及存储介质A two-way authentication method, device, device and storage medium

技术领域technical field

本发明实施例涉及通信安全技术领域,尤其涉及一种双向身份验证方法、装置、设备及存储介质。Embodiments of the present invention relate to the technical field of communication security, and in particular, to a bidirectional authentication method, apparatus, device, and storage medium.

背景技术Background technique

随着互联网的不断发展和应用的不断丰富,基于云计算基础设施的办公应用、安全接入、电子邮件、视频会议等信息系统也得以普及应用。而随着攻击手段的不断翻新,黑客通过暴力破解、自动化代理等方式冒充用户、盗用用户身份信息、对用户隐私数据进行窃取、窥探的社会工程学信息安全问题日益凸显,对确保接入用户身份真实性进行验证成为保障信息安全的一种重要实施手段。With the continuous development of the Internet and the continuous enrichment of applications, information systems such as office applications, secure access, email, and video conferencing based on cloud computing infrastructure have also been popularized. With the continuous renovation of attack methods, hackers impersonate users, steal user identity information, steal user privacy data, and snoop on through brute force cracking, automated agents and other methods. Social engineering information security problems have become increasingly prominent. Authenticity verification has become an important means of implementation to ensure information security.

在典型的电子政务网络应用中,设备与设备间的认证,以及用户到设备之间的认证均非常普遍。然而,现有接入过程中对用户或设备进行身份认证鉴别时,通常使用用户名和口令认证,存在一定的安全风险。而通过数字证书认证技术对二者进行认证时,需要通过可信任的证书认证中心下发的数字证书进行认证,但其针对证书的管理较为繁琐且花费较高,在技术实现上难度较高。而在大多数服务提供商为规避繁琐问题使用自生成的证书进行认证时,难以预防中间人攻击的安全风险,若黑客通过自生成证书在需要进行通信的通信实体双方间建立起伪信任通道后,则能够对双方通信数据进行无障碍窥探和盗取。降低了通信双方身份验证的效率和安全性,无法保障通信双方接入过程中的身份鉴别的安全与易用,降低了通信实体双向身份验证的完备性。In typical e-government network applications, device-to-device authentication and user-to-device authentication are very common. However, when performing identity authentication and authentication on users or devices in the existing access process, user names and passwords are usually used for authentication, and there are certain security risks. When the two are authenticated through digital certificate authentication technology, they need to be authenticated by a digital certificate issued by a trusted certificate certification center. However, when most service providers use self-generated certificates for authentication to avoid cumbersome problems, it is difficult to prevent the security risk of man-in-the-middle attacks. Then, the communication data between the two parties can be snooped and stolen without barriers. The efficiency and security of the authentication of the two parties in communication are reduced, the security and ease of use of the identity authentication in the access process of the two parties in the communication cannot be guaranteed, and the completeness of the two-way authentication of the communication entities is reduced.

发明内容SUMMARY OF THE INVENTION

本发明提供一种双向身份验证方法、装置、设备及存储介质,以在通信实体双方需要进行通信前对双方身份进行验证,提升了通信实体双方身份验证的验证效率与安全性,降低了验证过程对验证信息的管理难度,减少了通信实体中针对身份验证所需的内存,降低了双向身份验证成本。The present invention provides a two-way identity verification method, device, equipment and storage medium, so as to verify the identities of both communication entities before they need to communicate, improve the verification efficiency and security of the identity verification of both communication entities, and reduce the verification process The difficulty of managing authentication information reduces the memory required for authentication in the communication entity and reduces the cost of two-way authentication.

第一方面,本发明实施例提供的一种双向身份验证方法,应用于接收方通信实体,包括:In a first aspect, a two-way authentication method provided by an embodiment of the present invention, applied to a recipient communication entity, includes:

接收发送方标识、发送方随机数以及发送方签名值;Receive the sender's identity, sender's random number, and sender's signature value;

根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;Generate the sender's identity public key according to the pre-obtained public parameters and the sender's identity, and use the sender's identity public key to verify the sender's random number and the sender's signature value;

若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。If the verification result is successful, the receiver timestamp signature value is generated according to the receiver's private key obtained in advance, and the receiver timestamp signature value and the receiver identifier corresponding to the receiver communication entity are sent to the sender communication entity.

进一步地,利用发送方标识公钥验证发送方随机数与发送方签名值,包括:Further, using the sender's identification public key to verify the sender's random number and the sender's signature value, including:

通过发送方标识公钥对发送方签名值进行解密,确定解密数值;Decrypt the sender's signature value through the sender's identification public key to determine the decrypted value;

若解密数值与发送方随机数相同,则将验证结果确定为成功;If the decryption value is the same as the sender's random number, the verification result is determined to be successful;

否则,将验证结果确定为失败。Otherwise, the verification result is determined to fail.

进一步地,根据预先获取的接收方私钥生成接收方时戳签名值,包括:Further, the receiver timestamp signature value is generated according to the receiver's private key obtained in advance, including:

由公共时钟获取接收方时间戳;Obtain the receiver timestamp from the public clock;

将接收方时间戳与发送方随机数进行字段组合,生成时戳随机数;Combine the receiver's timestamp with the sender's random number to generate a timestamp random number;

通过预先获取的接收方私钥对时戳随机数签名加密,生成接收方时戳签名值。The timestamp random number is signed and encrypted by the receiver's private key obtained in advance, and the receiver timestamp signature value is generated.

进一步地,在将验证结果确定为失败之后,还包括:Further, after the verification result is determined to be a failure, the method further includes:

取消接收方通信实体与发送方通信实体的通信。Cancels the communication between the receiver communication entity and the sender communication entity.

进一步地,在接收发送方标识、发送方随机数以及发送方签名值之前,还包括:Further, before receiving the sender identifier, the sender random number and the sender signature value, the method further includes:

根据接收方通信实体对应的接收方标识,由密钥管理平台获取接收方通信实体对应的接收方私钥与公共参数。According to the receiver identifier corresponding to the receiver communication entity, the key management platform obtains the receiver private key and public parameters corresponding to the receiver communication entity.

第二方面,本发明实施例还提供了一种双向身份验证方法,应用于发送方通信实体,包括:In the second aspect, the embodiment of the present invention also provides a two-way authentication method, which is applied to the sender communication entity, including:

在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值;When secure communication is required, the sender's random number is generated, and the sender's random number is signed and encrypted by the sender's private key obtained in advance to generate the sender's signature value;

将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体;Send the sender's random number, the sender's signature value, and the sender's identity corresponding to the sender's communication entity to the receiver's communication entity;

根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证;Generate the receiver's identification public key according to the received receiver's identification and pre-obtained public parameters, and use the receiver's identification public key and the sender's random number to verify the received receiver's timestamp signature value;

根据验证结果建立发送方通信实体与接收方通信实体间的通信。The communication between the sender communication entity and the receiver communication entity is established according to the verification result.

进一步地,利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证,包括:Further, using the receiver's identification public key and the sender's random number to verify the received receiver's timestamp signature value, including:

通过接收方标识公钥对接收方时戳签名值进行解密,确定接收方时间戳与解密随机数值;Decrypt the signature value of the receiver's timestamp by using the receiver's identification public key to determine the receiver's timestamp and the decrypted random value;

由公共时钟获取发送方时间戳;Get the sender's timestamp from the public clock;

根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证。The receiver timestamp and decryption random value are verified according to the sender timestamp and the sender random number.

进一步地,根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证,包括:Further, according to the sender's timestamp and the sender's random number, the receiver's timestamp and the decrypted random value are verified, including:

确定发送方时间戳与接收方时间戳间的时间差值;Determine the time difference between the sender's timestamp and the receiver's timestamp;

若时间差值小于预设时间阈值,且解密随机数值与发送方随机数相同,则确定验证结果为成功;If the time difference is less than the preset time threshold, and the decryption random value is the same as the sender's random number, the verification result is determined to be successful;

否则,确定验证结果为失败。Otherwise, the verification result is determined to be failed.

进一步地,根据验证结果建立发送方通信实体与接收方通信实体间的通信,包括:Further, establishing the communication between the communication entity of the sender and the communication entity of the receiver according to the verification result, including:

若验证结果为成功,建立发送方通信实体与接收方通信实体的通信;If the verification result is successful, establish the communication between the communication entity of the sender and the communication entity of the receiver;

若验证结果为失败,取消接收方通信实体与发送方通信实体的通信。If the verification result is failure, the communication between the receiver communication entity and the sender communication entity is cancelled.

进一步地,在进行安全通信之前,还包括:Further, before the secure communication, it also includes:

根据发送方通信实体对应的发送方标识,由密钥管理平台获取发送方通信实体对应的发送方私钥与公共参数。According to the sender identifier corresponding to the sender's communication entity, the key management platform obtains the sender's private key and public parameters corresponding to the sender's communication entity.

第三方面,本发明实施例还提供了一种双向身份验证装置,应用于接收方通信实体,双向身份验证装置包括:In a third aspect, an embodiment of the present invention also provides a two-way identity verification device, which is applied to a recipient communication entity, and the two-way identity verification device includes:

参数接收模块,用于接收发送方标识、发送方随机数以及发送方签名值;The parameter receiving module is used to receive the sender's identity, sender's random number and sender's signature value;

签名值验证模块,用于根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;The signature value verification module is used to generate the sender's identification public key according to the pre-obtained public parameters and the sender's identification, and use the sender's identification public key to verify the sender's random number and the sender's signature value;

第一参数发送模块,用于若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。The first parameter sending module is used to generate the receiver's timestamp signature value according to the receiver's private key obtained in advance if the verification result is successful, and send the receiver's timestamp signature value and the receiver's identity corresponding to the receiver's communication entity Sent to the sender communicating entity.

第四方面,本发明实施例还提供了一种双向身份验证装置,应用于发送方通信实体,双向身份验证装置包括:In a fourth aspect, an embodiment of the present invention further provides a two-way identity verification device, which is applied to a sender communication entity, and the two-way identity verification device includes:

签名值生成模块,用于在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值;The signature value generation module is used to generate the sender's random number when secure communication is required, and encrypt the sender's random number through the pre-acquired sender's private key signature to generate the sender's signature value;

第二参数发送模块,用于将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体;The second parameter sending module is used to send the random number of the sender, the signature value of the sender, and the sender identifier corresponding to the sender's communication entity to the receiver's communication entity;

参数验证模块,用于根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证;The parameter verification module is used to generate the receiver identification public key according to the received receiver identification and pre-acquired public parameters, and use the receiver identification public key and the sender random number to verify the received receiver timestamp signature value ;

通信建立模块,用于根据验证结果建立发送方通信实体与接收方通信实体间的通信。The communication establishment module is used for establishing the communication between the communication entity of the sender and the communication entity of the receiver according to the verification result.

第五方面,本发明实施例还提供了一种双向身份验证设备,包括:In a fifth aspect, an embodiment of the present invention further provides a two-way authentication device, including:

存储装置以及一个或多个处理器;a storage device and one or more processors;

存储装置,用于存储一个或多个程序;a storage device for storing one or more programs;

当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器在双向身份验证设备为接收方通信实体时,实现如上述第一方面的双向身份验证方法,在双向身份验证设备为发送方通信实体时,实现如上述第二方面的双向身份验证方法。When the one or more programs are executed by one or more processors, so that the one or more processors are the recipient communication entity when the two-way authentication device is used, the two-way authentication method as described in the first aspect above is implemented, and the two-way authentication When the device is the sender communication entity, the two-way authentication method as described in the second aspect above is implemented.

第六方面,本发明实施例还提供了一种包含计算机可执行指令的存储介质,上述计算机可执行指令在由计算机处理器执行时用于执行如上述第一方面或第二方面的双向身份验证方法。In a sixth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions, when executed by a computer processor, are used to perform the two-way authentication according to the first aspect or the second aspect. method.

本发明实施例提供的一种双向身份验证方法、装置、设备及存储介质,针对于接收方通信实体,通过接收发送方标识、发送方随机数以及发送方签名值;根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。通过采用上述技术方案,在需要进行安全通信时,接收方通信实体通过接收到的发送方通信实体的发送方随机数、发送方签名值以及发送方标识验证该发送方通信实体为其需要进行通信连接的通信实体,进而依据预先获取的接收方私钥以及接收方通信实体向发送方通信实体进行信息发送的时间生成接收方时戳签名值,并将该接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体,以使发送方通信实体可根据包含有时戳信息的接收方时戳签名值与接收方标识对接收方通信实体进行身份验证。解决了传统双向身份验证时若依赖于口令认证技术,则安全性低,若依赖于证书认证技术,则需依赖第三方证书认证中心,管理繁杂且成本高的问题。由于双方进行身份验证时无需通过第三方证书认证中心获取数字证书,也无需在本地进行证书信息存储,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,同时在进行双向验证时,采用标识号、时间与随机数相结合的方式提升了通信实体双方身份验证的安全性。A two-way identity verification method, device, device, and storage medium provided by the embodiments of the present invention, for the recipient communication entity, receive the sender identifier, the sender random number, and the sender signature value; The sender ID generates the sender ID public key, and uses the sender ID public key to verify the sender's random number and the sender's signature value; if the verification result is successful, the recipient's timestamp signature value is generated according to the receiver's private key obtained in advance, and send the receiver's time stamp signature value and the receiver's identity corresponding to the receiver's communication entity to the sender's communication entity. By adopting the above technical solution, when secure communication is required, the receiver communication entity verifies that the sender communication entity needs to communicate through the received sender random number, sender signature value and sender identity of the sender communication entity. The connected communication entity, and then generates the receiver timestamp signature value according to the pre-acquired receiver private key and the time when the receiver communication entity sends information to the sender communication entity, and combines the receiver timestamp signature value with the receiver. The receiver identification corresponding to the communication entity is sent to the sender communication entity, so that the sender communication entity can authenticate the receiver communication entity according to the receiver timestamp signature value including the timestamp information and the receiver identification. It solves the problem of low security if it relies on password authentication technology in traditional two-way authentication, and complicated management and high cost if it relies on certificate authentication technology, it needs to rely on a third-party certificate certification center. Since the two parties do not need to obtain a digital certificate through a third-party certificate certification center, nor do they need to store the certificate information locally, the efficiency of the identity verification between the two parties in the communication entity is improved, and the management cost of the verification information during the verification process is reduced. In the two-way verification, the combination of identification number, time and random number improves the security of the identity verification of both parties in the communication entity.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本发明的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.

图1是本发明实施例一中的一种双向身份验证方法的流程图;1 is a flowchart of a two-way authentication method in Embodiment 1 of the present invention;

图2是本发明实施例二中的一种双向身份验证方法的流程图;2 is a flowchart of a two-way authentication method in Embodiment 2 of the present invention;

图3是本发明实施例三中的一种双向身份验证方法的流程图;3 is a flowchart of a two-way authentication method in Embodiment 3 of the present invention;

图4是本发明实施例四中的一种双向身份验证方法的流程图;4 is a flowchart of a two-way authentication method in Embodiment 4 of the present invention;

图5是本发明实施例四中的一种根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证的流程示意图;5 is a schematic flow chart of verifying the receiver timestamp and the decryption random number according to the sender timestamp and the sender random number in Embodiment 4 of the present invention;

图6是本发明实施例五中的一种双向身份验证装置的结构示意图;6 is a schematic structural diagram of a two-way authentication device in Embodiment 5 of the present invention;

图7是本发明实施例六中的一种双向身份验证装置的结构示意图;7 is a schematic structural diagram of a two-way authentication device in Embodiment 6 of the present invention;

图8是本发明实施例七中的一种双向身份验证设备的结构示意图;8 is a schematic structural diagram of a two-way authentication device in Embodiment 7 of the present invention;

图9是本发明实施例七中的一种双向身份验证拓扑示例图。FIG. 9 is a schematic diagram of a bidirectional authentication topology in Embodiment 7 of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施例方式作进一步地详细描述。应当明确,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings. It should be understood that the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with some aspects of the invention, as recited in the appended claims.

在本发明的描述中,需要理解的是,术语“第一”、“第二”、“第三”等仅用于区别类似的对象,而不必用于描述特定的顺序或先后次序,也不能理解为指示或暗示相对重要性。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。此外,在本发明的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present invention, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence, nor can understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations. Furthermore, in the description of the present invention, unless otherwise specified, "a plurality" means two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the related objects are an "or" relationship.

实施例一Example 1

图1为本发明实施例一提供的一种双向身份验证方法的流程图,本实施例可适用于接收方通信实体对发送方通信实体的身份验证,并将自身验证信息发送至发送方通信实体以供其验证的情况,该方法可以由双向身份验证装置来执行,该双向身份验证装置可以由软件和/或硬件来实现,该双向身份验证装置可以配置在双向身份验证设备上,该双向身份验证设备可以是计算机设备,计算机设备可以是两个或多个物理实体构成,也可以是一个物理实体构成。一般而言,计算机设备可以是笔记本、台式计算机以及智能平板等。FIG. 1 is a flowchart of a two-way authentication method provided in Embodiment 1 of the present invention. This embodiment can be applied to the identity verification of the receiver communication entity to the sender communication entity, and the self-verification information is sent to the sender communication entity. For its verification, the method can be performed by a two-way authentication device, which can be implemented by software and/or hardware, and the two-way authentication device can be configured on a two-way authentication device. The verification device may be a computer device, and the computer device may be composed of two or more physical entities, or may be composed of one physical entity. Generally speaking, the computer device can be a notebook, a desktop computer, a smart tablet, and the like.

如图1所示,本实施例一提供的一种双向身份验证方法,应用于接收方通信实体,具体包括如下步骤:As shown in FIG. 1 , a two-way authentication method provided in Embodiment 1 is applied to a recipient communication entity, and specifically includes the following steps:

S101、接收发送方标识、发送方随机数以及发送方签名值。S101. Receive an identifier of the sender, a random number of the sender, and a signature value of the sender.

在本实施例中,接收方通信实体具体可理解为两个需要进行安全通信的通信实体中,作为通信接收方的通信实体,可选的,通信实体可为移动通信设备、笔记本、台式计算机及智能平板等能够实现交互通信的计算机设备,本发明实施例对通信实体的具体类型不进行限制。发送方标识具体可理解为用以作为安全通信中通信发起方的通信实体对应的设备编码,需要明确的是,针对同一政府网络下的所有通信实体,每个通信实体均有其独有的设备编码,可通过设备编码明确通信实体位置及类型等信息。发送方随机数具体可理解为作为通信发起方的通信实体中生成的随机数值。发送方签名值具体可理解为将发送方随机数通过签名技术进行加密后所得到的参数值。In this embodiment, the communication entity of the receiver can be specifically understood as the communication entity of the communication receiver among the two communication entities that need to perform secure communication. Optionally, the communication entity may be a mobile communication device, a notebook, a desktop computer, and A computer device capable of realizing interactive communication, such as a smart tablet, does not limit the specific type of the communication entity in this embodiment of the present invention. The sender identifier can be understood as the device code corresponding to the communication entity used as the communication initiator in the secure communication. It needs to be clear that for all communication entities under the same government network, each communication entity has its own unique device. Coding, information such as the location and type of the communication entity can be clarified through the device coding. The sender random number can be specifically understood as a random value generated in the communication entity that is the communication initiator. The sender's signature value can be specifically understood as a parameter value obtained by encrypting the sender's random number through a signature technology.

具体的,当两个通信实体间需要进行安全通信时,作为通信接收方的接收方通信实体接收由发送方通信实体发送的发送方标识、发送方随机数以及发送方签名值。Specifically, when secure communication is required between two communication entities, the receiver communication entity serving as the communication receiver receives the sender identifier, sender random number and sender signature value sent by the sender communication entity.

S102、根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值。S102. Generate a sender identification public key according to the pre-acquired public parameters and the sender identification, and use the sender identification public key to verify the sender's random number and the sender's signature value.

在本实施例中,公共参数具体可理解为通信实体预先由密钥管理平台(KeyGeneration Center,KGC)中获取的,用以标识密码算法的参数值,需要明确的是,对于归属于同一KGC管理的多个通信实体,其由KGC中获取的公共参数为相同的。发送方标识公钥具体可理解为与发送方通信实体私钥相对应的非秘密一半,用以对经发送方私钥加密的信息进行对应解密的密钥。In this embodiment, the public parameter can be specifically understood as the parameter value obtained by the communication entity from the key management platform (KeyGeneration Center, KGC) in advance and used to identify the cryptographic algorithm. The common parameters obtained by the KGC are the same for multiple communication entities. The sender's identification public key can be specifically understood as the non-secret half corresponding to the sender's private key of the communication entity, and is used to decrypt the information encrypted by the sender's private key.

一般的,针对政务系统,归属于同一区域的通信实体由同一KGC进行管理,其所获取的公共参数均相同,该区域内的各通信实体间可直接由一次获取的公共参数进行双向身份验证,而对于区域外的其他通信实体,由于公共参数的不同,则无法进行双向身份验证,除非在验证前将对应公共参数进行交换。示例性的,假设深圳市与珠海市中的各通信实体分别由两个KGC进行管理,则深圳市内的各通信实体间可基于对应的KGC公共参数进行双向身份验证,而一个深圳市与一个珠海市的通信实体间难以直接基于各自获取的公共参数进行双向身份验证。Generally, for the government affairs system, the communication entities belonging to the same area are managed by the same KGC, and the acquired public parameters are the same. For other communication entities outside the area, due to the difference in public parameters, two-way authentication cannot be performed unless the corresponding public parameters are exchanged before authentication. Exemplarily, assuming that each communication entity in Shenzhen and Zhuhai is managed by two KGCs, then each communication entity in Shenzhen can perform two-way authentication based on the corresponding KGC public parameters, and one Shenzhen and one It is difficult for communication entities in Zhuhai to perform two-way authentication directly based on the public parameters obtained by each other.

具体的,依据符合国家密码规范的标识密钥算法,结合预先由密钥管理平台获取的公共参数以及接收到的发送方标识,生成与发送方通信实体对应发送方私钥对应的发送方标识公钥,进而利用发送方标识公钥对接收到的发送方签名值进行解密,并将解密后的发送方签名值与发送方随机数进行比对验证,得到对应的验证结果。示例性的,本发明实施例中的标识密钥算法可为符合国家标准《GM/T 0044-2016SM9标识密码算法》的SM9标识密钥算法,本发明实施例对通信实体具体采用的标识密钥方法不进行限制。Specifically, according to the identification key algorithm that conforms to the national cryptography standard, combined with the public parameters obtained in advance by the key management platform and the received sender identification, the sender identification public key corresponding to the sender private key corresponding to the sender communication entity is generated. Then use the sender's identification public key to decrypt the received sender's signature value, and compare and verify the decrypted sender's signature value with the sender's random number to obtain the corresponding verification result. Exemplarily, the identification key algorithm in the embodiment of the present invention may be the SM9 identification key algorithm that conforms to the national standard "GM/T 0044-2016SM9 Identification Cryptographic Algorithm", and the identification key specifically adopted by the communication entity in the embodiment of the present invention is The method is not limited.

在本发明实施例中,由于作为密钥的为通信实体的设备编码,无需由第三方证书认证中心申请可信电子认证证书(Certification Authority,CA),避免了CA证书在存储消耗与性能方面不便于管理,且针对海量通信实体进行身份鉴别时效率较低的问题,同时避免了现有技术中通信实体双方不通过可信第三方证书认证中心生成可信CA证书,而是通过自生成方式,生成非可信证书进行验证时安全性低的问题。提升了密钥管理的效率,降低了通信双方身份验证的复杂性,节省了网络资源的占用,同时避免了与第三方的多次交互,提升了安全性。In the embodiment of the present invention, because the device code of the communication entity is used as the key, there is no need to apply for a trusted electronic certification certificate (Certification Authority, CA) from a third-party certificate certification center, which avoids the storage consumption and performance of the CA certificate. It is easy to manage, and the problem of low efficiency in the identification of a large number of communication entities is avoided, and at the same time, it avoids the fact that in the prior art, both parties of the communication entities do not generate a trusted CA certificate through a trusted third-party certificate certification center, but use a self-generated method. Low security when generating untrusted certificates for verification. It improves the efficiency of key management, reduces the complexity of authentication of both parties in communication, saves the occupation of network resources, avoids multiple interactions with third parties, and improves security.

S103、若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。S103. If the verification result is successful, generate the receiver's timestamp signature value according to the receiver's private key obtained in advance, and send the receiver's timestamp signature value and the receiver's identity corresponding to the receiver's communication entity to the sender's communication entity .

在本实施例中,接收方私钥具体可理解为接收方通信实体中与公钥算法一起使用的密钥对的秘密一半,可用以对接收方通信实体中的参数进行加密,加密后的参数仅能通过该接收方私钥或与其对应的公钥进行解密。接收方时戳签名值具体可理解为通过接收方私钥对同时包含有时戳信息与随机数信息的字符串以签名技术加密后所得到的参数值。接收方标识具体可理解为用以作为安全通信中通信接收方的通信实体对应的设备编码。In this embodiment, the private key of the receiver can be specifically understood as the secret half of the key pair used with the public key algorithm in the communication entity of the receiver, which can be used to encrypt the parameters in the communication entity of the receiver, and the encrypted parameters Decryption can only be done through the recipient's private key or its corresponding public key. The receiver's timestamp signature value can be specifically understood as a parameter value obtained by encrypting a string containing both timestamp information and random number information with a signature technique using the receiver's private key. The receiver identifier can be specifically understood as the device code corresponding to the communication entity used as the communication receiver in the secure communication.

具体的,若验证成功,则可确定发送方通信实体为与接收方通信实体位于同一区域内可进行安全通信的通信实体,此时接收方通信实体需获取一个与当前时间对应的时间戳,并将该时间戳与获取到的发送方随机数进行组合,进而由预先获取的接收方私钥对该组合进行签名加密,得到对应的接收方时戳签名值,并将所得的接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体,以使发送方通信实体可根据接收方时戳签名值与接收方标识对接收方通信实体的身份进行验证。Specifically, if the verification is successful, it can be determined that the communication entity of the sender is a communication entity that is located in the same area as the communication entity of the receiver and can perform secure communication. At this time, the communication entity of the receiver needs to obtain a timestamp corresponding to the current time, and Combine the timestamp with the obtained random number of the sender, and then sign and encrypt the combination with the receiver's private key obtained in advance to obtain the corresponding signature value of the receiver's timestamp, and sign the obtained receiver's timestamp. The value and the receiver identification corresponding to the receiver communication entity are sent to the sender communication entity, so that the sender communication entity can verify the identity of the receiver communication entity according to the receiver timestamp signature value and the receiver identification.

本发明实施例通过接收发送方标识、发送方随机数以及发送方签名值;根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。通过采用上述技术方案,在需要进行安全通信时,接收方通信实体通过接收到的发送方通信实体的发送方随机数、发送方签名值以及发送方标识验证该发送方通信实体为其需要进行通信连接的通信实体,进而依据预先获取的接收方私钥以及接收方通信实体向发送方通信实体进行信息发送的时间生成接收方时戳签名值,并将该接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体,以使发送方通信实体可根据包含有时戳信息的接收方时戳签名值与接收方标识对接收方通信实体进行身份验证。解决了传统双向身份验证时若依赖于口令认证技术,则安全性低,若依赖于证书认证技术,则需依赖第三方证书认证中心,管理繁杂且成本高的问题。由于双方进行身份验证时无需通过第三方证书认证中心获取数字证书,也无需在本地进行证书信息存储,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,同时在进行双向验证时,采用标识号、时间与随机数相结合的方式提升了通信实体双方身份验证的安全性。In the embodiment of the present invention, the sender's identifier, the sender's random number, and the sender's signature value are received; the sender's identifier public key is generated according to the pre-obtained public parameters and the sender's identifier, and the sender's identifier public key is used to verify the sender's random number and the sender's identifier. If the verification result is successful, the receiver's timestamp signature value is generated according to the receiver's private key obtained in advance, and the receiver's timestamp signature value and the receiver's identity corresponding to the receiver's communication entity are sent to the sender. communication entity. By adopting the above technical solution, when secure communication is required, the receiver communication entity verifies that the sender communication entity needs to communicate through the received sender random number, sender signature value and sender identity of the sender communication entity. The connected communication entity, and then generates the receiver timestamp signature value according to the pre-acquired receiver private key and the time when the receiver communication entity sends information to the sender communication entity, and combines the receiver timestamp signature value with the receiver. The receiver identification corresponding to the communication entity is sent to the sender communication entity, so that the sender communication entity can authenticate the receiver communication entity according to the receiver timestamp signature value including the timestamp information and the receiver identification. It solves the problem of low security if it relies on password authentication technology in traditional two-way authentication, and complicated management and high cost if it relies on certificate authentication technology, it needs to rely on a third-party certificate certification center. Since the two parties do not need to obtain a digital certificate through a third-party certificate certification center, nor do they need to store the certificate information locally, the efficiency of the identity verification between the two parties in the communication entity is improved, and the management cost of the verification information during the verification process is reduced. In the two-way verification, the combination of identification number, time and random number improves the security of the identity verification of both parties in the communication entity.

实施例二Embodiment 2

图2为本发明实施例二提供的一种双向身份验证方法的流程图,本发明实施例的技术方案在上述各可选技术方案的基础上进一步优化,通过生成的发送方标识公钥对发送方签名值进行解密,并将解密后的签名值与发送方随机数是否相同进行验证,验证成功则由公共时钟获取接收方时间戳,并将接收方时间戳与发送方随机数进行组合后由接收方私钥进行加密,进而生成用于发送至发送方通信实体的接收方时戳签名值,将时间信息加入用于进行身份验证的加密信息中,提升了双向身份验证的准确性,而仅由需进行通信的双方进行身份验证,减少了验证过程中的数据传输量,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,保障了身份验证的安全性。FIG. 2 is a flowchart of a two-way authentication method according to Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. Decrypt the signature value of the receiver, and verify whether the decrypted signature value is the same as the random number of the sender. If the verification is successful, the public clock will obtain the timestamp of the receiver, and combine the timestamp of the receiver with the random number of the sender. The receiver's private key is encrypted, and then the receiver's timestamp signature value is generated for sending to the sender's communication entity, and the time information is added to the encrypted information for authentication, which improves the accuracy of two-way authentication. The identity verification is performed by the two parties that need to communicate, which reduces the amount of data transmission during the verification process, improves the efficiency of the identity verification of both parties in the communication entity, reduces the management cost of the verification information during the verification process, and ensures the security of the identity verification.

如图2所示,本发明实施例二提供的一种双向身份验证方法,具体包括如下步骤:As shown in FIG. 2, a two-way authentication method provided by Embodiment 2 of the present invention specifically includes the following steps:

S201、根据接收方通信实体对应的接收方标识,由密钥管理平台获取接收方通信实体对应的接收方私钥与公共参数。S201. According to the receiver identifier corresponding to the receiver communication entity, the key management platform obtains the receiver private key and public parameters corresponding to the receiver communication entity.

在本实施例中,密钥管理平台具体可理解为用以对其所在区域内各通信实体的密钥进行管理,经由其管理的各通信实体应在其中进行备份,在通信实体有密钥需求时可由其中获取对应产生的私钥及公共参数的管理密钥基础设施。In this embodiment, the key management platform can be specifically understood to be used to manage the keys of each communication entity in the area where it is located, and each communication entity managed by it should be backed up in it, and the communication entity has a key requirement At the same time, the management key infrastructure from which the corresponding generated private key and public parameters can be obtained.

具体的,在接收方通信实体需要获取其自身对应的接收方私钥以及公共参数时,其将自身对应的接收方标识发送至密钥管理平台中,密钥管理平台通过检测接收方标识是否存在于平台中,若存在,则依据接收方标识生成对应的接收方私钥,并将该接收方私钥以及与该密钥管理平台对应的公共参数下发至对应的接收方通信实体中。Specifically, when the recipient communication entity needs to obtain its own corresponding recipient private key and public parameters, it sends its corresponding recipient identifier to the key management platform, and the key management platform detects whether the recipient identifier exists or not. In the platform, if it exists, the corresponding private key of the recipient is generated according to the identifier of the recipient, and the private key of the recipient and the public parameters corresponding to the key management platform are delivered to the corresponding recipient communication entity.

S202、接收发送方标识、发送方随机数以及发送方签名值。S202. Receive the sender's identifier, the sender's random number, and the sender's signature value.

S203、根据公共参数与发送方标识生成发送方标识公钥,通过发送方标识公钥对发送方签名值进行解密,确定解密数值。S203. Generate the sender's identification public key according to the public parameters and the sender's identification, and decrypt the sender's signature value by using the sender's identification public key to determine the decrypted value.

具体的,接收方通信实体向密钥管理平台发送包含发送方标识的标识公钥申请信息,使得密钥管理平台可依据符合国家密码规范的标识密钥算法,结合公共参数与发送方标识生成发送方标识公钥并将其反馈至接收方通信实体,接收方通信实体通过该发送方标识公钥对经由发送方私钥加密的发送方签名值进行解密,将解密后所得到的值确定为解密数值。Specifically, the recipient communication entity sends the identification public key application information including the sender's identification to the key management platform, so that the key management platform can generate and send the information according to the identification key algorithm that conforms to the national cryptographic standard, combined with the public parameters and the sender's identification. The public key of the sender's identification is fed back to the receiver's communication entity, and the receiver's communication entity decrypts the sender's signature value encrypted by the sender's private key through the sender's identification public key, and determines the value obtained after decryption as the decrypted value. numerical value.

S204、判断解密数值与发送方随机数是否相同,若是,则执行步骤S205;若否,则执行步骤S206。S204: Determine whether the decrypted value is the same as the random number of the sender, if yes, go to step S205; if not, go to step S206.

具体的,通过字符比对确定解密数值与发送方随机数是否相同,若相同,则可认为发送方通信实体的确为与接收方通信实体位于同一区域内,归属于同一密钥管理平台管理的通信实体,二者间可建立安全通信关系,且发送方通信实体身份验证通过,此时执行步骤S205;若不同,则可认为发送方通信实体可能与接收方通信实体并未位于同一区域内,二者无法建立安全通信关系,且发送方通信实体身份验证失败,此时执行步骤S206。Specifically, it is determined by character comparison whether the decrypted value is the same as the random number of the sender. If they are the same, it can be considered that the communication entity of the sender is indeed located in the same area as the communication entity of the receiver and belongs to the communication managed by the same key management platform. entity, a secure communication relationship can be established between the two, and the identity verification of the communication entity of the sender is passed, then step S205 is executed; if they are different, it can be considered that the communication entity of the sender and the communication entity of the receiver may not be located in the same area. If the sender fails to establish a secure communication relationship, and the identity verification of the sender communication entity fails, step S206 is performed at this time.

S205、将验证结果确定为成功,并执行步骤S208。S205. Determine the verification result as successful, and execute step S208.

S206、将验证结果确定为失败,并执行步骤S207。S206. Determine the verification result as failure, and execute step S207.

S207、取消接收方通信实体与发送方通信实体的通信。S207, cancel the communication between the receiver communication entity and the sender communication entity.

具体的,由于接收方通信实体确认发送方通信实体并非可以建立安全通信的通信实体,故可直接由接收方通信实体取消二者间的通信。Specifically, since the receiver communication entity confirms that the sender communication entity is not a communication entity capable of establishing secure communication, the receiver communication entity can directly cancel the communication between the two.

进一步地,可在取消两通信实体间的通信后,由接收方通信实体发出告警,以使技术人员可进行异常排除,减少中间人攻击风险,同时避免必要的异区域通信实体通信请求被忽略。Further, after canceling the communication between the two communication entities, the receiving communication entity can issue an alarm, so that the technician can eliminate the abnormality, reduce the risk of man-in-the-middle attack, and avoid the necessary communication request of the communication entity in different areas from being ignored.

S208、由公共时钟获取接收方时间戳。S208. Obtain the recipient's timestamp from the public clock.

在本实施例中,公共时钟具体可理解可作为同一区域内各需要使用时钟的通信实体的共有时钟,其可作为标准对各通信实体间的相对时间进行统一。In this embodiment, the common clock can be understood as a common clock of each communication entity that needs to use a clock in the same area, and it can be used as a standard to unify the relative time among the communication entities.

具体的,在确定验证结果为成功后,可认为接收方通信实体已完成对将与其进行通信的发送方通信实体的身份验证,而需生成对应身份验证信息以供发送方通信实体对其身份进行验证。由于二者验证时间理论应相差较小,故可由公共时钟中获取当前时刻的时间,并利用其构建接收方时间戳,以将时间因素考虑至身份验证中,提升身份验证的精确度。Specifically, after it is determined that the verification result is successful, it can be considered that the receiver communication entity has completed the identity verification of the sender communication entity that will communicate with it, and corresponding identity verification information needs to be generated for the sender communication entity to verify its identity. verify. Since the theoretical difference between the verification time of the two should be small, the time of the current moment can be obtained from the public clock and used to construct the recipient timestamp, so as to take the time factor into account in the authentication and improve the accuracy of the authentication.

S209、将接收方时间戳与发送方随机数进行字段组合,生成时戳随机数。S209 , combine the receiver's timestamp with the sender's random number to generate a timestamp random number.

具体的,将接收方时间戳对应字段与发送方随机数对应字段进行组合,示例性的,可将发送方随机数对应字段添加至接收方时间戳对应字段之后,将组合后的字段确定为时戳随机数。Specifically, the field corresponding to the timestamp of the receiver is combined with the field corresponding to the random number of the sender. Exemplarily, the field corresponding to the random number of the sender may be added to the field corresponding to the timestamp of the receiver, and the combined field is determined as time Stamp random numbers.

S210、通过接收方私钥对时戳随机数签名加密,生成接收方时戳签名值。S210 , using the recipient's private key to sign and encrypt the timestamp random number to generate the recipient's timestamp signature value.

具体的,经由接收方私钥配合使用签名技术对时戳随机数进行整体签名加密,将加密后的时戳随机数确定为接收方时戳签名值。Specifically, an overall signature encryption is performed on the timestamp random number through the receiver's private key and a signature technology, and the encrypted timestamp random number is determined as the receiver's timestamp signature value.

S211、将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。S211. Send the receiver's timestamp signature value and the receiver's identifier corresponding to the receiver's communication entity to the sender's communication entity.

本实施例的技术方案,通过发送方标识与公共参数生成的发送方标识公钥完成对发送方签名值的解密,并将其与发送方随机数进行比对验证以明确发送方身份,无需与第三方的参与,降低了验证时的数据传输量,提升了通信实体双方身份验证的效率,在验证成功后由公共时钟获取接收方时间戳,并将接收方时间戳与发送方随机数进行组合后由接收方私钥进行加密,进而生成用于发送至发送方通信实体的接收方时戳签名值,将时间信息加入用于进行身份验证的加密信息中,使得发送方通信实体可同时根据时间与接收方标识对接收方通信实体进行身份验证,提升了双向身份验证的准确性,进一步保障了身份验证的安全性,同时降低了验证过程中对验证信息的管理成本。In the technical solution of this embodiment, the sender's signature value is decrypted by using the sender's ID and the sender's ID public key generated from public parameters, and is compared with the sender's random number for verification to clarify the sender's identity. The participation of a third party reduces the amount of data transmission during verification, and improves the efficiency of identity verification between the communicating entities. After the verification is successful, the public clock obtains the recipient's timestamp, and combines the recipient's timestamp with the sender's random number. It is then encrypted by the receiver's private key, and then generates the receiver's timestamp signature value for sending to the sender's communication entity, and adds the time information to the encrypted information for authentication, so that the sender's communication entity can simultaneously The identity verification of the receiver's communication entity with the receiver's identity improves the accuracy of the two-way authentication, further guarantees the security of the identity verification, and reduces the management cost of the verification information during the verification process.

实施例三Embodiment 3

图3为本发明实施例三提供的一种双向身份验证方法的流程图,本发明实施例的技术方案在上述各可选技术方案的基础上进一步优化,本实施例可适用于发送方通信实体对接收方通信实体的身份验证的情况,该方法可以由双向身份验证装置来执行,该双向身份验证装置可以由软件和/或硬件来实现,该双向身份验证装置可以配置在双向身份验证设备上,该双向身份验证设备可以是计算机设备,计算机设备可以是两个或多个物理实体构成,也可以是一个物理实体构成。一般而言,计算机设备可以是笔记本、台式计算机以及智能平板等。FIG. 3 is a flowchart of a two-way authentication method according to Embodiment 3 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions, and this embodiment is applicable to the communication entity of the sender In the case of the identity verification of the recipient communication entity, the method can be performed by a two-way identity verification device, which can be implemented by software and/or hardware, and the two-way identity verification device can be configured on the two-way identity verification device. , the two-way authentication device may be a computer device, and the computer device may be composed of two or more physical entities, or may be composed of one physical entity. Generally speaking, the computer device can be a notebook, a desktop computer, a smart tablet, and the like.

如图3所示,本实施例三提供的一种双向身份验证方法,应用于发送方通信实体,具体包括如下步骤:As shown in FIG. 3 , a two-way authentication method provided by the third embodiment is applied to the sender communication entity, and specifically includes the following steps:

S301、在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值。S301. When secure communication is required, generate a random number of the sender, and encrypt and encrypt the random number of the sender through the pre-acquired private key of the sender to generate a signature value of the sender.

在本实施例中,发送方通信实体具体可理解为两个需要进行安全通信的通信实体中,作为通信发起方的通信实体。发送方随机数具体可理解为由发送方通信实体随机生成的,用以辅助加密进行身份验证的随机数值。发送方私钥具体可理解为发送方通信实体中与公钥算法一起使用的密钥对的秘密一半,可用以对发送方通信实体中需要发送的参数进行加密,加密后的参数仅能通过该发送方私钥或与其对应的公钥进行解密。In this embodiment, the sender communication entity can be specifically understood as the communication entity that is the communication initiator among the two communication entities that need to perform secure communication. The sender's random number can be specifically understood as a random value randomly generated by the sender's communication entity and used to assist encryption for authentication. The sender's private key can be understood as the secret half of the key pair used with the public key algorithm in the sender's communication entity. It can be used to encrypt the parameters that need to be sent in the sender's communication entity. The encrypted parameters can only be passed through this The sender's private key or its corresponding public key is decrypted.

具体的,在需要进行安全通信时,发送方通信实体首先明确需要进行通信的接收方通信实体,并由其自身生成发送方随机数,通过预先由密钥管理平台中获取的发送方私钥对发送方随机数进行签名加密,将加密后的发送方随机数确定为发送方签名值。Specifically, when secure communication is required, the sender communication entity first identifies the receiver communication entity that needs to communicate, and generates the sender random number by itself, and uses the sender's private key pair obtained from the key management platform in advance. The sender's random number is signed and encrypted, and the encrypted sender's random number is determined as the sender's signature value.

S302、将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体。S302. Send the sender's random number, the sender's signature value, and the sender's identifier corresponding to the sender's communication entity to the receiver's communication entity.

具体的,由于接收方通信实体中并不存在预先获取的发送方随机数,仅通过发送方签名值与发送方标识无法实现对发送方通信实体的身份验证,因此发送方通信实体需将发送方随机数,与发送方签名值以及与发送方通信实体对应的发送方标识一并发送至接收方通信实体,以供其进行身份验证。Specifically, since there is no pre-acquired sender random number in the receiver communication entity, the identity verification of the sender communication entity cannot be realized only by the sender signature value and the sender identification. Therefore, the sender communication entity needs to The random number, together with the sender's signature value and the sender's identity corresponding to the sender's communication entity, is sent to the receiver's communication entity for authentication.

S303、根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证。S303. Generate a public key of the receiver's identification according to the received receiver's identification and pre-acquired public parameters, and verify the received receiver's timestamp signature value by using the receiver's identification public key and the sender's random number.

在本实施例中,接收方标识公钥具体可理解为与接收方通信实体私钥相对应的非秘密一半,用以对经接收方私钥加密的信息进行对应解密的密钥。In this embodiment, the receiver's identification public key can be specifically understood as the non-secret half corresponding to the receiver's private key of the communication entity, which is used to decrypt the information encrypted by the receiver's private key.

具体的,依据符合国家密码规范的标识密钥算法,结合预先由密钥管理平台获取的公共参数以及接收到的接收方标识,生成与接收方通信实体对应接收方私钥对应的接收方标识公钥,进而利用接收方标识公钥对接收到的接收方时戳签名值进行解密,并将解密后的接收方时戳签名值与发送方随机数,以及发送方通信实体在接收到接收方时戳签名值时对应的时间进行比对验证,得到对应的验证结果。Specifically, according to the identification key algorithm that conforms to the national cryptographic standard, combined with the public parameters obtained in advance by the key management platform and the received identification of the receiver, a public identification of the receiver corresponding to the private key of the receiver corresponding to the communication entity of the receiver is generated. key, and then use the receiver's identification public key to decrypt the received receiver's timestamp signature value, and combine the decrypted receiver's timestamp signature value with the sender's random number, and the sender's communication entity when it receives the receiver. The corresponding time when stamping the signature value is compared and verified, and the corresponding verification result is obtained.

S304、根据验证结果建立发送方通信实体与接收方通信实体间的通信。S304. Establish communication between the communication entity of the sender and the communication entity of the receiver according to the verification result.

具体的,由于在发送方通信实体可以接收到由接收方通信实体发送的接收方标识与接收方时戳签名值时,即可认为接收方通信实体已完成对发送方通信实体的身份验证,故当发送方通信实体确定验证结果为成功后,即可确定双方为可以进行安全通信的两个通信实体,此时可由发送方通信实体建立发送方通信实体与接收方通信实体间的通信,否则,可认为二者间无法进行安全通信,取消发送方通信实体与接收方通信实体间通信的建立。Specifically, when the sender communication entity can receive the receiver identifier and the receiver timestamp signature value sent by the receiver communication entity, it can be considered that the receiver communication entity has completed the identity verification of the sender communication entity. When the sender communication entity determines that the verification result is successful, it can be determined that the two parties are two communication entities that can communicate securely. At this time, the sender communication entity can establish the communication between the sender communication entity and the receiver communication entity. Otherwise, It can be considered that secure communication cannot be performed between the two, and the establishment of the communication between the communication entity of the sender and the communication entity of the receiver is cancelled.

本发明实施例通过在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值;将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体;根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证;根据验证结果建立发送方通信实体与接收方通信实体间的通信。通过采用上述技术方案,在需要进行安全通信时,首先将自身生成的发送方随机数经由预先获取的发送方私钥进行加密,进而将发送方随机数、加密后得到的发送方签名值以及与发送方通信实体对应的发送方标识发送至对应需要进行通信的接收方通信实体中,以使对应的接收方通信实体可直接根据接收内容完成对本发送方通信实体的身份验证,进而在验证通过后才可接收到由接收方通信实体发送的接收方标识以及接收方时戳签名值,通过接收方标识与预先获取的公共参数生成与接收方私钥对应的接收方标识公钥,对接收方时戳签名值进行解密,以同时依据时间信息以及解密所得的随机数信息对接收方通信实体的身份进行验证,进而依据验证结果在二者间建立安全通信。解决了传统双向身份验证时若依赖于口令认证技术,则安全性低,若依赖于证书认证技术,则需依赖第三方证书认证中心,管理繁杂且成本高的问题。由于双方进行身份验证时无需通过第三方证书认证中心获取数字证书,也无需在本地进行证书信息存储,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,同时在进行双向验证时,采用标识号、时间与随机数相结合的方式提升了通信实体双方身份验证的安全性。In the embodiment of the present invention, when secure communication is required, a random number of the sender is generated, and the random number of the sender is signed and encrypted by the private key of the sender obtained in advance to generate the signature value of the sender; the random number of the sender, the signature value of the sender are encrypted and the sender identification corresponding to the sender communication entity is sent to the receiver communication entity; the receiver identification public key is generated according to the received receiver identification and the pre-acquired public parameters, and the receiver identification public key and the sender random number are used. Verifying the received receiver timestamp signature value; establishing communication between the sender communication entity and the receiver communication entity according to the verification result. By adopting the above technical solution, when secure communication is required, the sender's random number generated by itself is firstly encrypted with the sender's private key obtained in advance, and then the sender's random number, the sender's signature value obtained after encryption, and the sender's random number are encrypted. The sender identification corresponding to the sender communication entity is sent to the corresponding receiver communication entity that needs to communicate, so that the corresponding receiver communication entity can directly complete the identity verification of the sender communication entity according to the received content, and then after the verification is passed Only then can the receiver ID and receiver timestamp signature value sent by the receiver communication entity be received, and the receiver ID public key corresponding to the receiver's private key is generated by the receiver ID and pre-acquired public parameters. The stamp signature value is decrypted to verify the identity of the recipient communication entity according to the time information and the decrypted random number information, and then establish a secure communication between the two according to the verification result. It solves the problem of low security if it relies on password authentication technology in traditional two-way authentication, and complicated management and high cost if it relies on certificate authentication technology, it needs to rely on a third-party certificate certification center. Since the two parties do not need to obtain a digital certificate through a third-party certificate certification center, nor do they need to store the certificate information locally, the efficiency of the identity verification between the two parties in the communication entity is improved, and the management cost of the verification information during the verification process is reduced. In the two-way verification, the combination of identification number, time and random number improves the security of the identity verification of both parties in the communication entity.

实施例四Embodiment 4

图4为本发明实施例四提供的一种双向身份验证方法的流程图,本发明实施例的技术方案在上述各可选技术方案的基础上进一步优化,通过生成的接收方标识公钥对接收方时戳签名值进行解密,并根据解密后的接收方时戳签名值确定接收方时间戳与解密随机数值,根据进行解密时由公共时钟获取的发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证,根据验证结果建立发送方通信实体与接收方通信实体间的通信,将时间信息应用于进行身份验证的加密信息中,提升了双向身份验证的准确性,且在进行身份验证过程中仅需通信双方参与,减少了验证过程中的数据传输量,提升了通信实体双方身份验证的效率,降低了验证过程中对验证信息的管理成本。FIG. 4 is a flowchart of a two-way authentication method provided in Embodiment 4 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. The receiver timestamp signature value is decrypted, and the receiver timestamp and decryption random value are determined according to the decrypted receiver timestamp signature value. The timestamp and decryption random value are verified, and the communication between the sender's communication entity and the receiver's communication entity is established according to the verification result, and the time information is applied to the encrypted information for authentication, which improves the accuracy of the two-way authentication. In the process of identity verification, only the two parties of the communication need to participate, which reduces the amount of data transmission in the process of verification, improves the efficiency of identity verification between the two parties of the communication entity, and reduces the management cost of verification information in the process of verification.

如图4所示,本发明实施例四提供的一种双向身份验证方法,具体包括如下步骤:As shown in FIG. 4 , a two-way authentication method provided by Embodiment 4 of the present invention specifically includes the following steps:

S401、根据发送方通信实体对应的发送方标识,由密钥管理平台获取发送方通信实体对应的发送方私钥与公共参数。S401. According to the sender identifier corresponding to the sender's communication entity, the key management platform obtains the sender's private key and public parameters corresponding to the sender's communication entity.

具体的,在发送方通信实体需要获取其自身对应的发送方私钥以及公共参数时,其将自身对应的发送方标识发送至密钥管理平台中,密钥管理平台通过检测发送方标识是否存在于平台中,若存在,则依据发送方标识生成对应的发送方私钥,并将该发送方私钥以及该密钥管理平台对应的公共参数下发至对应的发方通信实体中。Specifically, when the sender communication entity needs to obtain its own corresponding sender private key and public parameters, it sends its corresponding sender identifier to the key management platform, and the key management platform detects whether the sender identifier exists or not. In the platform, if it exists, the corresponding sender's private key is generated according to the sender's identity, and the sender's private key and the public parameters corresponding to the key management platform are delivered to the corresponding sender's communication entity.

S402、在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值。S402. When secure communication is required, generate a random number of the sender, and encrypt and encrypt the random number of the sender through the pre-obtained private key of the sender to generate a signature value of the sender.

S403、将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体。S403. Send the sender's random number, the sender's signature value, and the sender's identifier corresponding to the sender's communication entity to the receiver's communication entity.

S404、根据接收到的接收方标识与公共参数生成接收方标识公钥。S404. Generate a public key of the receiver identification according to the received identification of the receiver and the public parameters.

具体的发送方通信实体向密钥管理平台发送包含接收方标识的标识公钥申请信息,使得密钥管理平台可依据符合国家密码规范的标识密钥算法,结合公共参数与接收方标识生成接收方标识公钥并将其反馈至发送方通信实体。The specific sender communication entity sends the identification public key application information including the receiver's identification to the key management platform, so that the key management platform can generate the receiver according to the identification key algorithm that conforms to the national cryptographic standard, combining the public parameters and the receiver's identification. The public key is identified and fed back to the sender communicating entity.

S405、通过接收方标识公钥对接收方时戳签名值进行解密,确定接收方时间戳与解密随机数值。S405: Decrypt the signature value of the receiver's timestamp by using the receiver's identification public key to determine the receiver's timestamp and the decrypted random value.

具体的,发送方通信实体通过接收方标识公钥对经由接收方私钥加密的接收方时戳签名值进行解密,将解密后所得到的值进行字段拆分,确定接收方时间戳与解密随机数值。Specifically, the communication entity of the sender decrypts the signature value of the receiver's timestamp encrypted by the receiver's private key through the receiver's identification public key, and splits the value obtained after decryption into fields to determine the receiver's timestamp and the decryption random number. numerical value.

S406、由公共时钟获取发送方时间戳。S406. Obtain the sender's timestamp from the public clock.

具体的,由于发送方通信实体与接收方通信实体间进行身份验证的理论时间差应较小,故在完成对接收到的接收方时戳签名值解密后,可由公共时钟中获取当前时刻的时间,并利用其构建发送方时间戳,以表征发送方通信实体进行身份验证的时间。Specifically, since the theoretical time difference between the sender's communication entity and the receiver's communication entity for authentication should be small, after decrypting the received signature value of the receiver's timestamp, the current time can be obtained from the public clock. And use it to construct a sender timestamp to characterize the time when the sender communicating entity was authenticated.

S407、根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证。S407. Verify the recipient's timestamp and the decrypted random value according to the sender's timestamp and the sender's random number.

具体的,依据发送方时间戳与接收方时间戳确定本次身份验证是否为同一次安全通信建立时的身份验证,并通过发送方随机数与解密随机数值确定接收方通信实体的身份,将二者进行结合确定验证结果。Specifically, according to the sender's timestamp and the receiver's timestamp, it is determined whether the current identity verification is the identity verification when the same secure communication was established, and the identity of the receiver's communication entity is determined through the sender's random number and the decrypted random value. Those who combine to determine the verification results.

进一步地,图5为本发明实施例四提供的一种根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证的流程示意图,如图5所示,具体包括如下步骤:Further, FIG. 5 is a schematic flowchart of verifying the recipient’s timestamp and the decryption random value according to the sender’s timestamp and the sender’s random number according to Embodiment 4 of the present invention, as shown in FIG. 5 , which specifically includes the following steps: :

S4071、确定发送方时间戳与接收方时间戳间的时间差值。S4071. Determine the time difference between the sender's timestamp and the receiver's timestamp.

具体的,将发送方时间戳对应的时间值,与接收方时间戳对应的时间差求差,将该差值的绝对值确定为时间差值。Specifically, the time value corresponding to the time stamp of the sender and the time difference corresponding to the time stamp of the receiver are calculated, and the absolute value of the difference is determined as the time difference value.

S4072、判断是否时间差值小于预设时间阈值,且解密随机数值与发送方随机数相同,若是,则执行步骤S4073;若否,则执行步骤S4074。S4072: Determine whether the time difference value is smaller than the preset time threshold, and the decryption random value is the same as the sender's random number, if so, go to step S4073; if not, go to step S4074.

具体的,若时间差值小于预设时间阈值,则可认为本次身份验证为同一次安全通信建立时的身份验证,与此同时若解密随机数值与发送方随机数相同,则可认为接收方通信实体为本次安全通信需要进行通信的对象,此时执行步骤S4073;否则,可认为本次身份验证不是同一次安全通信建立时的身份验证,或接收方通信实体不是本次安全通信需要进行通信的对象,此时执行步骤S4074。Specifically, if the time difference is less than the preset time threshold, it can be considered that the current identity verification is the identity verification when the same secure communication was established. At the same time, if the decryption random number is the same as the sender random number, it can be considered that the receiver The communication entity is the object to be communicated in this secure communication, and step S4073 is executed at this time; otherwise, it can be considered that this authentication is not the authentication when the same secure communication is established, or the communication entity of the recipient is not required to perform this secure communication. The communication object, at this time, step S4074 is executed.

可选的,预设时间阈值可为5分钟,也可根据实际需求进行适应性设置,本发明实施例对此不进行限制。Optionally, the preset time threshold may be 5 minutes, and may also be adaptively set according to actual needs, which is not limited in this embodiment of the present invention.

S4073、确定验证结果为成功。S4073, determine that the verification result is successful.

S4074、确定验证结果为失败。S4074. Determine that the verification result is failure.

S408、判断验证结果是否为成功,若是,则执行步骤S409;若否,则执行步骤S410。S408, determine whether the verification result is successful, if yes, go to step S409; if not, go to step S410.

具体的,若验证结果为成功,则可认为发送方通信实体的确为与接收方通信实体位于同一区域内,归属于同一密钥管理平台管理的通信实体,二者间可建立安全通信关系,且发送方通信实体身份验证通过,此时执行步骤S409;若验证结果为失败,则可认为发送方通信实体可能与接收方通信实体并未位于同一区域内,二者无法建立安全通信关系,且发送方通信实体身份验证失败,此时执行步骤S410。Specifically, if the verification result is successful, it can be considered that the communication entity of the sender and the communication entity of the receiver are indeed located in the same area and belong to the communication entities managed by the same key management platform, and a secure communication relationship can be established between them, and If the identity verification of the communication entity of the sender is passed, step S409 is executed at this time; if the verification result is failed, it can be considered that the communication entity of the sender and the communication entity of the receiver may not be located in the same area, and the two cannot establish a secure communication relationship, and send If the authentication of the party communication entity fails, step S410 is executed at this time.

S409、建立发送方通信实体与接收方通信实体的通信。S409: Establish communication between the sender communication entity and the receiver communication entity.

S410、取消接收方通信实体与发送方通信实体的通信。S410, cancel the communication between the receiver communication entity and the sender communication entity.

具体的,由于发送方通信实体确认接收方通信实体并非可以建立安全通信的通信实体,故可直接由发送方通信实体取消二者间的通信。Specifically, since the communication entity of the sender side confirms that the communication entity of the receiver side is not a communication entity that can establish secure communication, the communication entity of the sender side can directly cancel the communication between the two.

进一步地,可在取消两通信实体间的通信后,由发送方通信实体发出告警,以使技术人员可进行异常排除,减少中间人攻击风险,同时避免必要的异区域通信实体通信请求被忽略。Further, after canceling the communication between the two communication entities, the sender communication entity can issue an alarm, so that the technician can eliminate the abnormality, reduce the risk of man-in-the-middle attack, and avoid the necessary communication request of the different area communication entity from being ignored.

本实施例的技术方案,通过接收方标识与公共参数生成的接收方标识公钥完成对接收方时戳签名值的解密,并根据解密后的接收方时戳签名值确定接收方时间戳与解密随机数值,根据进行解密时由公共时钟获取的发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证,根据验证结果建立发送方通信实体与接收方通信实体间的通信,将时间信息加入用于进行身份验证的加密信息中,使得发送方通信实体可同时根据时间与接收方标识对接收方通信实体进行身份验证,提升了双向身份验证的准确性,进一步保障了身份验证的安全性,同时降低了验证过程中对验证信息的管理成本。In the technical solution of this embodiment, the recipient's time stamp signature value is decrypted by the recipient's ID public key generated by the recipient's ID and public parameters, and the recipient's time stamp and decryption are determined according to the decrypted recipient's time stamp signature value. Random value, according to the sender's timestamp and the sender's random number obtained by the public clock during decryption, the receiver's timestamp and the decrypted random value are verified, and the communication between the sender's communication entity and the receiver's communication entity is established according to the verification result, The time information is added to the encrypted information used for authentication, so that the communication entity of the sender can authenticate the communication entity of the receiver according to the time and the identity of the receiver at the same time, which improves the accuracy of the two-way authentication and further guarantees the authentication. security, while reducing the management cost of verification information in the verification process.

实施例五Embodiment 5

图6为本发明实施例五提供的一种双向身份验证装置的结构示意图,应用于接收方通信实体,该双向身份验证装置包括:参数接收模块51,签名值验证模块52和第一参数发送模块53。6 is a schematic structural diagram of a two-way identity verification device provided in Embodiment 5 of the present invention, which is applied to a recipient communication entity, and the two-way identity verification device includes: a parameter receiving module 51 , a signature value verification module 52 and a first parameter sending module 53.

其中,参数接收模块51,用于接收发送方标识、发送方随机数以及发送方签名值;签名值验证模块52,用于根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;第一参数发送模块53,用于若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。Among them, the parameter receiving module 51 is used to receive the sender's identity, the sender's random number and the sender's signature value; the signature value verification module 52 is used to generate the sender's identity public key according to the pre-acquired public parameters and the sender's identity, using The sender's identification public key verifies the sender's random number and the sender's signature value; the first parameter sending module 53 is used to generate the receiver's timestamp signature value according to the receiver's private key obtained in advance if the verification result is successful, and send the The receiver's timestamp signature value and the receiver's identity corresponding to the receiver's communication entity are sent to the sender's communication entity.

本实施例的技术方案,解决了传统双向身份验证时若依赖于口令认证技术,则安全性低,若依赖于证书认证技术,则需依赖第三方证书认证中心,管理繁杂且成本高的问题。由于双方进行身份验证时无需通过第三方证书认证中心获取数字证书,也无需在本地进行证书信息存储,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,同时在进行双向验证时,采用标识号、时间与随机数相结合的方式提升了通信实体双方身份验证的安全性。The technical solution of this embodiment solves the problems of low security if the traditional two-way identity verification relies on the password authentication technology, and the third-party certificate authentication center is required to rely on the certificate authentication technology, which is complicated in management and high in cost. Since the two parties do not need to obtain a digital certificate through a third-party certificate certification center, nor do they need to store the certificate information locally, the efficiency of the identity verification between the two parties in the communication entity is improved, and the management cost of the verification information during the verification process is reduced. In the two-way verification, the combination of identification number, time and random number improves the security of the identity verification of both parties in the communication entity.

可选的,签名值验证模块52,包括:Optionally, the signature value verification module 52 includes:

签名解密单元,用于通过发送方标识公钥对发送方签名值进行解密,确定解密数值。The signature decryption unit is used for decrypting the sender's signature value by using the sender's identification public key to determine the decrypted value.

验证结果确定单元,用于若解密数值与发送方随机数相同,则将验证结果确定为成功;否则,将验证结果确定为失败。The verification result determination unit is configured to determine the verification result as success if the decryption value is the same as the random number of the sender; otherwise, determine the verification result as failure.

可选的,第一参数发送模块53,包括:Optionally, the first parameter sending module 53 includes:

时间戳获取单元,用于由公共时钟获取接收方时间戳。The timestamp obtaining unit is used to obtain the receiver timestamp from the public clock.

时戳随机数生成单元,用于将接收方时间戳与发送方随机数进行字段组合,生成时戳随机数。The timestamp random number generation unit is used to combine the receiver timestamp with the sender random number to generate a timestamp random number.

时戳签名值生成单元,用于通过预先获取的接收方私钥对时戳随机数签名加密,生成接收方时戳签名值。The time stamp signature value generating unit is used for signing and encrypting the time stamp random number with the receiver's private key obtained in advance, and generating the receiver's time stamp signature value.

参数发送单元,用于将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。The parameter sending unit is used for sending the receiver's time stamp signature value and the receiver's identity corresponding to the receiver's communication entity to the sender's communication entity.

可选的,双向身份验证装置,还包括:Optionally, a two-way authentication device, further comprising:

私钥获取模块,用于在接收发送方标识、发送方随机数以及发送方签名值之前,根据接收方通信实体对应的接收方标识,由密钥管理平台获取接收方通信实体对应的接收方私钥与公共参数。The private key acquisition module is used to obtain the receiver's private key corresponding to the receiver's communication entity by the key management platform according to the receiver's identification corresponding to the receiver's communication entity before receiving the sender's identifier, the sender's random number and the sender's signature value. key and public parameters.

通信取消模块,用于在将验证结果确定为失败之后,取消接收方通信实体与发送方通信实体的通信。The communication cancellation module is configured to cancel the communication between the communication entity of the receiver and the communication entity of the sender after the verification result is determined as failure.

本发明实施例提供的双向身份验证装置可执行如本发明实施例一与本发明实施例二提供的双向身份验证方法,具备执行方法相应的功能模块和有益效果。The two-way authentication device provided by the embodiment of the present invention can execute the two-way authentication method provided by the first embodiment of the present invention and the second embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

实施例六Embodiment 6

图7为本发明实施例六提供的一种双向身份验证装置的结构示意图,应用于发送方通信实体,该双向身份验证装置包括:签名值生成模块61,第二参数发送模块62,参数验证模块63和通信建立模块64。FIG. 7 is a schematic structural diagram of a two-way identity verification device provided in Embodiment 6 of the present invention, which is applied to a sender communication entity. The two-way identity verification device includes: a signature value generation module 61 , a second parameter transmission module 62 , and a parameter verification module 63 and a communication establishment module 64.

其中,签名值生成模块61,用于在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值;第二参数发送模块62,用于将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体;参数验证模块63,用于根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证;通信建立模块64,用于根据验证结果建立发送方通信实体与接收方通信实体间的通信。Wherein, the signature value generation module 61 is used to generate a random number of the sender when secure communication is required, and to encrypt and encrypt the random number of the sender through the pre-acquired private key of the sender to generate a signature value of the sender; the second parameter sending module 62, for sending the random number of the sender, the signature value of the sender and the sender identification corresponding to the sender communication entity to the receiver communication entity; the parameter verification module 63 is used for receiving according to the receiver identification and the pre-acquired identification. The public parameters are used to generate the receiver's identification public key, and the received receiver's timestamp signature value is verified by using the receiver's identification public key and the sender's random number; the communication establishment module 64 is used to establish the sender's communication entity and the sender's communication entity according to the verification result. Communication between recipient communicating entities.

本实施例的技术方案,解决了传统双向身份验证时若依赖于口令认证技术,则安全性低,若依赖于证书认证技术,则需依赖第三方证书认证中心,管理繁杂且成本高的问题。由于双方进行身份验证时无需通过第三方证书认证中心获取数字证书,也无需在本地进行证书信息存储,提升了通信实体双方身份验证的效率,降低了验证过程对验证信息的管理成本,同时在进行双向验证时,采用标识号、时间与随机数相结合的方式提升了通信实体双方身份验证的安全性。The technical solution of this embodiment solves the problems of low security if the traditional two-way identity verification relies on the password authentication technology, and the third-party certificate authentication center is required to rely on the certificate authentication technology, which is complicated in management and high in cost. Since the two parties do not need to obtain a digital certificate through a third-party certificate certification center, nor do they need to store the certificate information locally, the efficiency of the identity verification between the two parties in the communication entity is improved, and the management cost of the verification information during the verification process is reduced. In the two-way verification, the combination of identification number, time and random number improves the security of the identity verification of both parties in the communication entity.

可选的,参数验证模块63,包括:Optionally, the parameter verification module 63 includes:

参数解密单元,用于通过接收方标识公钥对接收方时戳签名值进行解密,确定接收方时间戳与解密随机数值。The parameter decryption unit is used to decrypt the signature value of the recipient's timestamp by using the recipient's identification public key, and determine the recipient's timestamp and the decrypted random value.

时间戳获取单元,用于由公共时钟获取发送方时间戳。The timestamp obtaining unit is used to obtain the sender timestamp from the public clock.

时戳数值验证单元,用于根据发送方时间戳与发送方随机数对接收方时间戳与解密随机数值进行验证。The timestamp value verification unit is used to verify the receiver timestamp and the decrypted random value according to the sender timestamp and the sender random number.

可选的,时戳数值验证单元,具体用于:Optional, timestamp value verification unit, specifically used for:

确定发送方时间戳与接收方时间戳间的时间差值;Determine the time difference between the sender's timestamp and the receiver's timestamp;

若时间差值小于预设时间阈值,且解密随机数值与发送方随机数相同,则确定验证结果为成功;If the time difference is less than the preset time threshold, and the decryption random value is the same as the sender's random number, the verification result is determined to be successful;

否则,确定验证结果为失败。Otherwise, the verification result is determined to be failed.

可选的,通信建立模块64,具体用于:Optionally, the communication establishment module 64 is specifically used for:

若验证结果为成功,建立发送方通信实体与接收方通信实体的通信;If the verification result is successful, establish the communication between the communication entity of the sender and the communication entity of the receiver;

若验证结果为失败,取消接收方通信实体与发送方通信实体的通信。If the verification result is failure, the communication between the receiver communication entity and the sender communication entity is cancelled.

可选的,双向身份验证装置,还包括:Optionally, a two-way authentication device, further comprising:

私钥获取模块,用于在进行安全通信之前,根据发送方通信实体对应的发送方标识,由密钥管理平台获取发送方通信实体对应的发送方私钥与公共参数。The private key acquisition module is used to acquire the sender's private key and public parameters corresponding to the sender's communication entity from the key management platform according to the sender's identifier corresponding to the sender's communication entity before the secure communication.

本发明实施例提供的双向身份验证装置可执行如本发明实施例三与本发明实施例四提供的双向身份验证方法,具备执行方法相应的功能模块和有益效果。The two-way authentication device provided by the embodiment of the present invention can execute the two-way authentication method provided by the third embodiment of the present invention and the fourth embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

实施例七Embodiment 7

图8为本发明实施例七提供的一种双向身份验证设备的结构示意图,该双向身份验证设备包括:处理器70、存储装置71、显示屏72、输入装置73和输出装置74。该数据处理设备中处理器70的数量可以是一个或者多个,图8中以一个处理器70为例。该数据处理设备中存储装置71的数量可以是一个或者多个,图8中以一个存储装置71为例。该数据处理设备的处理器70、存储装置71、显示屏72、输入装置73和输出装置74可以通过总线或者其他方式连接,图8中以通过总线连接为例。实施例中,数据处理设备可以使电脑、笔记本或智能平板等。8 is a schematic structural diagram of a two-way authentication device according to Embodiment 7 of the present invention. The two-way authentication device includes: a processor 70 , a storage device 71 , a display screen 72 , an input device 73 and an output device 74 . The number of processors 70 in the data processing device may be one or more, and one processor 70 is taken as an example in FIG. 8 . The number of storage devices 71 in the data processing device may be one or more, and one storage device 71 is taken as an example in FIG. 8 . The processor 70 , the storage device 71 , the display screen 72 , the input device 73 and the output device 74 of the data processing device may be connected by a bus or in other ways. In FIG. 8 , the connection by a bus is taken as an example. In an embodiment, the data processing device may be a computer, a notebook, a smart tablet, or the like.

存储装置71作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请任意实施例所述的双向身份验证设备对应的程序指令/模块(例如,参数接收模块51,签名值验证模块52和第一参数发送模块53,或签名值生成模块61,第二参数发送模块62,参数验证模块63和通信建立模块64)。存储装置71可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据设备的使用所创建的数据等。此外,存储装置71可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储装置71可进一步包括相对于处理器70远程设置的存储器,这些远程存储器可以通过网络连接至设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。As a computer-readable storage medium, the storage device 71 can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules (for example, a parameter receiving module) corresponding to the two-way authentication device described in any embodiment of the present application. 51, the signature value verification module 52 and the first parameter transmission module 53, or the signature value generation module 61, the second parameter transmission module 62, the parameter verification module 63 and the communication establishment module 64). The storage device 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the device, and the like. In addition, the storage device 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, storage device 71 may further include memory located remotely from processor 70, which may be connected to the device through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

显示屏72可以为具有触摸功能的显示屏72,其可以是电容屏、电磁屏或者红外屏。一般而言,显示屏72用于根据处理器70的指示显示数据,还用于接收作用于显示屏72的触摸操作,并将相应的信号发送至处理器70或其他装置。The display screen 72 may be a display screen 72 with a touch function, which may be a capacitive screen, an electromagnetic screen or an infrared screen. Generally speaking, the display screen 72 is used for displaying data according to the instruction of the processor 70, and is also used for receiving touch operations acting on the display screen 72, and sending corresponding signals to the processor 70 or other devices.

输入装置73可用于接收输入的数字或者字符信息,以及产生与展示设备的用户设置以及功能控制有关的键信号输入,还可以是用于获取图像的摄像头以及获取音频数据的拾音设备。输出装置74可以包括扬声器等音频设备。需要说明的是,输入装置73和输出装置74的具体组成可以根据实际情况设定。The input device 73 can be used for receiving input digital or character information, and generating key signal input related to user setting and function control of the display device, and can also be a camera for acquiring images and a pickup device for acquiring audio data. The output device 74 may include audio devices such as speakers. It should be noted that the specific composition of the input device 73 and the output device 74 can be set according to actual conditions.

处理器70通过运行存储在存储装置71中的软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述的双向身份验证方法。The processor 70 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the storage device 71 , that is, to implement the above-mentioned two-way authentication method.

上述提供的双向身份验证设备可用于执行上述任意实施例提供的双向身份验证方法,具备相应的功能和有益效果。The two-way authentication device provided above can be used to execute the two-way authentication method provided by any of the above embodiments, and has corresponding functions and beneficial effects.

示例性的,图9为本发明实施例提供的一种双向身份验证拓扑示例图,如图9所示,在作为通信发起方的发送方通信实体希望进行安全通信前,通过自身标识向KGC密钥管理平台进行私钥申请,并由KGC获取根据发送方标识生成的发送方私钥以及与该KGC对应的公共参数,基于其自身生成的发送方随机数以及发送方私钥生成发送方签名值,将发送方随机数、发送方签名值以及发送方标识发送至接收方通信实体中。接收方通信实体在接收上述信息前,通过自身标识向KGC密钥管理平台进行私钥申请,并由KGC获取根据接收方标识生成的接收方私钥以及与该KGC对应的公共参数。接收方通信实体在接收到发送方随机数、发送方签名值以及发送方标识后,依据发送方标识向KGC发送标识公钥申请,KGC依据接收到的发送方标识与公共参数生成发送方标识公钥并将其下发至接收方通信实体中,使得接收方通信实体可根据发送方标识公钥对发送方签名值进行解密,进而通过发送方随机数及解密后的发送方签名值对发送方通信实体身份进行验证,并在验证成功后由共有的公共时钟获取接收方时间戳,将其与发送方随机数组合后由接收方私钥进行加密得到接收方时戳签名值,并将接收方标识与接收方时戳签名值发送至发送方通信实体完成发送方通信实体对接收方通信实体的身份验证。发送方通信实体在接收到接收方标识与接收方时戳签名值后,依据接收方标识向KGC接收标识公钥申请,KGC依据接收到的接收方标识与公共参数生成接收方标识公钥并将其下发至发送方通信实体中,发送方通信实体可根据接收方标识公钥对接收方时戳签名值进行解密,并在解密后由共有的公共时钟获取发送方时间戳,通过发送方时间戳与发送方随机数对解密后的接收方时戳签名值进行验证,进而依据验证结果构建发送方通信实体与接收方通信实体间的安全通信连接。Exemplarily, FIG. 9 is an example diagram of a two-way authentication topology provided by an embodiment of the present invention. As shown in FIG. 9 , before the sender communication entity, which is the communication initiator, wishes to perform secure communication, it uses its own identification to send a secret to the KGC. The key management platform applies for the private key, and the KGC obtains the sender's private key generated according to the sender's identity and the public parameters corresponding to the KGC, and generates the sender's signature value based on the sender's random number and the sender's private key generated by itself. , and send the sender's random number, sender's signature value, and sender's identity to the receiver's communication entity. Before receiving the above information, the recipient communication entity applies to the KGC key management platform for a private key through its own identity, and the KGC obtains the recipient's private key generated according to the recipient's identity and the public parameters corresponding to the KGC. After receiving the sender's random number, the sender's signature value and the sender's identity, the receiver's communication entity sends a public key application to the KGC based on the sender's identity. key and send it to the receiver communication entity, so that the receiver communication entity can decrypt the sender's signature value according to the sender's identification public key, and then use the sender's random number and the decrypted sender's signature value to decrypt the sender's signature value. The identity of the communicating entity is verified, and after the verification is successful, the receiver's timestamp is obtained from the shared public clock, and it is combined with the sender's random number and encrypted by the receiver's private key to obtain the receiver's timestamp signature value. The identifier and the receiver's timestamp signature value are sent to the sender's communication entity to complete the identity verification of the sender's communication entity to the receiver's communication entity. After receiving the receiver's identity and the receiver's timestamp signature value, the sender's communication entity applies to the KGC to receive the identity public key according to the receiver's identity. The KGC generates the receiver's identity public key according to the received receiver's identity and public parameters. It is sent to the communication entity of the sender, and the communication entity of the sender can decrypt the signature value of the receiver's timestamp according to the public key of the receiver's identification, and obtain the sender's timestamp from the shared public clock after decryption. The decrypted signature value of the recipient's timestamp is verified by the stamp and the sender's random number, and then a secure communication connection between the sender's communication entity and the receiver's communication entity is constructed according to the verification result.

实施例八Embodiment 8

本发明实施例八还提供验证包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种双向身份验证方法,应用于接收方通信实体时,该方法包括:The eighth embodiment of the present invention also provides a storage medium for verifying that contains computer-executable instructions, the computer-executable instructions are used to execute a two-way authentication method when executed by a computer processor, and when applied to a recipient communication entity, the method include:

接收发送方标识、发送方随机数以及发送方签名值;Receive the sender's identity, sender's random number, and sender's signature value;

根据预先获取的公共参数与发送方标识生成发送方标识公钥,利用发送方标识公钥验证发送方随机数与发送方签名值;Generate the sender's identity public key according to the pre-obtained public parameters and the sender's identity, and use the sender's identity public key to verify the sender's random number and the sender's signature value;

若验证结果为成功,则根据预先获取的接收方私钥生成接收方时戳签名值,并将接收方时戳签名值以及与接收方通信实体对应的接收方标识发送至发送方通信实体。If the verification result is successful, the receiver timestamp signature value is generated according to the receiver's private key obtained in advance, and the receiver timestamp signature value and the receiver identifier corresponding to the receiver communication entity are sent to the sender communication entity.

应用于发送方通信实体时,该方法包括:When applied to a sender communicating entity, the method includes:

在需要进行安全通信时,生成发送方随机数,并将发送方随机数通过预先获取的发送方私钥签名加密生成发送方签名值;When secure communication is required, the sender's random number is generated, and the sender's random number is signed and encrypted by the sender's private key obtained in advance to generate the sender's signature value;

将发送方随机数、发送方签名值以及与发送方通信实体对应的发送方标识发送至接收方通信实体;Send the sender's random number, the sender's signature value, and the sender's identity corresponding to the sender's communication entity to the receiver's communication entity;

根据接收到的接收方标识与预先获取的公共参数生成接收方标识公钥,并利用接收方标识公钥与发送方随机数对接收到的接收方时戳签名值进行验证;Generate the receiver's identification public key according to the received receiver's identification and pre-obtained public parameters, and use the receiver's identification public key and the sender's random number to verify the received receiver's timestamp signature value;

根据验证结果建立发送方通信实体与接收方通信实体间的通信。The communication between the sender communication entity and the receiver communication entity is established according to the verification result.

当然,本发明实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本发明任意实施例所提供的双向身份验证方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by the embodiments of the present invention is not limited to the above-mentioned method operations, and can also execute the two-way authentication method provided by any embodiment of the present invention. related operations.

通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本发明可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be realized by software and necessary general-purpose hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment . Based on such understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in a computer-readable storage medium, such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or CD, etc., including several instructions to make a computer device (which can be a personal computer, A server, or a network device, etc.) executes the methods described in the various embodiments of the present invention.

值得注意的是,上述搜索装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that, in the above embodiments of the search device, the units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, each function The specific names of the units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (14)

1. A two-way authentication method applied to a recipient communication entity, the method comprising:
receiving a sender identification, a sender random number and a sender signature value;
generating a sender identification public key according to a pre-acquired public parameter and the sender identification, and verifying the sender random number and the sender signature value by using the sender identification public key;
and if the verification result is successful, generating a receiver time stamp signature value according to a pre-acquired receiver private key, and sending the receiver time stamp signature value and a receiver identifier corresponding to the receiver communication entity to a sender communication entity.
2. The method of claim 1, wherein said verifying the sender random number and the sender signature value using the sender identification public key comprises:
decrypting the sender signature value through the sender identification public key to determine a decrypted value;
if the decryption value is the same as the sender random number, determining the verification result as successful;
otherwise, the verification result is determined to be a failure.
3. The method of claim 1, wherein generating a receiver timestamp signature value according to a pre-obtained receiver private key comprises:
acquiring a receiver timestamp by a common clock;
performing field combination on the time stamp of the receiver and the random number of the sender to generate a time stamp random number;
and encrypting the timestamp random number signature through a pre-acquired private key of the receiver to generate a signature value of the timestamp of the receiver.
4. The method of claim 2, further comprising, after determining that the verification result is a failure:
canceling the communication between the receiver communication entity and the sender communication entity.
5. The method of claim 1, wherein prior to receiving the sender identification, sender random number, and sender signature value, further comprising:
and according to the receiver identification corresponding to the receiver communication entity, a key management platform acquires a receiver private key and public parameters corresponding to the receiver communication entity.
6. A two-way authentication method applied to a sender communication entity, the method comprising:
when the secure communication is needed, generating a sender random number, and encrypting the sender random number through a sender private key signature obtained in advance to generate a sender signature value;
sending the sender random number, the sender signature value and a sender identification corresponding to the sender communication entity to a receiver communication entity;
generating a receiver identification public key according to the received receiver identification and a public parameter acquired in advance, and verifying the received receiver timestamp signature value by using the receiver identification public key and the sender random number;
and establishing communication between the sender communication entity and the receiver communication entity according to the verification result.
7. The method of claim 6, wherein verifying the received receiver timestamp signature value using the receiver identification public key and the sender nonce comprises:
decrypting the receiver timestamp signature value through the receiver identification public key to determine a receiver timestamp and a decryption random value;
obtaining a sender timestamp by a common clock;
and verifying the time stamp of the receiver and the decryption random number value according to the time stamp of the sender and the random number of the sender.
8. The method of claim 7, wherein verifying the receiver timestamp and the decryption nonce value based on the sender timestamp and the sender nonce comprises:
determining a time difference between the sender timestamp and the receiver timestamp;
if the time difference is smaller than a preset time threshold value and the decryption random number value is the same as the sender random number, determining that the verification result is successful;
otherwise, determining that the verification result is failure.
9. The method of claim 6, wherein establishing communication between the sender communication entity and the receiver communication entity according to the authentication result comprises:
if the verification result is successful, establishing the communication between the sender communication entity and the receiver communication entity;
and if the verification result is failure, canceling the communication between the communication entity of the receiver and the communication entity of the sender.
10. The method of claim 6, further comprising, prior to said conducting secure communications:
and according to the sender identification corresponding to the sender communication entity, a secret key management platform acquires a sender secret key and public parameters corresponding to the sender communication entity.
11. A two-way authentication apparatus for use with a recipient communication entity, the apparatus comprising:
the parameter receiving module is used for receiving the sender identifier, the sender random number and the sender signature value;
the signature value verification module is used for generating a sender identification public key according to the pre-acquired public parameters and the sender identification, and verifying the sender random number and the sender signature value by using the sender identification public key;
and the first parameter sending module is used for generating a receiver time stamp signature value according to a pre-acquired receiver private key and sending the receiver time stamp signature value and a receiver identifier corresponding to the receiver communication entity to the sender communication entity if the verification result is successful.
12. A two-way authentication apparatus for use with a sender-side communication entity, the apparatus comprising:
the signature value generation module is used for generating a sender random number when the secure communication is required, and encrypting the sender random number through a sender private key signature acquired in advance to generate a sender signature value;
a second parameter sending module, configured to send the sender random number, the sender signature value, and a sender identifier corresponding to the sender communication entity to a receiver communication entity;
the parameter verification module is used for generating a receiver identification public key according to the received receiver identification and a public parameter acquired in advance, and verifying the received receiver timestamp signature value by using the receiver identification public key and the sender random number;
and the communication establishing module is used for establishing the communication between the sender communication entity and the receiver communication entity according to the verification result.
13. A bidirectional authentication apparatus characterized in that the bidirectional authentication apparatus comprises: a storage device and one or more processors;
the storage device to store one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the two-way authentication method of any one of claims 1-5 when the two-way authentication device is a recipient communication entity and to implement the two-way authentication method of any one of claims 6-10 when the two-way authentication device is a sender communication entity.
14. A storage medium containing computer-executable instructions for performing the two-way authentication method of any one of claims 1-5 and 6-10 when executed by a computer processor.
CN202210064883.7A 2022-01-20 2022-01-20 A two-way identity authentication method, device, equipment and storage medium Active CN114417309B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210064883.7A CN114417309B (en) 2022-01-20 2022-01-20 A two-way identity authentication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210064883.7A CN114417309B (en) 2022-01-20 2022-01-20 A two-way identity authentication method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114417309A true CN114417309A (en) 2022-04-29
CN114417309B CN114417309B (en) 2025-01-28

Family

ID=81275963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210064883.7A Active CN114417309B (en) 2022-01-20 2022-01-20 A two-way identity authentication method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114417309B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115085929A (en) * 2022-05-27 2022-09-20 浙江大华技术股份有限公司 Identity authentication method, server side and client side
CN115361134A (en) * 2022-07-19 2022-11-18 深圳市证通电子股份有限公司 Terminal identity authentication method, device, equipment and medium based on Hongming system
CN115412252A (en) * 2022-07-07 2022-11-29 渔翁信息技术股份有限公司 Data transmission method, transmission initiating terminal and transmission receiving terminal
CN115801245A (en) * 2022-11-10 2023-03-14 浙江大华技术股份有限公司 Device communication method, device, storage medium and electronic device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571407A (en) * 2003-07-14 2005-01-26 华为技术有限公司 A safety authentication method based on media gateway control protocol
CN101222331A (en) * 2007-01-09 2008-07-16 华为技术有限公司 Method and system for two-way authentication in authentication server and mesh network
CN103248488A (en) * 2013-05-14 2013-08-14 顾纯祥 Identity-based key generation method and identity-based authentication method
CN109547471A (en) * 2018-12-24 2019-03-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Network communication method and device
CN111066285A (en) * 2019-05-31 2020-04-24 阿里巴巴集团控股有限公司 Method for recovering public key based on SM2 signature
CN111372247A (en) * 2019-12-23 2020-07-03 国网天津市电力公司 Terminal secure access method and terminal secure access system based on narrowband Internet of things
CN111884991A (en) * 2020-06-08 2020-11-03 杭州电子科技大学 A User-Supervised Anonymous Authentication Method for Smart Homes
CN111953705A (en) * 2020-08-20 2020-11-17 全球能源互联网研究院有限公司 Internet of things identity authentication method, device and power Internet of things identity authentication system
CN113158202A (en) * 2021-03-22 2021-07-23 北京信息科技大学 Distributed key management and verification method and system based on identification password
CN113452764A (en) * 2021-06-17 2021-09-28 北京邮电大学 SM 9-based vehicle networking V2I bidirectional authentication method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571407A (en) * 2003-07-14 2005-01-26 华为技术有限公司 A safety authentication method based on media gateway control protocol
CN101222331A (en) * 2007-01-09 2008-07-16 华为技术有限公司 Method and system for two-way authentication in authentication server and mesh network
CN103248488A (en) * 2013-05-14 2013-08-14 顾纯祥 Identity-based key generation method and identity-based authentication method
CN109547471A (en) * 2018-12-24 2019-03-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Network communication method and device
CN111066285A (en) * 2019-05-31 2020-04-24 阿里巴巴集团控股有限公司 Method for recovering public key based on SM2 signature
CN111372247A (en) * 2019-12-23 2020-07-03 国网天津市电力公司 Terminal secure access method and terminal secure access system based on narrowband Internet of things
CN111884991A (en) * 2020-06-08 2020-11-03 杭州电子科技大学 A User-Supervised Anonymous Authentication Method for Smart Homes
CN111953705A (en) * 2020-08-20 2020-11-17 全球能源互联网研究院有限公司 Internet of things identity authentication method, device and power Internet of things identity authentication system
CN113158202A (en) * 2021-03-22 2021-07-23 北京信息科技大学 Distributed key management and verification method and system based on identification password
CN113452764A (en) * 2021-06-17 2021-09-28 北京邮电大学 SM 9-based vehicle networking V2I bidirectional authentication method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115085929A (en) * 2022-05-27 2022-09-20 浙江大华技术股份有限公司 Identity authentication method, server side and client side
CN115412252A (en) * 2022-07-07 2022-11-29 渔翁信息技术股份有限公司 Data transmission method, transmission initiating terminal and transmission receiving terminal
CN115361134A (en) * 2022-07-19 2022-11-18 深圳市证通电子股份有限公司 Terminal identity authentication method, device, equipment and medium based on Hongming system
CN115801245A (en) * 2022-11-10 2023-03-14 浙江大华技术股份有限公司 Device communication method, device, storage medium and electronic device

Also Published As

Publication number Publication date
CN114417309B (en) 2025-01-28

Similar Documents

Publication Publication Date Title
CN108235806B (en) Method, device and system for safely accessing block chain, storage medium and electronic equipment
CN106104562B (en) System and method for securely storing and recovering confidential data
JP2023099091A (en) Method, storage medium and electronic device for secure dynamic threshold signature scheme
CN108768988A (en) Block chain access control method, equipment and computer readable storage medium
WO2019110018A1 (en) Message authentication method for communication network system, communication method and communication network system
CN114417309B (en) A two-way identity authentication method, device, equipment and storage medium
EP1376976A1 (en) Methods for authenticating potential members invited to join a group
CN110933484A (en) Management method and device of wireless screen projection equipment
CN1939028A (en) Accessing protected data on network storage from multiple devices
CN112766962A (en) Method for receiving and sending certificate, transaction system, storage medium and electronic device
CN110932850B (en) Communication encryption method and system
CN110177124A (en) Identity identifying method and relevant device based on block chain
CN114650181B (en) E-mail encryption and decryption method, system, device and computer-readable storage medium
CN110635901A (en) Local Bluetooth dynamic authentication method and system for Internet of things equipment
CN113382002B (en) Data request method, request response method, data communication system, and storage medium
CN115473655B (en) Terminal authentication method, device and storage medium for access network
TW202231014A (en) Message transmitting system, user device and hardware security module for use therein
TW202118271A (en) Computer-implemented system and method for facilitating transactions associated with a blockchain using a network identifier for participating entities
CN113613241B (en) Wireless network node data processing method and device based on block chain
CN113365264B (en) Block chain wireless network data transmission method, device and system
CN110519222B (en) External network access identity authentication method and system based on disposable asymmetric key pair and key fob
CN115801281A (en) Authorization method, electronic device, and computer-readable storage medium
CN112966280A (en) Data processing method and device, server and data management system
CN115412236B (en) Method for managing secret key and calculating password, encryption method and device
TWI761243B (en) Encryption system and encryption method for group instant massaging

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant