WO2019153118A1 - Method for transmitting key, receiving terminal, and distribution terminal - Google Patents

Method for transmitting key, receiving terminal, and distribution terminal Download PDF

Info

Publication number
WO2019153118A1
WO2019153118A1 PCT/CN2018/075406 CN2018075406W WO2019153118A1 WO 2019153118 A1 WO2019153118 A1 WO 2019153118A1 CN 2018075406 W CN2018075406 W CN 2018075406W WO 2019153118 A1 WO2019153118 A1 WO 2019153118A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
transmission
authentication
terminal
receiving terminal
Prior art date
Application number
PCT/CN2018/075406
Other languages
French (fr)
Chinese (zh)
Inventor
唐胤曦
徐永标
Original Assignee
福建联迪商用设备有限公司
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 福建联迪商用设备有限公司 filed Critical 福建联迪商用设备有限公司
Priority to PCT/CN2018/075406 priority Critical patent/WO2019153118A1/en
Publication of WO2019153118A1 publication Critical patent/WO2019153118A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3242Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for supporting authentication of entities communicating through a packet data network
    • H04L63/0869Network architectures or network communication protocols for network security for supporting authentication of entities communicating through a packet data network for achieving mutual authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for supporting authentication of entities communicating through a packet data network
    • H04L63/0876Network architectures or network communication protocols for network security for supporting authentication of entities communicating through a packet data network based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communication the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/12Transmitting and receiving encryption devices synchronised or initially set up in a particular manner
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communication
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communication including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Abstract

The present invention relates to the field of data processing, and in particular, to a method for transmitting a key, a receiving terminal, and a distribution terminal. The present invention relates to randomly generating a character string with more than 16 bytes to obtain a first plaintext; performing MAC operation on an unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value; packaging the unique identifier of the receiving terminal, the first plaintext, and the first MAC value to obtain a first authentication message; sending the first authentication message to the distribution terminal so that the distribution terminal verifies the validity of the receiving terminal according to the first authentication message; and obtaining a specific key according to a response message sent by the distribution terminal. The security of remote key transmission is improved.

Description

一种传输密钥的方法、接收终端和分发终端Method for transmitting key, receiving terminal and distribution terminal 技术领域Technical field
本发明涉及数据处理领域,尤其涉及一种传输密钥的方法、接收终端及分发终端。The present invention relates to the field of data processing, and in particular, to a method for transmitting a key, a receiving terminal, and a distribution terminal.
背景技术Background technique
随着电子支付产业的迅速发展,比如银行卡支付、消费卡支付、行业卡支付以及其它借由网络的电子支付技术,以其快捷方便的特点越来越受到人们的欢迎。With the rapid development of the electronic payment industry, such as bank card payment, consumer card payment, industry card payment and other electronic payment technology through the network, it is more and more popular with its fast and convenient features.
电子支付系统包括终端设备、收单平台和银行核心系统等组成部分。为了确保支付过程中消费者个人敏感信息的安全性,要求对交易过程中对个人敏感信息进行加密处理,主要通过主密钥/工作密钥(Master Key/Session Key, MK/SK)的密钥体系来完成。以POS(Point of Sale,POS)的消费交易为例,终端设备保护交易敏感信息的原理如下:在MK/SK密钥体系中,要求POS与收单平台预先同步MK,随后支付交易终端通过签到等有效方式与收单系统同步SK密钥,终端通过SK中的PIK(PIN Key)密钥对个人识别码进行加密处理,使用SK中的MAK(MAC Key)对交易报文进行MAC运行,以保证交易不被篡改且完整。The electronic payment system includes components such as terminal equipment, acquiring platform and bank core system. In order to ensure the security of the consumer's personal sensitive information during the payment process, it is required to encrypt the personal sensitive information during the transaction process, mainly through the key of the Master Key/Session Key (MK/SK). The system is completed. Taking the POS (Point of Sale, POS) consumer transaction as an example, the principle of the terminal device protecting transaction sensitive information is as follows: In the MK/SK key system, the POS and the acquiring platform are required to pre-synchronize the MK, and then the payment transaction terminal passes the check-in. The effective mode synchronizes the SK key with the acquiring system. The terminal encrypts the personal identification code through the PIK (PIN Key) key in the SK, and uses the MAK (MAC Key) in the SK to perform MAC operation on the transaction message. Ensure that the transaction is not tampered with and complete.
在MK/SK密钥系统中,需要将一个主密钥MK预先同步到终端设备中。传统上,要求POS在安全房中通过物理连接方式下载MK到设备中,即终端管理员在安全房区域中,通过串口通讯的方式,将密钥母POS中的MK直接下载到子POS中。In the MK/SK key system, a master key MK needs to be pre-synchronized into the terminal device. Traditionally, the POS is required to download the MK to the device through the physical connection in the security room. That is, the terminal administrator downloads the MK in the key POS directly to the sub-POS through the serial communication mode in the security room area.
但是,这种传统的将MK密钥同步至POS终端的方法存在以下几个缺点:However, this conventional method of synchronizing MK keys to POS terminals has the following disadvantages:
缺点1:在安全房中,通过串口通讯方式下载密钥到POS中,要求POS统一送到安全房中,需要大量的人力来完成MK的注入,大大增加了POS设备的运维成本。Disadvantage 1: In the security room, the key is downloaded to the POS through the serial communication method, and the POS is required to be sent to the security room in a unified manner. A large amount of manpower is required to complete the injection of the MK, which greatly increases the operation and maintenance cost of the POS device.
缺点2:出厂的终端设备应先送往终端密钥管理机构,完成终端密钥注入工作后,再重新发往终端的实际使用方,这对业务开展造成了巨大的开销,包括时间成本和人力成本等,同时减缓了业务扩展的速度。Disadvantage 2: The factory terminal equipment should be sent to the terminal key management organization to complete the terminal key injection work, and then sent to the actual user of the terminal, which causes huge expenses for the business development, including time cost and manpower. Costs, etc., while slowing down the pace of business expansion.
缺点3:由于传统方式中,要求POS在安全房中通过物理方式,直接下载MK到设备中,固MK定期更换的事务运维成本巨大,为节约业务成本,有些客户会略去该事务,而长期而言,这将对POS设备中的MK密钥安全造成威胁。Disadvantage 3: In the traditional way, the POS is required to directly download the MK to the device through the physical mode in the security room. The cost of the operation and maintenance of the fixed MK is very large. To save the business cost, some customers will skip the transaction. In the long run, this will pose a threat to the security of MK keys in POS devices.
技术问题technical problem
本发明所要解决的技术问题是:如何提高远程传输密钥的安全性。The technical problem to be solved by the present invention is how to improve the security of the remote transmission key.
技术解决方案Technical solution
为了解决上述技术问题,本发明采用的技术方案为:In order to solve the above technical problems, the technical solution adopted by the present invention is:
本发明提供一种传输密钥的方法,包括:The invention provides a method for transmitting a key, comprising:
S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
本发明还提供一种接收终端,包括一个或多个第一处理器及第一存储器,所述第一存储器存储有程序,并且被配置成由所述一个或多个第一处理器执行以下步骤:The present invention also provides a receiving terminal comprising one or more first processors and a first memory, the first memory storing a program and configured to perform the following steps by the one or more first processors :
S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
本发明另提供一种传输密钥的方法,包括:The invention further provides a method for transmitting a key, comprising:
S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文;S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
本发明再提供一种分发终端,包括一个或多个第二处理器及第二存储器,所述第二存储器存储有程序,并且被配置成由所述一个或多个第二处理器执行以下步骤:The present invention further provides a distribution terminal comprising one or more second processors and a second memory, the second memory storing a program and configured to perform the following steps by the one or more second processors :
S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文;S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
有益效果Beneficial effect
本发明的有益效果在于:区别于现有技术对8字节随机字符串进行认证,本发明随机生成16字节的字符串,并对随机字符串进行复杂的MAC运算,非授权终端难以破解认证方法,有效提高了接收终端和分发终端之间双向认证的有效性,从而提高了远程密钥传输的安全性。本发明通过可靠性较高的双向认证方法认证接收终端和分发终端的合法性,使得特定密钥只会在授权的分发终端和授权的接收终端之间传输,一方面分发终端无法将特定密钥泄露给非授权的终端,提高了特定密钥的安全性,另一方面接收终端只能接收来自授权的分发终端发送的特定密钥,有效地避免了授权的接收终端接收到来自非授权终端的恶意代码的情况,提高了接收终端的安全性。The invention has the beneficial effects that the 8-byte random character string is authenticated differently from the prior art, and the present invention randomly generates a 16-byte character string and performs complex MAC operations on the random character string, and the unauthorized terminal is difficult to crack the authentication. The method effectively improves the effectiveness of the two-way authentication between the receiving terminal and the distribution terminal, thereby improving the security of the remote key transmission. The present invention authenticates the legitimacy of the receiving terminal and the distributing terminal by the highly reliable two-way authentication method, so that the specific key is only transmitted between the authorized distribution terminal and the authorized receiving terminal. On the one hand, the distribution terminal cannot set the specific key. Leaking to an unauthorized terminal improves the security of the specific key. On the other hand, the receiving terminal can only receive the specific key sent from the authorized distribution terminal, effectively preventing the authorized receiving terminal from receiving the unauthorized terminal. In the case of malicious code, the security of the receiving terminal is improved.
附图说明DRAWINGS
图1为本发明提供的一种传输密钥的方法的具体实施方式的流程框图;1 is a flow chart of a specific implementation manner of a method for transmitting a key according to the present invention;
图2为本发明还提供的一种接收终端的具体实施方式的结构框图;2 is a structural block diagram of a specific implementation manner of a receiving terminal according to the present invention;
图3为本发明另提供的一种传输密钥的方法的具体实施方式的流程框图;3 is a flow chart of a specific implementation manner of a method for transmitting a key according to another embodiment of the present invention;
图4为本发明再提供的一种分发终端的具体实施方式的结构框图;4 is a structural block diagram of a specific implementation manner of a distribution terminal according to another embodiment of the present invention;
标号说明:Label description:
1、第一处理器;2、第一存储器;3、第二处理器;4、第二存储器。1. A first processor; 2. a first memory; 3. a second processor; 4. a second memory.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
本发明的关键构思在于:本发明随机生成16字节的字符串,并对随机字符串进行复杂的MAC运算,非授权终端难以破解认证方法,有效提高了接收终端和分发终端之间双向认证的有效性,从而提高了远程密钥传输的安全性。The key idea of the present invention is that the present invention randomly generates a 16-byte character string and performs complex MAC operations on the random character string, and it is difficult for the unauthorized terminal to crack the authentication method, thereby effectively improving the mutual authentication between the receiving terminal and the distribution terminal. Effectiveness, which increases the security of remote key transmission.
请参照图1至图4,Please refer to Figure 1 to Figure 4,
如图1所示,本发明提供一种传输密钥的方法,包括:As shown in FIG. 1, the present invention provides a method for transmitting a key, including:
S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
进一步地,所述S2具体为:Further, the S2 is specifically:
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key, to obtain a first MAC value.
由上述描述可知,一个接收终端只有一个传输认证密钥,且其传输认证密钥具有唯一性,有利于降低认证方法被破解的风险,提高认证的有效性。It can be seen from the above description that a receiving terminal has only one transmission authentication key, and its transmission authentication key is unique, which is beneficial to reducing the risk of the authentication method being cracked and improving the validity of the authentication.
进一步地,所述S5之前,还包括:Further, before the S5, the method further includes:
获取来自所述分发终端的第二认证报文;所述第二认证报文包括分发终端的唯一标识、第二明文和第二MAC值;Acquiring a second authentication packet from the distribution terminal; the second authentication packet includes a unique identifier, a second plaintext, and a second MAC value of the distribution terminal;
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet according to the transmission authentication key, to obtain a third MAC value;
当所述第二MAC值和所述第三MAC值相同时,发送密钥分发请求至所述分发终端。When the second MAC value and the third MAC value are the same, a key distribution request is sent to the distribution terminal.
由上述描述可知,接收终端获取来自分发终端的响应报文后,先通过只有授权的分发终端和当前的接收终端具有的传输认证密钥验证第二认证报文所携带的信息,当确认分发终端的身份合法后,才向对方发起密钥分发请求,有利于降低流程耦合度,将认证流程与密钥下载流程分离;减少密钥在线路上不必要的传输,只有双向认证通过,分发终端才会下发密钥信息。It can be seen from the above description that after receiving the response message from the distribution terminal, the receiving terminal first verifies the information carried by the second authentication message by using only the authorized distribution terminal and the transmission authentication key of the current receiving terminal, and confirms the distribution terminal. After the identity is legal, the key distribution request is initiated to the other party, which is beneficial to reduce the process coupling degree, separate the authentication process from the key download process, and reduce the unnecessary transmission of the key on the line. Only the two-way authentication passes, and the distribution terminal will The key information is delivered.
进一步地,所述S5具体为:Further, the S5 is specifically:
所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
获取传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key; the transmission encryption key is unique;
根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
当所述第四MAC值和所述第五MAC值相同时,根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, verifying the validity of the specific key according to the key check value, and obtaining a second verification result; the second verification result includes a specific secret Key valid and specific key are invalid;
当所述第二验证结果为特定密钥有效时,根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。And when the second verification result is that the specific key is valid, decrypting the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
由上述描述可知,使用只有当前的接收终端和授权的分发终端具有的传输认证密钥认证当前接收到的响应报文的合法性,只有在确认响应报文来自授权的分发终端后,才从响应报文中取出特定密钥密文,并使用只有当前的接收终端和授权的分发终端才具有的传输加密密钥进行解密得到特定密钥明文。可有效避免接收终端将非授权的终端发送的假冒响应报文中携带的恶意代码取出,提高了接收终端的安全性。It can be seen from the above description that the validity of the currently received response message is authenticated by using only the current receiving terminal and the authorized transmission terminal, and the response is received only after the confirmation response message is from the authorized distribution terminal. The specific key ciphertext is retrieved from the message, and the specific key plaintext is obtained by decrypting using only the current receiving terminal and the transmission encryption key possessed by the authorized distribution terminal. The receiving terminal can effectively prevent the receiving terminal from taking out the malicious code carried in the fake response message sent by the unauthorized terminal, thereby improving the security of the receiving terminal.
进一步地,还包括:Further, it also includes:
生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;Generating a transmission authentication key and transmitting an encryption key; the transmission authentication key is unique; the transmission encryption key is unique;
发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端。And transmitting the transmission authentication key and the transmission encryption key to the transmission key management terminal, so that the transmission key management terminal synchronizes the transmission authentication key and the transmission encryption key to the distribution terminal.
由上述描述可知,通过传输密钥管理终端将授权的接收终端中用于认证身份合法性的传输认证密钥和解密特定密钥密文的传输加密密钥同步至授权的分发终端,使得授权的接收终端和授权的分发终端之间可安全地传输特定密钥。It can be seen from the above description that the transport key management terminal synchronizes the transport authentication key used for authenticating the identity of the authorized receiving terminal with the transport encryption key for decrypting the specific key ciphertext to the authorized distribution terminal, so that the authorized A specific key can be securely transmitted between the receiving terminal and the authorized distribution terminal.
如图2所示,本发明还一种接收终端,包括一个或多个第一处理器1及第一存储器2,所述第一存储器2存储有程序,并且被配置成由所述一个或多个第一处理器1执行以下步骤:As shown in FIG. 2, the present invention further provides a receiving terminal including one or more first processors 1 and a first memory 2, the first memory 2 storing a program and configured to be configured by the one or more The first processor 1 performs the following steps:
S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
进一步地,所述S2具体为:Further, the S2 is specifically:
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key, to obtain a first MAC value.
进一步地,所述S5之前,还包括:Further, before the S5, the method further includes:
获取来自所述分发终端的第二认证报文;所述第二认证报文包括分发终端的唯一标识、第二明文和第二MAC值;Acquiring a second authentication packet from the distribution terminal; the second authentication packet includes a unique identifier, a second plaintext, and a second MAC value of the distribution terminal;
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet according to the transmission authentication key, to obtain a third MAC value;
当所述第二MAC值和所述第三MAC值相同时,发送密钥分发请求至所述分发终端。When the second MAC value and the third MAC value are the same, a key distribution request is sent to the distribution terminal.
进一步地,所述S5具体为:Further, the S5 is specifically:
所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
获取传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key; the transmission encryption key is unique;
根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
当所述第四MAC值和所述第五MAC值相同时,根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, verifying the validity of the specific key according to the key check value, and obtaining a second verification result; the second verification result includes a specific secret Key valid and specific key are invalid;
当所述第二验证结果为特定密钥有效时,根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。And when the second verification result is that the specific key is valid, decrypting the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
进一步地,还包括:Further, it also includes:
生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;Generating a transmission authentication key and transmitting an encryption key; the transmission authentication key is unique; the transmission encryption key is unique;
发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端。And transmitting the transmission authentication key and the transmission encryption key to the transmission key management terminal, so that the transmission key management terminal synchronizes the transmission authentication key and the transmission encryption key to the distribution terminal.
如图3所示,本发明另提供一种传输密钥的方法,包括:As shown in FIG. 3, the present invention further provides a method for transmitting a key, including:
S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文;S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
进一步地,所述S3具体为:Further, the S3 is specifically:
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
进一步地,所述S1具体为:Further, the S1 is specifically:
获取来自所述接收终端的第一认证报文;所述第一认证报文包括接收终端的唯一标识、第一明文和第一MAC值;Obtaining a first authentication packet from the receiving terminal; the first authentication packet includes a unique identifier of the receiving terminal, a first plaintext, and a first MAC value;
获取与所述接收终端的唯一标识对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the unique identifier of the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
若所述第一MAC值和所述第六MAC值相同,则设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。And if the first MAC value and the sixth MAC value are the same, setting the third verification result to be verification pass; otherwise, setting the third verification result to verify that the verification fails.
进一步地,发送与特定密钥对应的响应报文至所述接收终端之前,还包括:Further, before the sending the response message corresponding to the specific key to the receiving terminal, the method further includes:
获取与所述接收终端对应的传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key corresponding to the receiving terminal; the transmission encryption key is unique;
根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;And encrypting the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;Performing a MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文。Encapsulating the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message.
进一步地,还包括:Further, it also includes:
从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性;Acquiring a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique;
从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。Acquiring a transmission encryption key corresponding to one or more distribution terminals from the transmission key management terminal to obtain a transmission encryption key set; each transmission encryption key in the transmission encryption key set is unique.
如图4所示,本发明再提供一种分发终端,包括一个或多个第二处理器3及第二存储器4,所述第二存储器4存储有程序,并且被配置成由所述一个或多个第二处理器3执行以下步骤:As shown in FIG. 4, the present invention further provides a distribution terminal including one or more second processors 3 and a second memory 4, the second memory 4 storing a program and configured to be configured by the one or The plurality of second processors 3 perform the following steps:
S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文;S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
进一步地,所述S3具体为:Further, the S3 is specifically:
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
进一步地,所述S1具体为:Further, the S1 is specifically:
获取来自所述接收终端的第一认证报文;所述第一认证报文包括接收终端的唯一标识、第一明文和第一MAC值;Obtaining a first authentication packet from the receiving terminal; the first authentication packet includes a unique identifier of the receiving terminal, a first plaintext, and a first MAC value;
获取与所述接收终端的唯一标识对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the unique identifier of the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
若所述第一MAC值和所述第六MAC值相同,则设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。And if the first MAC value and the sixth MAC value are the same, setting the third verification result to be verification pass; otherwise, setting the third verification result to verify that the verification fails.
进一步地,发送与特定密钥对应的响应报文至所述接收终端之前,还包括:Further, before the sending the response message corresponding to the specific key to the receiving terminal, the method further includes:
获取与所述接收终端对应的传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key corresponding to the receiving terminal; the transmission encryption key is unique;
根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;And encrypting the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;Performing a MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文。Encapsulating the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message.
进一步地,还包括:Further, it also includes:
从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性;Acquiring a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique;
从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。Acquiring a transmission encryption key corresponding to one or more distribution terminals from the transmission key management terminal to obtain a transmission encryption key set; each transmission encryption key in the transmission encryption key set is unique.
本发明提供的实施例一为:The first embodiment provided by the present invention is:
本实施例提供一种传输密钥的方法,包括:This embodiment provides a method for transmitting a key, including:
S1、接收终端生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;S1. The receiving terminal generates a transmission authentication key and a transmission encryption key; the transmission authentication key is unique; the transmission encryption key is unique;
接收终端发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端;Receiving, by the receiving terminal, the transmission authentication key and the transmission encryption key to the transmission key management terminal, so that the transmission key management terminal synchronizes the transmission authentication key and the transmission encryption key to the distribution terminal;
分发终端从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性。从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。The distribution terminal acquires a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique. Acquiring a transmission encryption key corresponding to one or more distribution terminals from the transmission key management terminal to obtain a transmission encryption key set; each transmission encryption key in the transmission encryption key set is unique.
可选地,所述接收终端为POS机。Optionally, the receiving terminal is a POS machine.
其中,前期部署包括以下几个方面的准备工作:Among them, the preliminary deployment includes preparations for the following aspects:
(1)传输密钥管理终端搭建(1) Transmission key management terminal construction
因为本实施例需在接收终端和分发终端之间预置相同的对称密钥进行身份合法性认证和解密特定密钥密文,且本实施例采用一机一密的解决方案,即不同接收终端所采用的传输认证密钥和传输加密密钥均不同,因此,需搭建一传输密钥管理终端,用于采集、翻译、和传输TK密钥,其中TK密钥包括TK-AUK(传输认证密钥)和TK-TEK(传输加密密钥)。Because the embodiment needs to preset the same symmetric key between the receiving terminal and the distribution terminal for identity legality authentication and decrypting the specific key ciphertext, and the embodiment adopts a one-machine-one-secret solution, that is, different receiving terminals. The transmission authentication key and the transmission encryption key are different. Therefore, a transmission key management terminal is needed to collect, translate, and transmit the TK key, wherein the TK key includes TK-AUK (transmission authentication key) Key) and TK-TEK (transport encryption key).
(2)一个以上接收终端将自身的TK密钥发送至传输密钥管理终端。(2) More than one receiving terminal transmits its own TK key to the transmission key management terminal.
其中,由接收终端生成随机TK密钥明文,并向传输密钥管理终端获取公钥,然后接收终端使用公钥加密TK密钥明文得到TK密钥密文,并将密文上传给传输密钥管理终端。通过公钥加密TK,保证TK传输过程的安全性。The receiving terminal generates a plain TK key plaintext, and obtains a public key from the transport key management terminal, and then the receiving terminal obtains the TK key ciphertext by using the public key to encrypt the TK key plaintext, and uploads the ciphertext to the transport key. Management terminal. The TK is encrypted by the public key to ensure the security of the TK transmission process.
(3)传输密钥管理终端与分发终端之间同步TK密钥。(3) Synchronizing the TK key between the transmission key management terminal and the distribution terminal.
为保证TK在传输过程中的安全性,要求传输密钥管理终端和分发终端之间约定保护TK的保护密钥,其包含两个部分:In order to ensure the security of the TK in the transmission process, it is required to transfer the protection key between the key management terminal and the distribution terminal to protect the TK, which comprises two parts:
其一,PK密钥(Protect Key),用于加密传输的TK的密钥信息;First, a PK key (Protect Key) for encrypting the transmitted TK key information;
其二,MAK密钥(MAC Key),用于计算与TK的密钥信息对应的MAC值,以验证TK的密钥信息的完整性。Second, the MAK key (MAC Key) is used to calculate the MAC value corresponding to the key information of the TK to verify the integrity of the TK key information.
(4)TK文件的传输(4) Transmission of TK files
传输密钥管理终端将TK的密钥信息写入到文件中,通过两种有效的方式进行传输:The transport key management terminal writes the key information of the TK into the file and transmits it in two effective ways:
其一,通过电子邮件的方式,由传输密钥管理终端的管理进程定期检查,通过客户接收的邮件设定发送到分发终端;First, by means of e-mail, the management process of the transmission key management terminal is periodically checked, and sent to the distribution terminal by the mail setting received by the client;
其二,通过FTP/SFTP的方式,由传输密钥管理终端的管理进程定期检查,通过客户接收的FTP/SFTP设定发送到分发终端。Second, through the FTP/SFTP method, the management process of the transmission key management terminal periodically checks and sends the FTP/SFTP settings received by the client to the distribution terminal.
S2、接收终端随机生成16字节以上的字符串,得到第一明文;S2. The receiving terminal randomly generates a character string of 16 bytes or more to obtain a first plaintext.
接收终端对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;具体为:The receiving terminal performs a MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value; specifically:
接收终端获取传输认证密钥;Receiving a terminal to obtain a transmission authentication key;
接收终端根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。The receiving terminal performs a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key to obtain a first MAC value.
其中,接收终端自身生成的具有唯一性的传输认证密钥为TK-AUK,使用TK-AUK对由接收终端的唯一标识和第一明文组成的数据进行MAC运算,使得只有经过传输密钥管理终端认证的分发终端可计算出第一MAC值。The unique transmission authentication key generated by the receiving terminal itself is TK-AUK, and the TK-AUK is used to perform MAC operation on the data consisting of the unique identifier of the receiving terminal and the first plaintext, so that only the transit key management terminal is used. The authenticated distribution terminal can calculate the first MAC value.
优选地,所述MAC运算的算法为X9.19算法。Preferably, the algorithm of the MAC operation is an X9.19 algorithm.
其中,在金融支付领域,对称密钥算法一般使用X9.9或X9.19算法进行MAC运算,而X9.19相对X9.9的算法复杂性更高,被破解的难度更大。Among them, in the field of financial payment, the symmetric key algorithm generally uses the X9.9 or X9.19 algorithm for MAC operations, while the X9.19 algorithm with X9.9 is more complex and more difficult to crack.
S3、接收终端封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;接收终端发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性。S3. The receiving terminal encapsulates the unique identifier of the receiving terminal, the first plaintext, and the first MAC value, to obtain a first authentication packet, and the receiving terminal sends the first authentication packet to the distribution terminal, so that the receiving terminal sends the first authentication packet to the distribution terminal. The distribution terminal verifies the legality of the receiving terminal according to the first authentication message.
S4、分发终端验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过。具体为:S4. The distribution terminal verifies the first authentication packet from the receiving terminal, and obtains a third verification result. The third verification result includes the verification pass and the verification fail. Specifically:
分发终端获取来自所述接收终端的第一认证报文;The distribution terminal acquires a first authentication message from the receiving terminal;
分发终端获取与所述接收终端的唯一标识对应的传输认证密钥;The distribution terminal acquires a transmission authentication key corresponding to the unique identifier of the receiving terminal;
分发终端根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;The distribution terminal performs a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
若所述第一MAC值和所述第六MAC值相同,则分发终端设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。If the first MAC value and the sixth MAC value are the same, the distribution terminal sets the third verification result as the verification pass; otherwise, the third verification result is set as the verification fails.
其中,分发终端根据第一认证报文中接收终端的唯一标识,从传输认证密钥集合中获取与该接收终端对应的传输认证密钥TK-AUK,由于授权的分发终端所采用的传输认证密钥与接收终端相同,因此,对相同的数据信息进行MAC运算所得到的MAC值相同。若接收到第一认证报文的终端是非授权的终端,由于非授权的终端不知道传输认证密钥TK-AUK,因此,其无法得出相同的MAC值,无法通过认证。此外,进行MAC运算的初始值为接收终端的唯一标识和16直接的随机字符串,初始值的随机性强且十分复杂,非授权的终端难以通过暴力破解等方式得出第一MAC值,认证的可靠性较高。The distribution terminal acquires the transmission authentication key TK-AUK corresponding to the receiving terminal from the transmission authentication key set according to the unique identifier of the receiving terminal in the first authentication packet, and the transmission authentication key adopted by the authorized distribution terminal The key is the same as the receiving terminal, so the MAC value obtained by performing MAC operation on the same data information is the same. If the terminal that receives the first authentication message is an unauthorized terminal, since the unauthorized terminal does not know the transmission authentication key TK-AUK, it cannot obtain the same MAC value and cannot pass the authentication. In addition, the initial value of the MAC operation is the unique identifier of the receiving terminal and the 16 direct random string. The randomness of the initial value is strong and very complicated, and it is difficult for the unauthorized terminal to obtain the first MAC value by means of brute force attack. The reliability is higher.
S5、当所述第三验证结果为验证通过时,分发终端随机生成16字节以上的字符串,得到第二明文。S5. When the third verification result is verification, the distribution terminal randomly generates a character string of 16 bytes or more to obtain a second plaintext.
S6、分发终端对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;具体为:S6: The distribution terminal performs MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value; specifically:
分发终端获取与所述接收终端对应的传输认证密钥;The distribution terminal acquires a transmission authentication key corresponding to the receiving terminal;
分发终端根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。The distribution terminal performs a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
其中,分发终端使用传输认证密钥TK-AUK对由分发终端的唯一标识和第二明文组成的数据进行MAC运算,由于本实施例采用一机一密,使得只有已通过分发终端认证的接收终端可对第二认证报文进行有效的身份认证。若分发终端将第二认证证书错发至其它授权的接收终端,则无法通过认证,分发终端不会接收到分发密钥的请求。The distribution terminal uses the transmission authentication key TK-AUK to perform MAC operation on the data consisting of the unique identifier of the distribution terminal and the second plaintext. Since the embodiment uses one machine and one secret, only the receiving terminal that has been authenticated by the distribution terminal is used. The second authentication packet can be authenticated effectively. If the distribution terminal misroutes the second authentication certificate to another authorized receiving terminal, the authentication terminal cannot pass the authentication, and the distribution terminal does not receive the request for the distribution key.
S7、分发终端封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;分发终端发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性。S7. The distribution terminal encapsulates the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet, and the distribution terminal sends the second authentication packet to the receiving terminal, so that the distribution terminal sends the second authentication packet to the receiving terminal. The receiving terminal verifies the legality of the distribution terminal according to the second authentication message.
S8、接收终端获取来自所述分发终端的第二认证报文;S8. The receiving terminal acquires a second authentication packet from the distribution terminal.
接收终端获取传输认证密钥;Receiving a terminal to obtain a transmission authentication key;
接收终端根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;The receiving terminal performs MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet according to the transmission authentication key, to obtain a third MAC value;
当所述第二MAC值和所述第三MAC值相同时,接收终端发送密钥分发请求至所述分发终端。When the second MAC value and the third MAC value are the same, the receiving terminal sends a key distribution request to the distribution terminal.
S9、当分发终端接收到来自所述接收终端的密钥分发请求时,获取与所述接收终端对应的传输加密密钥;S9. When the distribution terminal receives the key distribution request from the receiving terminal, acquiring a transmission encryption key corresponding to the receiving terminal;
分发终端根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;The distribution terminal encrypts the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
分发终端获取与所述接收终端对应的传输认证密钥;The distribution terminal acquires a transmission authentication key corresponding to the receiving terminal;
分发终端根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;The distribution terminal performs MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
分发终端封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文;The distribution terminal encapsulates the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message;
分发终端发送与特定密钥对应的响应报文至所述接收终端。The distribution terminal transmits a response message corresponding to the specific key to the receiving terminal.
其中,分发终端使用与所述接收终端对应的传输加密密钥TK-TEK和3DES的CBC模式对特定密钥MK进行加密处理。The distribution terminal performs encryption processing on the specific key MK using the CBC mode of the transmission encryption keys TK-TEK and 3DES corresponding to the receiving terminal.
优选地,所述响应报文还包括密钥属性和密钥的使用方法。Preferably, the response message further includes a key attribute and a method of using the key.
其中,密钥属性标志密钥类型,如DES、3DES,接收终端根据密钥属性确认密钥加解密算法;密钥的使用方式标示该密钥的用途以及存储区域,接收终端可对密钥进行分类,可限制接收终端上不通的程序访问,程序只允许访问特定类别的密钥。The key attribute flag key type, such as DES, 3DES, the receiving terminal confirms the key encryption and decryption algorithm according to the key attribute; the usage mode of the key indicates the use of the key and the storage area, and the receiving terminal can perform the key Classification can limit access to programs that are not available on the receiving terminal, and the program only allows access to specific categories of keys.
S10、接收终端根据所述分发终端发送的响应报文得到特定密钥。具体为:S10. The receiving terminal obtains a specific key according to the response packet sent by the distribution terminal. Specifically:
所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
接收终端获取传输认证密钥;Receiving a terminal to obtain a transmission authentication key;
接收终端获取传输加密密钥;Receiving, by the receiving terminal, a transmission encryption key;
接收终端根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Receiving, by the receiving terminal, performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
当所述第四MAC值和所述第五MAC值相同时,接收终端根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, the receiving terminal verifies the validity of the specific key according to the key check value, to obtain a second verification result; the second verification result includes The specific key is valid and the specific key is invalid;
当所述第二验证结果为特定密钥有效时,接收终端根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。When the second verification result is that the specific key is valid, the receiving terminal decrypts the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
其中,接收终端成功获得特定密钥MK后,将特定密钥MK写入至安全模块中。After the receiving terminal successfully obtains the specific key MK, the specific key MK is written into the security module.
由上述描述可知,本实施例采用预置对称密钥的方案进行双向认证,分发终端和接收终端预先同步了TK-AUK密钥,双方通过使用X9.19算法的MAC加密方法验证对方的认证信息,由于TK-AUK是一机一密的,只要双方均通过了MAC验证则完成双向认证,是远程密钥分发方案的有效性保证。It can be seen from the above description that the present embodiment adopts a preset symmetric key scheme for mutual authentication, and the distribution terminal and the receiving terminal pre-synchronize the TK-AUK key, and both parties verify the authentication information of the other party by using the MAC encryption method of the X9.19 algorithm. Since TK-AUK is one machine and one secret, as long as both parties have passed MAC authentication, the two-way authentication is completed, which is the guarantee of the validity of the remote key distribution scheme.
本方案中的核心机密内容是由分发终端分发的特定密钥MK。分发终端使用有效可靠的方法组织分发的密钥块,调用硬件加密机的应用服务以TK-TEK对MK密钥进行加密处理,且TK-TEK是一机一密的,只有分发终端和对应的接收终端持有该传输加密密钥,第三方并无法直接获取MK密钥主体,可见MK密钥的分发是满足机密性要求的。The core secret content in this scheme is a specific key MK distributed by the distribution terminal. The distribution terminal organizes the distributed key block by using an effective and reliable method, and invokes the application service of the hardware encryption machine to encrypt the MK key by TK-TEK, and the TK-TEK is one machine and one secret, only the distribution terminal and the corresponding The receiving terminal holds the transmission encryption key, and the third party cannot directly obtain the MK key body. It can be seen that the distribution of the MK key satisfies the confidentiality requirement.
TK-TEK是由POS随机生成的,之后通过安全可靠的方法上送到传输密钥管理终端,再通过传输密钥管理终端和分发终端之间约定的传输加密密钥同步给分发终端,分发终端接收TK后本地存储加密密钥,可见TK-TEK从生成、传输、以及存储均满足机密性要求。综上,密钥分发的生成、处理、传输、以及存储是满足机密性要求的。TK-TEK is randomly generated by the POS, and then sent to the transmission key management terminal through a secure and reliable method, and then synchronized to the distribution terminal by the transmission encryption key agreed between the transmission key management terminal and the distribution terminal, and the distribution terminal After receiving the TK and storing the encryption key locally, it can be seen that the TK-TEK meets the confidentiality requirements from generation, transmission, and storage. In summary, the generation, processing, transmission, and storage of key distributions meet confidentiality requirements.
本方案采用MAC加密运算的方法,保证传输数据的完整性和可认证性。密钥分发过程中,双方均通过TK-AUK对交换报文中的关键信息进行X9.19算法的MAC加密运算,且TK-AUK是一机一密的,只有持有相同的TK-AUK才可能通过MAC校验。由此可见,本方案的传输数据具有完整性和可认证性的特点。This scheme adopts the method of MAC encryption operation to ensure the integrity and certifiability of the transmitted data. During the key distribution process, both parties use the TK-AUK to perform the MAC encryption operation of the X9.19 algorithm on the key information in the exchange message, and the TK-AUK is one machine and one secret, and only the same TK-AUK is held. It is possible to pass the MAC check. It can be seen that the transmission data of the scheme has the characteristics of integrity and certifiability.
本发明的实施例二为:Embodiment 2 of the present invention is:
本实施例提供一种接收终端,包括一个或多个第一处理器1及第一存储器2,所述第一存储器2存储有程序,并且被配置成由所述一个或多个第一处理器1执行以下步骤:The embodiment provides a receiving terminal including one or more first processors 1 and a first memory 2, the first memory 2 storing a program and configured to be configured by the one or more first processors 1 Perform the following steps:
S1、生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端。S1: generating a transmission authentication key and transmitting an encryption key; the transmission authentication key is unique; the transmission encryption key is unique; and transmitting the transmission authentication key and the transmission encryption key to a transmission secret The key management terminal is configured to cause the transmission key management terminal to synchronize the transmission authentication key and the transmission encryption key to the distribution terminal.
S2、随机生成16字节以上的字符串,得到第一明文。S2: Randomly generate a string of 16 bytes or more to obtain the first plaintext.
S3、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;具体为:S3. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value; specifically:
获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key, to obtain a first MAC value.
S4、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文。S4. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC value, to obtain a first authentication packet.
S5、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性。S5. Send the first authentication packet to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
S6、获取来自所述分发终端的第二认证报文;所述第二认证报文包括分发终端的唯一标识、第二明文和第二MAC值;获取传输认证密钥;根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;当所述第二MAC值和所述第三MAC值相同时,发送密钥分发请求至所述分发终端。S6. Acquire a second authentication packet from the distribution terminal. The second authentication packet includes a unique identifier of the distribution terminal, a second plaintext, and a second MAC value. The transmission authentication key is obtained. The key performs a MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet to obtain a third MAC value; when the second MAC value and the third MAC value are the same, the transmission is performed. A key distribution request is made to the distribution terminal.
S6、根据所述分发终端发送的响应报文得到特定密钥。具体为:S6. Obtain a specific key according to the response message sent by the distribution terminal. Specifically:
所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
获取传输认证密钥;获取传输加密密钥;Obtaining a transmission authentication key; obtaining a transmission encryption key;
根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
当所述第四MAC值和所述第五MAC值相同时,根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, verifying the validity of the specific key according to the key check value, and obtaining a second verification result; the second verification result includes a specific secret Key valid and specific key are invalid;
当所述第二验证结果为特定密钥有效时,根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。And when the second verification result is that the specific key is valid, decrypting the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
本发明的实施例三为:Embodiment 3 of the present invention is:
本实施例提供一种分发终端,包括一个或多个第二处理器3及第二存储器4,所述第二存储器4存储有程序,并且被配置成由所述一个或多个第二处理器3执行以下步骤:The embodiment provides a distribution terminal including one or more second processors 3 and a second memory 4, the second memory 4 storing a program and configured to be configured by the one or more second processors 3 Perform the following steps:
S1、从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性;从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。S1: Obtain a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal, to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique; The key management terminal acquires a transport encryption key corresponding to one or more distribution terminals to obtain a transport encryption key set; each transport encryption key in the transport encryption key set is unique.
S2、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;具体为:S2: Verify the first authentication packet from the receiving terminal, and obtain a third verification result; the third verification result includes the verification pass and the verification fails; specifically:
获取来自所述接收终端的第一认证报文;所述第一认证报文包括接收终端的唯一标识、第一明文和第一MAC值;Obtaining a first authentication packet from the receiving terminal; the first authentication packet includes a unique identifier of the receiving terminal, a first plaintext, and a first MAC value;
获取与所述接收终端的唯一标识对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the unique identifier of the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
若所述第一MAC值和所述第六MAC值相同,则设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。And if the first MAC value and the sixth MAC value are the same, setting the third verification result to be verification pass; otherwise, setting the third verification result to verify that the verification fails.
S3、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文。S3. When the third verification result is verification pass, a character string of 16 bytes or more is randomly generated to obtain a second plaintext.
S4、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;具体为:S4: Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value; specifically:
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
S5、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文。发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性。S5. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC value, to obtain a second authentication packet. Sending the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
S6、当接收到来自所述接收终端的密钥分发请求时,获取与所述接收终端对应的传输加密密钥;S6. Acquire a transport encryption key corresponding to the receiving terminal when receiving a key distribution request from the receiving terminal.
根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;And encrypting the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;Performing a MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文;发送与特定密钥对应的响应报文至所述接收终端。Encapsulating the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message; and sending a response message corresponding to the specific key to the receiving terminal.
综上所述,本发明提供的一种传输密钥的方法、接收终端和分发终端,区别于现有技术对8字节随机字符串进行认证,本发明随机生成16字节的字符串,并对随机字符串进行复杂的MAC运算,非授权终端难以破解认证方法,有效提高了接收终端和分发终端之间双向认证的有效性,从而提高了远程密钥传输的安全性。本发明通过可靠性较高的双向认证方法认证接收终端和分发终端的合法性,使得特定密钥只会在授权的分发终端和授权的接收终端之间传输,一方面分发终端无法将特定密钥泄露给非授权的终端,提高了特定密钥的安全性,另一方面接收终端只能接收来自授权的分发终端发送的特定密钥,有效地避免了授权的接收终端接收到来自非授权终端的恶意代码的情况,提高了接收终端的安全性。进一步地,一个接收终端只有一个传输认证密钥,且其传输认证密钥具有唯一性,有利于降低认证方法被破解的风险,提高认证的有效性。进一步地,接收终端获取来自分发终端的响应报文后,先通过只有授权的分发终端和当前的接收终端具有的传输认证密钥验证第二认证报文所携带的信息,当确认分发终端的身份合法后,才向对方发起密钥分发请求,有利于降低流程耦合度,将认证流程与密钥下载流程分离;减少密钥在线路上不必要的传输,只有双向认证通过,分发终端才会下发密钥信息。进一步地,使用只有当前的接收终端和授权的分发终端具有的传输认证密钥认证当前接收到的响应报文的合法性,只有在确认响应报文来自授权的分发终端后,才从响应报文中取出特定密钥密文,并使用只有当前的接收终端和授权的分发终端才具有的传输加密密钥进行解密得到特定密钥明文。可有效避免接收终端将非授权的终端发送的假冒响应报文中携带的恶意代码取出,提高了接收终端的安全性。进一步地,通过传输密钥管理终端将授权的接收终端中用于认证身份合法性的传输认证密钥和解密特定密钥密文的传输加密密钥同步至授权的分发终端,使得授权的接收终端和授权的分发终端之间可安全地传输特定密钥。In summary, the present invention provides a method for transmitting a key, a receiving terminal, and a distribution terminal, which are different from the prior art in authenticating an 8-byte random character string, and the present invention randomly generates a 16-byte character string, and Performing complex MAC operations on random strings makes it difficult for unauthorized terminals to crack the authentication method, which effectively improves the effectiveness of mutual authentication between the receiving terminal and the distribution terminal, thereby improving the security of remote key transmission. The present invention authenticates the legitimacy of the receiving terminal and the distributing terminal by the highly reliable two-way authentication method, so that the specific key is only transmitted between the authorized distribution terminal and the authorized receiving terminal. On the one hand, the distribution terminal cannot set the specific key. Leaking to an unauthorized terminal improves the security of the specific key. On the other hand, the receiving terminal can only receive the specific key sent from the authorized distribution terminal, effectively preventing the authorized receiving terminal from receiving the unauthorized terminal. In the case of malicious code, the security of the receiving terminal is improved. Further, a receiving terminal has only one transmission authentication key, and the transmission authentication key is unique, which is beneficial to reducing the risk of the authentication method being cracked and improving the validity of the authentication. Further, after receiving the response message from the distribution terminal, the receiving terminal first verifies the information carried by the second authentication message by using only the authorized distribution terminal and the transmission authentication key of the current receiving terminal, and confirms the identity of the distribution terminal. After the law is valid, the key distribution request is initiated to the other party, which is beneficial to reduce the process coupling degree, separate the authentication process from the key download process, and reduce the unnecessary transmission of the key on the line. Only the two-way authentication passes, the distribution terminal will deliver the message. Key information. Further, the validity of the currently received response message is authenticated by using only the current receiving terminal and the authorized transmission terminal, and the response message is received only after the confirmation response message is from the authorized distribution terminal. The specific key ciphertext is taken out and decrypted using a transport encryption key that only the current receiving terminal and the authorized distribution terminal have to obtain a specific key plaintext. The receiving terminal can effectively prevent the receiving terminal from taking out the malicious code carried in the fake response message sent by the unauthorized terminal, thereby improving the security of the receiving terminal. Further, the transmission key management terminal synchronizes the transmission authentication key used for authenticating the identity of the authorized receiving terminal with the transmission encryption key of the decrypted specific key ciphertext to the authorized distribution terminal, so that the authorized receiving terminal A specific key can be securely transmitted between the authorized distribution terminal.

Claims (20)

  1. 一种传输密钥的方法,其特征在于,包括:A method for transmitting a key, comprising:
    S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
    S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
    S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
    S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
    S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
  2. 根据权利要求1所述的传输密钥的方法,其特征在于,所述S2具体为:The method for transmitting a key according to claim 1, wherein the S2 is specifically:
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key, to obtain a first MAC value.
  3. 根据权利要求1所述的传输密钥的方法,其特征在于,所述S5之前,还包括:The method for transmitting a key according to claim 1, wherein before the S5, the method further comprises:
    获取来自所述分发终端的第二认证报文;所述第二认证报文包括分发终端的唯一标识、第二明文和第二MAC值;Acquiring a second authentication packet from the distribution terminal; the second authentication packet includes a unique identifier, a second plaintext, and a second MAC value of the distribution terminal;
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet according to the transmission authentication key, to obtain a third MAC value;
    当所述第二MAC值和所述第三MAC值相同时,发送密钥分发请求至所述分发终端。When the second MAC value and the third MAC value are the same, a key distribution request is sent to the distribution terminal.
  4. 根据权利要求1所述的传输密钥的方法,其特征在于,所述S5具体为:The method for transmitting a key according to claim 1, wherein the S5 is specifically:
    所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    获取传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key; the transmission encryption key is unique;
    根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
    当所述第四MAC值和所述第五MAC值相同时,根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, verifying the validity of the specific key according to the key check value, and obtaining a second verification result; the second verification result includes a specific secret Key valid and specific key are invalid;
    当所述第二验证结果为特定密钥有效时,根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。And when the second verification result is that the specific key is valid, decrypting the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
  5. 根据权利要求1所述的传输密钥的方法,其特征在于,还包括:The method of transmitting a key according to claim 1, further comprising:
    生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;Generating a transmission authentication key and transmitting an encryption key; the transmission authentication key is unique; the transmission encryption key is unique;
    发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端。And transmitting the transmission authentication key and the transmission encryption key to the transmission key management terminal, so that the transmission key management terminal synchronizes the transmission authentication key and the transmission encryption key to the distribution terminal.
  6. 一种接收终端,其特征在于,包括一个或多个第一处理器及第一存储器,所述第一存储器存储有程序,并且被配置成由所述一个或多个第一处理器执行以下步骤:A receiving terminal, comprising: one or more first processors and a first memory, the first memory storing a program, and configured to perform the following steps by the one or more first processors :
    S1、随机生成16字节以上的字符串,得到第一明文;S1, randomly generating a string of 16 bytes or more to obtain a first plaintext;
    S2、对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值;S2. Perform MAC operation on the unique identifier of the receiving terminal and the first plaintext to obtain a first MAC value.
    S3、封装所述接收终端的唯一标识、所述第一明文和所述第一MAC值,得到第一认证报文;S3. Encapsulating the unique identifier of the receiving terminal, the first plaintext, and the first MAC address, to obtain a first authentication packet.
    S4、发送所述第一认证报文至分发终端,以使所述分发终端根据所述第一认证报文验证所述接收终端的合法性;S4. The first authentication packet is sent to the distribution terminal, so that the distribution terminal verifies the legality of the receiving terminal according to the first authentication packet.
    S5、根据所述分发终端发送的响应报文得到特定密钥。S5. Obtain a specific key according to the response message sent by the distribution terminal.
  7. 根据权利要求6所述的接收终端,其特征在于,所述S2具体为:The receiving terminal according to claim 6, wherein the S2 is specifically:
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    根据所述传输认证密钥对接收终端的唯一标识和所述第一明文进行MAC运算,得到第一MAC值。And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext according to the transmission authentication key, to obtain a first MAC value.
  8. 根据权利要求6所述的接收终端,其特征在于,所述S5之前,还包括:The receiving terminal according to claim 6, wherein before the S5, the method further comprises:
    获取来自所述分发终端的第二认证报文;所述第二认证报文包括分发终端的唯一标识、第二明文和第二MAC值;Acquiring a second authentication packet from the distribution terminal; the second authentication packet includes a unique identifier, a second plaintext, and a second MAC value of the distribution terminal;
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    根据所述传输认证密钥对所述第二认证报文中携带的分发终端的唯一标识和第二明文进行MAC运算,得到第三MAC值;Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext carried in the second authentication packet according to the transmission authentication key, to obtain a third MAC value;
    当所述第二MAC值和所述第三MAC值相同时,发送密钥分发请求至所述分发终端。When the second MAC value and the third MAC value are the same, a key distribution request is sent to the distribution terminal.
  9. 根据权利要求6所述的接收终端,其特征在于,所述S5具体为:The receiving terminal according to claim 6, wherein the S5 is specifically:
    所述响应报文包括特定密钥密文、密钥校验值和第四MAC值;The response message includes a specific key ciphertext, a key check value, and a fourth MAC value;
    获取传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key; the transmission authentication key is unique;
    获取传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key; the transmission encryption key is unique;
    根据所述传输认证密钥对所述响应报文进行MAC运算,得到第五MAC值;Performing a MAC operation on the response packet according to the transmission authentication key to obtain a fifth MAC value;
    当所述第四MAC值和所述第五MAC值相同时,根据所述密钥校验值验证所述特定密钥的有效性,得到第二验证结果;所述第二验证结果包括特定密钥有效和特定密钥无效;When the fourth MAC value and the fifth MAC value are the same, verifying the validity of the specific key according to the key check value, and obtaining a second verification result; the second verification result includes a specific secret Key valid and specific key are invalid;
    当所述第二验证结果为特定密钥有效时,根据所述传输加密密钥解密所述特定密钥密文,得到特定密钥明文。And when the second verification result is that the specific key is valid, decrypting the specific key ciphertext according to the transmission encryption key to obtain a specific key plaintext.
  10. 根据权利要求6所述的接收终端,其特征在于,还包括:The receiving terminal according to claim 6, further comprising:
    生成传输认证密钥和传输加密密钥;所述传输认证密钥具有唯一性;所述传输加密密钥具有唯一性;Generating a transmission authentication key and transmitting an encryption key; the transmission authentication key is unique; the transmission encryption key is unique;
    发送所述传输认证密钥和所述传输加密密钥至传输密钥管理终端,以使传输密钥管理终端同步所述传输认证密钥和所述传输加密密钥至所述分发终端。And transmitting the transmission authentication key and the transmission encryption key to the transmission key management terminal, so that the transmission key management terminal synchronizes the transmission authentication key and the transmission encryption key to the distribution terminal.
  11. 一种传输密钥的方法,其特征在于,包括:A method for transmitting a key, comprising:
    S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
    S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文; S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
    S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
    S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
    S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
    S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
  12. 根据权利要求11所述的传输密钥的方法,其特征在于,所述S3具体为:The method for transmitting a key according to claim 11, wherein the S3 is specifically:
    获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
  13. 根据权利要求11所述的传输密钥的方法,其特征在于,所述S1具体为:The method for transmitting a key according to claim 11, wherein the S1 is specifically:
    获取来自所述接收终端的第一认证报文;所述第一认证报文包括接收终端的唯一标识、第一明文和第一MAC值;Obtaining a first authentication packet from the receiving terminal; the first authentication packet includes a unique identifier of the receiving terminal, a first plaintext, and a first MAC value;
    获取与所述接收终端的唯一标识对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the unique identifier of the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
    若所述第一MAC值和所述第六MAC值相同,则设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。And if the first MAC value and the sixth MAC value are the same, setting the third verification result to be verification pass; otherwise, setting the third verification result to verify that the verification fails.
  14. 根据权利要求11所述的传输密钥的方法,其特征在于,发送与特定密钥对应的响应报文至所述接收终端之前,还包括:The method for transmitting a key according to claim 11, wherein before the sending the response message corresponding to the specific key to the receiving terminal, the method further includes:
    获取与所述接收终端对应的传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key corresponding to the receiving terminal; the transmission encryption key is unique;
    根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;And encrypting the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
    获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;Performing a MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
    封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文。Encapsulating the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message.
  15. 根据权利要求11所述的传输密钥的方法,其特征在于,还包括:The method of transmitting a key according to claim 11, further comprising:
    从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性;Acquiring a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique;
    从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。Acquiring a transmission encryption key corresponding to one or more distribution terminals from the transmission key management terminal to obtain a transmission encryption key set; each transmission encryption key in the transmission encryption key set is unique.
  16. 一种分发终端,其特征在于,包括一个或多个第二处理器及第二存储器,所述第二存储器存储有程序,并且被配置成由所述一个或多个第二处理器执行以下步骤:A distribution terminal, comprising: one or more second processors and a second memory, the second memory storing a program, and configured to perform the following steps by the one or more second processors :
    S1、验证来自接收终端的第一认证报文,得到第三验证结果;所述第三验证结果包括验证通过和验证未通过;S1, verifying the first authentication packet from the receiving terminal, and obtaining a third verification result; the third verification result includes the verification passing and the verification failing;
    S2、当所述第三验证结果为验证通过时,随机生成16字节以上的字符串,得到第二明文; S2, when the third verification result is that the verification is passed, randomly generating a character string of 16 bytes or more to obtain a second plaintext;
    S3、对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值;S3. Perform MAC operation on the unique identifier of the distribution terminal and the second plaintext to obtain a second MAC value.
    S4、封装所述分发终端的唯一标识、所述第二明文和所述第六MAC值,得到第二认证报文;S4. Encapsulating the unique identifier of the distribution terminal, the second plaintext, and the sixth MAC address, to obtain a second authentication packet.
    S5、发送所述第二认证报文至接收终端,以使所述接收终端根据所述第二认证报文验证所述分发终端的合法性;S5. Send the second authentication packet to the receiving terminal, so that the receiving terminal verifies the legality of the distribution terminal according to the second authentication packet.
    S6、当接收到来自所述接收终端的密钥分发请求时,发送与特定密钥对应的响应报文至所述接收终端。S6. When receiving a key distribution request from the receiving terminal, send a response message corresponding to the specific key to the receiving terminal.
  17. 根据权利要求16所述的分发终端,其特征在于,所述S3具体为:The distribution terminal according to claim 16, wherein the S3 is specifically:
    获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对分发终端的唯一标识和所述第二明文进行MAC运算,得到第二MAC值。Performing a MAC operation on the unique identifier of the distribution terminal and the second plaintext according to the transmission authentication key to obtain a second MAC value.
  18. 根据权利要求16所述的分发终端,其特征在于,所述S1具体为:The distribution terminal according to claim 16, wherein the S1 is specifically:
    获取来自所述接收终端的第一认证报文;所述第一认证报文包括接收终端的唯一标识、第一明文和第一MAC值;Obtaining a first authentication packet from the receiving terminal; the first authentication packet includes a unique identifier of the receiving terminal, a first plaintext, and a first MAC value;
    获取与所述接收终端的唯一标识对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the unique identifier of the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对所述第一认证报文中携带的接收终端的唯一标识和第一明文进行MAC运算,得到第六MAC值;And performing a MAC operation on the unique identifier of the receiving terminal and the first plaintext carried in the first authentication packet according to the transmission authentication key, to obtain a sixth MAC value;
    若所述第一MAC值和所述第六MAC值相同,则设置所述第三验证结果为验证通过;否则,设置所述第三验证结果为验证未通过。And if the first MAC value and the sixth MAC value are the same, setting the third verification result to be verification pass; otherwise, setting the third verification result to verify that the verification fails.
  19. 根据权利要求16所述的分发终端,其特征在于,发送与特定密钥对应的响应报文至所述接收终端之前,还包括:The distribution terminal according to claim 16, wherein before the sending the response message corresponding to the specific key to the receiving terminal, the method further includes:
    获取与所述接收终端对应的传输加密密钥;所述传输加密密钥具有唯一性;Obtaining a transmission encryption key corresponding to the receiving terminal; the transmission encryption key is unique;
    根据所述传输加密密钥加密预设的特定密钥,得到特定密钥密文;And encrypting the preset specific key according to the transmission encryption key to obtain a specific key ciphertext;
    获取与所述接收终端对应的传输认证密钥;所述传输认证密钥具有唯一性;Obtaining a transmission authentication key corresponding to the receiving terminal; the transmission authentication key is unique;
    根据所述传输认证密钥对所述特定密钥密文和预设的密钥校验值进行MAC运算,得到第七MAC值;Performing a MAC operation on the specific key ciphertext and the preset key check value according to the transmission authentication key to obtain a seventh MAC value;
    封装所述特定密钥密文、所述密钥校验值和所述第七MAC值,得到响应报文。Encapsulating the specific key ciphertext, the key check value, and the seventh MAC value to obtain a response message.
  20. 根据权利要求16所述的分发终端,其特征在于,还包括:The distribution terminal according to claim 16, further comprising:
    从传输密钥管理终端获取与一个以上接收终端对应的传输认证密钥,得到传输认证密钥集合;所述传输认证密钥集合中的每一传输认证密钥具有唯一性;Acquiring a transmission authentication key corresponding to one or more receiving terminals from the transmission key management terminal to obtain a transmission authentication key set; each transmission authentication key in the transmission authentication key set is unique;
    从传输密钥管理终端获取与一个以上分发终端对应的传输加密密钥,得到传输加密密钥集合;所述传输加密密钥集合中的每一传输加密密钥具有唯一性。Acquiring a transmission encryption key corresponding to one or more distribution terminals from the transmission key management terminal to obtain a transmission encryption key set; each transmission encryption key in the transmission encryption key set is unique.
PCT/CN2018/075406 2018-02-06 2018-02-06 Method for transmitting key, receiving terminal, and distribution terminal WO2019153118A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/075406 WO2019153118A1 (en) 2018-02-06 2018-02-06 Method for transmitting key, receiving terminal, and distribution terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/075406 WO2019153118A1 (en) 2018-02-06 2018-02-06 Method for transmitting key, receiving terminal, and distribution terminal
CN201880000105.3A CN108323231B (en) 2018-02-06 2018-02-06 Method for transmitting key, receiving terminal and distributing terminal

Publications (1)

Publication Number Publication Date
WO2019153118A1 true WO2019153118A1 (en) 2019-08-15

Family

ID=62895854

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075406 WO2019153118A1 (en) 2018-02-06 2018-02-06 Method for transmitting key, receiving terminal, and distribution terminal

Country Status (2)

Country Link
CN (1) CN108323231B (en)
WO (1) WO2019153118A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552270B (en) * 2020-04-29 2021-07-16 北京汽车股份有限公司 Safety authentication and data transmission method and device for vehicle-mounted diagnosis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246615A (en) * 2008-03-07 2008-08-20 北京握奇数据系统有限公司 System and device for long-range managing electronic purse state
US20100131756A1 (en) * 2008-11-26 2010-05-27 James Paul Schneider Username based authentication and key generation
CN101980558A (en) * 2010-11-16 2011-02-23 北京航空航天大学 Method for encryption authentication on Ad hoc network transmission layer protocol
CN106714156A (en) * 2015-07-13 2017-05-24 中兴通讯股份有限公司 Wireless access point and management platform authentication method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867925A (en) * 2010-06-10 2010-10-20 中兴通讯股份有限公司 Air interface key processing method and system thereof
CN102685741B (en) * 2011-03-09 2014-12-03 华为终端有限公司 Access authentication processing method and system, terminal as well as network equipment
CN103237005A (en) * 2013-03-15 2013-08-07 福建联迪商用设备有限公司 Method and system for key management
SE540133C2 (en) * 2014-10-09 2018-04-10 Kelisec Ab Improved system for establishing a secure communication channel

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246615A (en) * 2008-03-07 2008-08-20 北京握奇数据系统有限公司 System and device for long-range managing electronic purse state
US20100131756A1 (en) * 2008-11-26 2010-05-27 James Paul Schneider Username based authentication and key generation
CN101980558A (en) * 2010-11-16 2011-02-23 北京航空航天大学 Method for encryption authentication on Ad hoc network transmission layer protocol
CN106714156A (en) * 2015-07-13 2017-05-24 中兴通讯股份有限公司 Wireless access point and management platform authentication method and device

Also Published As

Publication number Publication date
CN108323231A (en) 2018-07-24
CN108323231B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN108513704B (en) Remote distribution method and system of terminal master key
CN108092776A (en) A kind of authentication server and authentication token
CN102025503B (en) Data security implementation method in cluster environment and high-security cluster
CN102244575A (en) Secure transmission system and method for online tax filling data of value-added tax
CN106953732B (en) Key management system and method for chip card
CN108323230B (en) Method for transmitting key, receiving terminal and distributing terminal
US20060053288A1 (en) Interface method and device for the on-line exchange of content data in a secure manner
CN107104795B (en) Method, framework and system for injecting RSA key pair and certificate
CN107800675A (en) A kind of data transmission method, terminal and server
WO2019020051A1 (en) Method and apparatus for security authentication
CN110881048B (en) Safety communication method and device based on identity authentication
CN111740844A (en) SSL communication method and device based on hardware cryptographic algorithm
CN106712939A (en) Offline key transmission method and device
TWI476629B (en) Data security and security systems and methods
WO2019153118A1 (en) Method for transmitting key, receiving terminal, and distribution terminal
JPH09305661A (en) Source authenticating method
CN108496336A (en) A kind of method and POS terminal of transmission key
KR19990038925A (en) Secure Two-Way Authentication Method in a Distributed Environment
CN108401493B (en) Method for transmitting key, receiving terminal and distributing terminal
JP2006185179A (en) Public key authentication method and system
CN110519222A (en) Outer net access identity authentication method and system based on disposable asymmetric key pair and key card
TWM579789U (en) Electronic contract signing device
CN202043118U (en) High-safety cluster
EP3185504A1 (en) Security management system for securing a communication between a remote server and an electronic device
CN106599697A (en) Method and system for safe upgrade of programs in PCI password card

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18904749

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18904749

Country of ref document: EP

Kind code of ref document: A1