WO2019200530A1 - 终端主密钥的远程分发方法及其系统 - Google Patents

终端主密钥的远程分发方法及其系统 Download PDF

Info

Publication number
WO2019200530A1
WO2019200530A1 PCT/CN2018/083366 CN2018083366W WO2019200530A1 WO 2019200530 A1 WO2019200530 A1 WO 2019200530A1 CN 2018083366 W CN2018083366 W CN 2018083366W WO 2019200530 A1 WO2019200530 A1 WO 2019200530A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
terminal
terminal master
master key
ciphertext
Prior art date
Application number
PCT/CN2018/083366
Other languages
English (en)
French (fr)
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/083366 priority Critical patent/WO2019200530A1/zh
Priority to CN201880000280.2A priority patent/CN108513704B/zh
Publication of WO2019200530A1 publication Critical patent/WO2019200530A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • 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 communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords

Definitions

  • the present invention relates to the field of electronic payment, and in particular, to a remote distribution method of a terminal master key and a system thereof.
  • the electronic payment system includes components such as terminal equipment, acquiring platform and bank core system.
  • components such as terminal equipment, acquiring platform and bank core system.
  • MK/SK Master Key/Session Key
  • the system is completed.
  • POS Point of Sale
  • 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 (master key).
  • the payment transaction terminal synchronizes the SK (session key) with the acquiring system through an effective manner such as sign-in, and the terminal encrypts the personal identification code by using the PIK (PIN Key) in the SK, and uses the MAK (MAC Key) pair in the SK.
  • the transaction message is MAC-operated to ensure that the transaction is not tampered with and complete.
  • a master key MK needs to be pre-synchronized into the terminal device.
  • 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.
  • the above scheme has the following disadvantages:
  • 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, and a large amount of manpower is required to complete the injection of the MK, which greatly increases the operation and maintenance cost of the terminal device.
  • Disadvantage 2 When the terminal is deployed, the factory terminal equipment should be sent to the terminal key management organization to complete the terminal key injection work, and then re-sent to the terminal's actual use plan, which causes huge expenses for the business development, including The cumbersome time and labor costs, while slowing down the speed of business expansion.
  • the technical problem to be solved by the present invention is to provide a remote distribution method and system for a terminal master key, which can solve the problems of cumbersome traditional local key injection method, high operation and maintenance cost, and meet security and convenience requirements. .
  • a remote distribution method of a terminal master key including:
  • the vendor device generates a terminal master key and a client protection key, and injects the client protection key into the hardware encryption machine;
  • the payment terminal generates a transmission key, and sends the transmission key and the unique identification code of the payment terminal to the key management system;
  • the key management system acquires the corresponding first terminal master key ciphertext according to the unique identification code of the payment terminal;
  • the payment terminal decrypts the second terminal master key ciphertext using the transport key, and stores the decrypted terminal master key into the secure area.
  • the invention further relates to a remote distribution system for a terminal master key, comprising a vendor device, a hardware encryption machine, a key management system and a payment terminal; the vendor device is respectively connected with the hardware encryption machine and the key management system, The key management system is respectively connected to the hardware encryption machine and the payment terminal;
  • the vendor device includes a first processor and a first memory, the first memory storing a first program, and configured to perform the following steps by the first processor:
  • the payment terminal includes a second processor and a second memory, the second memory stores a second program, and is configured to perform the following steps by the second processor:
  • the key management system includes a third processor and a third memory, the third memory storing a third program, and configured to perform the following steps by the third processor:
  • the beneficial effects of the present invention are: after the terminal master key is generated, the client protection key is encrypted and the output is imported into the key management system, and the client protection key is injected into the hardware encryption machine on both the client and the key management system. Therefore, the generation and transmission of the terminal master key meet the requirements of confidentiality; the key management system uses the transmission key to encrypt the terminal master key. Since the transmission key is one machine and one secret, only the key management system The key is held by the corresponding payment terminal, and the third party cannot directly obtain the encrypted terminal master key. Therefore, the distribution of the terminal master key satisfies the confidentiality requirement.
  • the invention remotely distributes the terminal master key in a simple, reliable and secure manner, and distributes the managed terminal master key securely and reliably to the payment terminal in the production stage, thereby reducing the labor cost of the terminal master key distribution. It also improves the speed of business development.
  • FIG. 1 is a flowchart of a method for remotely distributing a terminal master key according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of a method in step S7 in Embodiment 3 of the present invention.
  • the most critical idea of the present invention is that the distribution process of the terminal master key is advanced to the terminal before leaving the factory, and the key management system acts as the key POS to complete the key distribution to the factory sub-POS.
  • ZKMS Z Key Management System, a proprietary key management system, in the present invention is a key distribution system
  • POS Point Of Sale, a point-of-sale terminal, which in the present invention is a recipient of key distribution;
  • Key POS a terminal device that acts as a key distribution end, which manages and distributes the keys of the acquiring system;
  • HSM High Security Machine, a high security device, which is a hardware encryption machine in the present invention
  • TMK Terminal Master Key, terminal master key, which is the subject of key distribution in the present invention
  • CPK Custom Protect Key, the customer protection key, which is used to encrypt and protect the TMK.
  • the client and the HSM on the ZKMS side should pre-synchronize the key;
  • TK Transfer Key, transport key, which is a conceptual key name, including a transport encryption key TK-TEK and an authentication key TK-AUK;
  • TK-TEK Transfer Encryption Key, transport encryption key of the transport key
  • TK-AUK Authentication Key, the authentication key of the transport key
  • MAC Message Authentication Check value, a message checksum, a data integrity check algorithm.
  • a remote distribution method of a terminal master key includes:
  • the vendor device generates a terminal master key and a client protection key, and injects the client protection key into the hardware encryption machine;
  • the payment terminal generates a transmission key, and sends the transmission key and the unique identification code of the payment terminal to the key management system;
  • the key management system acquires the corresponding first terminal master key ciphertext according to the unique identification code of the payment terminal;
  • the payment terminal decrypts the second terminal master key ciphertext using the transport key, and stores the decrypted terminal master key into the secure area.
  • the beneficial effect of the present invention is that the terminal master key is securely and remotely distributed to the payment terminal in the production stage, which reduces the labor cost of the terminal master key distribution and improves the service development speed.
  • the customer protection key is injected into the hardware encryption machine in a key component manner.
  • the method further includes:
  • the hardware encryption machine generates an asymmetric key pair, including a production line public key and a production line private key;
  • the production line public key is sent to the payment terminal through a digital certificate.
  • sending the transmission key and the unique identification code of the payment terminal to the key management system is specifically:
  • the payment terminal encrypts the transmission key and the unique identification code of the payment terminal by using the production line public key, obtains a request ciphertext, and sends the request ciphertext to the key management system;
  • the key management system decrypts the request ciphertext using a production line private key in the hardware cipher to obtain a transport key and a unique identification code of the payment terminal.
  • the transmission key TK can be randomly generated by the payment terminal, encrypted by the production line public key and transmitted to the key management system ZKMS, and the key management system ZKMS can be decrypted using the production line private key in the hardware encryption machine HSM.
  • the transmission key TK is obtained, and therefore, the generation, transmission, and processing of the transmission key TK satisfy the confidentiality requirement.
  • the first terminal master key ciphertext is trans-encrypted according to the client protection key and the transmission key in the hardware encryption machine, to obtain a second terminal master key ciphertext, and the The second terminal master key ciphertext is sent to the payment terminal, which is specifically:
  • the terminal master key is encrypted by using the transmission key to obtain a second terminal master key ciphertext, and the second terminal master key ciphertext is sent to the payment terminal.
  • the terminal master key is guaranteed to be in an encrypted state in the key management system, thereby ensuring the security of the terminal master key.
  • the transport key includes a transport encryption key and an authentication key; “using the transport key to encrypt the terminal master key to obtain a second terminal master key ciphertext, and the The second terminal master key ciphertext is sent to the payment terminal, which is specifically:
  • the "payment terminal decrypts the second terminal master key ciphertext using the transmission key, and stores the decrypted terminal master key into the security zone", specifically:
  • the payment terminal performs MAC operation on the second terminal master key ciphertext by using the authentication key to obtain a second MAC value
  • the terminal master key is stored in the secure area.
  • the MAC operation is performed using the X9.19 algorithm.
  • the invention also provides a remote distribution system for a terminal master key, comprising a vendor device, a hardware encryption machine, a key management system and a payment terminal; the vendor device is respectively connected with the hardware encryption machine and the key management system The key management system is respectively connected to the hardware encryption machine and the payment terminal;
  • the vendor device includes a first processor and a first memory, the first memory storing a first program, and configured to perform the following steps by the first processor:
  • the payment terminal includes a second processor and a second memory, the second memory stores a second program, and is configured to perform the following steps by the second processor:
  • the key management system includes a third processor and a third memory, the third memory storing a third program, and configured to perform the following steps by the third processor:
  • the customer protection key is injected into the hardware encryption machine in a key component manner.
  • the hardware encryption machine includes a fourth processor and a fourth memory, the fourth memory stores a fourth program, and is configured to perform the following steps by the fourth processor:
  • the production line public key is sent to the payment terminal through a digital certificate.
  • sending the transmission key and the unique identification code of the payment terminal to the key management system is specifically:
  • the third program of the key management system is further configured to perform, by the third processor, the step of decrypting the request ciphertext using a line private key in a hardware cipher, obtaining a transport key and the payment The unique identification code of the terminal.
  • the terminal master key is encrypted by using the transmission key to obtain a second terminal master key ciphertext, and the second terminal master key ciphertext is sent to the payment terminal.
  • the transport key includes a transport encryption key and an authentication key; “using the transport key to encrypt the terminal master key to obtain a second terminal master key ciphertext, and the The second terminal master key ciphertext is sent to the payment terminal, which is specifically:
  • the second terminal master key ciphertext is decrypted using the transport key, and the decrypted terminal master key is stored in the secure area, specifically:
  • the terminal master key is stored in the secure area.
  • the MAC operation is performed using the X9.19 algorithm.
  • a first embodiment of the present invention is a remote distribution method of a terminal master key, which can complete remote distribution of a terminal master key in a generation phase, and is applicable to any type of financial terminal device, such as POS machines, ATMs, etc.
  • the key management system ZKMS needs to be set up, which is equivalent to the role of the key parent POS, and the key distribution to the factory sub-POS is completed.
  • the method includes the following steps:
  • the vendor device generates a terminal master key and a client protection key, and injects the client protection key into the hardware encryption machine; specifically, before the payment terminal is produced, the payment vendor device randomly generates the terminal master key TMK and the customer protection The key CPK will be injected into the hardware encryptor HSM in a key component manner.
  • S2 encrypting the terminal master key by using the customer protection key to obtain a first terminal master key ciphertext; specifically, before the payment terminal is produced, the payment vendor device uses the client protection key CPK to the terminal master key TMK Encryption is performed to obtain the first terminal master key ciphertext.
  • S3 associate the first terminal master key ciphertext with the unique identification code of the payment terminal, and save the association relationship to the key management system; that is, before the payment terminal is produced, the payment vendor device sets the terminal master key TMK The secure manner is imported into the key management system ZKMS. At the same time, the encrypted terminal master key TMK is associated with the unique identification code of the payment terminal for subsequent distribution of the terminal master key TMK.
  • the unique identifier of the payment terminal may be a unique number generated by the payment vendor device, and then sent to the payment terminal, or may be the device serial number of the payment terminal.
  • the payment terminal generates a transmission key, and sends the transmission key and the unique identification code of the payment terminal to the key management system; specifically, the payment terminal invokes the random key generation method of the security module in the production stage Generating a transport key TK, and organizing a key distribution request message according to the key management system ZKMS transaction interface, and then requesting a key management system ZKMS through a secure network link, wherein the key distribution request message includes a transport key TK and the unique identification code of the payment terminal.
  • the key management system acquires the corresponding first terminal master key ciphertext according to the unique identification code of the payment terminal; that is, after the key management system ZKMS receives the key distribution request, according to the payment terminal in the request message
  • the unique identification code acquires the first terminal master key ciphertext corresponding to the payment terminal.
  • S6 Perform trans-encryption of the first terminal master key ciphertext according to the client protection key and the transport key in the hardware encryption machine to obtain a second terminal master key ciphertext, and the second The terminal master key ciphertext is sent to the payment terminal.
  • the first terminal master key ciphertext is decrypted using a client protection key CPK in the hardware encryption machine to obtain a terminal master key TMK; and then the terminal master key is used by using the transport key TK.
  • the TMK performs encryption to obtain a second terminal master key ciphertext, and sends the second terminal master key ciphertext to the payment terminal. That is, the key management system ZKMS invokes the transcoding function of the encryption application service, and the terminal master key TMK is encrypted and translated by the client protection key CPK to be encrypted by the transmission key TK, and the second terminal master key ciphertext is output, and then The second terminal master key ciphertext is sent to the payment terminal.
  • the payment terminal decrypts the second terminal master key ciphertext by using the transmission key, and stores the decrypted terminal master key in the security area, that is, in the security module.
  • the payment terminal is communicably connected with the key downloading tool, and the payment terminal performs a key distribution request and response through the key downloading tool and the key management system ZKMS.
  • the terminal master key TMK is generated and encrypted by using the client protection key CPK, and then the output is imported into the key management system ZKMS.
  • the client protection key CPK is injected into the hardware encryption on the client and the key management system ZKMS.
  • the key management system ZKMS encrypts the terminal master key TMK using the transmission key TK, since the transmission key TK is a machine
  • the key management system ZKMS and the corresponding payment terminal hold the key, and the third party cannot directly obtain the encrypted terminal master key TMK. Therefore, the distribution of the terminal master key TMK satisfies the confidentiality requirement.
  • the terminal master key is remotely distributed in a simple, reliable, and secure manner, and the managed terminal master key is securely and remotely distributed to the payment terminal in the production stage, thereby reducing the labor cost of the terminal master key distribution. It also improved the speed of business development.
  • This embodiment is a further extension of the first embodiment, and the similarities are not repeated.
  • the difference is that before the step S4, that is, before the payment terminal sends the transmission key to the key management system ZKMS, the hardware encryption machine generates an asymmetric key. Yes, including the production line public key and the production line private key, and then sending the production line public key to the payment terminal by using a digital certificate, that is, the digital certificate including the production line public key can be sent to the payment terminal, and the payment terminal has a digital certificate. After verification, obtain the production line public key.
  • step S4 the payment terminal encrypts the transmission key and the unique identification code of the payment terminal by using the production line public key to obtain the requested ciphertext. And sending the request ciphertext to the key management system; the key management system decrypts the request ciphertext using a production line private key in the hardware cipher, to obtain a transport key and a unique identification code of the payment terminal.
  • the transmission key TK is randomly generated by the payment terminal, which is encrypted by the production line public key and transmitted to the key management system ZKMS, and the key management system ZKMS uses the production line private key in the hardware encryption machine HSM.
  • the transport key TK can be decrypted to ensure the confidentiality of the generation, transmission and processing of the transport key TK.
  • this embodiment is a further extension of steps S6 and S7 in the first embodiment.
  • the transmission key TK includes a transmission encryption key TK-TEK and an authentication key TK-AUK.
  • step S6 includes the following steps:
  • S62 Encrypt the terminal master key TMK by using a transport encryption key TK-TEK to obtain a second terminal master key ciphertext;
  • S63 Perform MAC operation on the second terminal master key ciphertext by using the authentication key TK-AUK to obtain a first MAC value.
  • step S7 includes the following steps:
  • the payment terminal performs MAC operation on the second terminal master key ciphertext by using an authentication key to obtain a second MAC value.
  • step S63 and step S71 the MAC operation is performed using the X9.19 algorithm.
  • the MAC terminal of the X9.19 algorithm is performed on the encrypted terminal master key by using the authentication key TK-AUK preset by the payment terminal, and the payment terminal receives the second terminal master key.
  • the MAC value of the ciphertext data can be verified by using the authentication key TK-AUK preset by the payment terminal.
  • the integrity and certifiability of the transmitted data are ensured by adopting a method of MAC encryption operation.
  • This embodiment is a specific application scenario of the foregoing embodiment.
  • the pre-deployment is carried out, mainly including the following aspects:
  • the main function of the key management system ZKMS is to manage the customer information and its terminal master key TMK, which accepts the key remote distribution request of the terminal, acquires the distributed terminal master key TMK and translates it to the terminal's transmission key TK. Encryption, the encryption mechanism of the transport key TK guarantees the confidentiality and integrity of the distributed key block information.
  • the customer protection key CPK is the top-level key for protecting the terminal master key TMK, and its request is input into the hardware encryptor HSM, and the injection should be completed before the terminal master key TMK is imported into the key management system ZKMS.
  • the terminal master key TMK is encrypted by the client protection key CPK, it is output from the client key management platform (such as the vendor device in the first embodiment) and transmitted to the key management system ZKMS in a secure and efficient manner, and the key management is performed.
  • the system ZKMS is imported into the system through the management page of the key management system ZKMS.
  • the distribution of the terminal master key TMK is started, including the following steps:
  • the payment terminal invokes a random key generation method of the security module to generate a transmission encryption key TK-TEK and an authentication key TK-AUK, collectively referred to as a transmission key TK;
  • the key downloading tool obtains the transmission key TK from the payment terminal, and organizes the key distribution request message according to the key management system ZKMS transaction interface, and then encrypts the key with the production line and then requests the key management through the secure network link.
  • System ZKMS
  • the key management system ZKMS After receiving the key distribution request and decrypting the key with the production line private key, the key management system ZKMS obtains the ciphertext of the corresponding terminal master key TMK according to the requested terminal number or the terminal serial number, and according to the transmission confidentiality in the request.
  • the key TK calling the encryption function of the encryption application service, encrypts the ciphertext of the terminal master key TMK by the client protection key CPK to be encrypted by the transmission encryption key TK-TEK, and outputs the final terminal master key TMK.
  • the key management system ZKMS organizes the key block according to the preset key block generation format, and performs the MAC operation of the X9.19 algorithm on the content of the key block by using the authentication key TK-AUK, and then according to the response interface format. Send a transaction response;
  • the payment terminal After receiving the key block data, the payment terminal checks the MAC value of the key block by using the authentication key TK-AUK, and processes the key block data by using the transmission encryption key TK-TEK after the verification, and the terminal is obtained after the processing succeeds.
  • the key TMK is stored in the security module of the payment terminal.
  • the generation, processing, transmission, and storage of the key related to key distribution satisfy the confidentiality requirement.
  • This embodiment is a remote distribution system corresponding to a terminal master key of the foregoing embodiment, including a vendor device, a hardware encryption machine, a key management system, and a payment terminal; the vendor device and the hardware encryption machine and the key respectively Managing a system communication connection, wherein the key management system is respectively connected to the hardware encryption machine and the payment terminal;
  • the vendor device includes a first processor and a first memory, the first memory storing a first program, and configured to perform the following steps by the first processor:
  • the payment terminal includes a second processor and a second memory, the second memory stores a second program, and is configured to perform the following steps by the second processor:
  • the key management system includes a third processor and a third memory, the third memory storing a third program, and configured to perform the following steps by the third processor:
  • the customer protection key is injected into the hardware encryption machine in a key component manner.
  • the hardware encryption machine includes a fourth processor and a fourth memory, the fourth memory stores a fourth program, and is configured to perform the following steps by the fourth processor:
  • the production line public key is sent to the payment terminal through a digital certificate.
  • sending the transmission key and the unique identification code of the payment terminal to the key management system is specifically:
  • the third program of the key management system is further configured to perform, by the third processor, the step of decrypting the request ciphertext using a line private key in a hardware cipher, obtaining a transport key and the payment The unique identification code of the terminal.
  • the terminal master key is encrypted by using the transmission key to obtain a second terminal master key ciphertext, and the second terminal master key ciphertext is sent to the payment terminal.
  • the transport key includes a transport encryption key and an authentication key; “using the transport key to encrypt the terminal master key to obtain a second terminal master key ciphertext, and the The second terminal master key ciphertext is sent to the payment terminal, which is specifically:
  • the second terminal master key ciphertext is decrypted using the transport key, and the decrypted terminal master key is stored in the secure area, specifically:
  • the terminal master key is stored in the secure area.
  • the MAC operation is performed using the X9.19 algorithm.
  • the vendor device may also be in communication connection with the payment terminal for transmitting the unique identification code of the payment terminal.
  • the present invention provides a remote distribution method for a terminal master key and a system thereof.
  • the client protection key is used to encrypt and output the result to the key management system, and the customer protection key is in the client.
  • Both the terminal and the key management system are injected into the hardware encryption machine. Therefore, the generation and transmission of the terminal master key satisfy the confidentiality requirement; the key management system uses the transmission key to encrypt the terminal master key. Since the transmission key is one machine and one secret, only the key management system and the corresponding payment terminal hold the key, and the third party cannot directly obtain the encrypted terminal master key. Therefore, the distribution of the terminal master key satisfies the secret. Sexual requirements.
  • the transmission key is randomly generated by the payment terminal, which is encrypted by the production line public key and transmitted to the key management system.
  • the key management system uses the production line private key in the hardware encryption machine to decrypt the transmission key to ensure transmission.
  • the encrypted terminal key is subjected to MAC operation using the authentication key preset by the payment terminal, and the payment terminal uses the payment terminal after receiving the second terminal master key ciphertext.
  • the authentication key can be used to verify the MAC value of the ciphertext data, and the integrity and certifiability of the transmitted data are ensured by adopting a MAC encryption operation method.
  • the invention remotely distributes the terminal master key in a simple, reliable and secure manner, and distributes the managed terminal master key securely and reliably to the payment terminal in the production stage, thereby reducing the labor cost of the terminal master key distribution. It also improves the speed of business development.

Abstract

本发明公开了一种终端主密钥的远程分发方法及其系统,方法包括:生成终端主密钥和客户保护密钥,并将客户保护密钥注入至硬件加密机;使用客户保护密钥加密终端主密钥,得到第一终端主密钥密文;将第一终端主密钥密文与唯一标识码进行关联并保存至密钥管理系统;支付终端生成传输密钥,并将其与唯一标识码发送至密钥管理系统;密钥管理系统根据唯一标识码,获取对应的第一终端主密钥密文;对第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并发送至支付终端;支付终端使用传输密钥解密第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中。本发明可在生产阶段将终端主密钥安全可靠地远程分发到支付终端中。

Description

终端主密钥的远程分发方法及其系统 技术领域
本发明涉及电子支付领域,尤其涉及一种终端主密钥的远程分发方法及其系统。
背景技术
随着电子支付产业的迅速发展,比如银行卡支付、消费卡支付、行业卡支付以及其它借由网络的电子支付技术,以其快捷方便的特点越来越受到人们的欢迎。
电子支付系统包括终端设备、收单平台和银行核心系统等组成部分。为了确保支付过程中消费者个人敏感信息的安全性,要求对交易过程中对个人敏感信息进行加密处理,主要通过主密钥/工作密钥(Master Key/Session Key,MK/SK)的密钥体系来完成。以POS(Point of Sale,销售点终端)的消费交易为例,终端设备保护交易敏感信息的原理如下:在MK/SK密钥体系中,要求POS与收单平台预先同步MK(主密钥),随后支付交易终端通过签到等有效方式与收单系统同步SK(会话密钥),终端通过SK中的PIK(PIN Key)对个人识别码进行加密处理,使用SK中的MAK(MAC Key)对交易报文进行MAC运算,以保证交易不被篡改且完整。
在MK/SK密钥系统中,需要将一个主密钥MK预先同步到终端设备中。传统上,要求POS在安全房中通过物理连接方式下载MK到设备中,即终端管理员在安全房区域中,通过串口通讯的方式,将密钥母POS中的MK直接下载到子POS中。但上述方案存在以下缺点:
缺点1:在安全房中,通过串口通讯方式下载密钥到POS中,要求POS统一送到安全房中,且需要大量的人力来完成MK的注入,大大增加了终端设备的运维成本。
缺点2:终端部署时,出厂的终端设备应先送往终端密钥管理机构,完成终端密钥注入工作后,再重新发往终端的实际使用方案,这对业务开展造成了巨大的开销,包括繁冗时间成本和人力成本等,同时减缓了业务扩展的速度。
技术问题
本发明所要解决的技术问题是:提供一种终端主密钥的远程分发方法及其系统,可解决传统的本地密钥注入方式流程繁琐、运维费用高昂等问题,且满足安全、便捷性要求。
技术解决方案
为了解决上述技术问题,本发明采用的技术方案为:一种终端主密钥的远程分发方法,包括:
厂商设备生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
密钥管理系统根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端;
支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中。
本发明还涉及一种终端主密钥的远程分发系统,包括厂商设备、硬件加密机、密钥管理系统和支付终端;所述厂商设备分别与所述硬件加密机和密钥管理系统通信连接,所述密钥管理系统分别与所述硬件加密机和支付终端通信连接;
所述厂商设备包括第一处理器及第一存储器,所述第一存储器存储有第一程序,并且被配置成由所述第一处理器执行以下步骤:
生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
所述支付终端包括第二处理器及第二存储器,所述第二存储器存储有第二程序,并且被配置成由所述第二处理器执行以下步骤:
生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
接收到密钥管理系统发送的第二终端主密钥密文后,使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中;
所述密钥管理系统包括第三处理器及第三存储器,所述第三存储器存储有第三程序,并且被配置成由所述第三处理器执行以下步骤:
接收到支付终端发送的传输密钥以及所述支付终端的唯一标识码后,根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
有益效果
本发明的有益效果在于:终端主密钥生成后使用客户保护密钥加密后输出导入到密钥管理系统,客户保护密钥在客户端和密钥管理系统端均被注入到硬件加密机中,因此,终端主密钥的生成和传输均满足机密性的要求;密钥管理系统使用传输密钥对终端主密钥进行加密处理,由于传输密钥是一机一密的,只有密钥管理系统和对应的支付终端持有该密钥,第三方无法直接获取加密后的终端主密钥,因此,终端主密钥的分发满足机密性要求。本发明通过一种简单、可靠、安全的方式远程分发终端主密钥,在生产阶段将管理的终端主密钥安全可靠地远程分发到支付终端中,减少了终端主密钥分发的人力成本,也提高了业务拓展速度。
附图说明
图1为本发明实施例一的一种终端主密钥的远程分发方法的流程图;
图2为本发明实施例三中步骤S6的方法流程图;
图3为本发明实施例三中步骤S7的方法流程图。
具体实施方式
为详细说明本发明的技术内容、所实现目的及效果,以下结合实施方式并配合附图详予说明。
本发明最关键的构思在于:将终端主密钥的分发流程提前到终端出厂前,由密钥管理系统作为密钥母POS的角色,完成对出厂的子POS的密钥分发。
缩略语和关键术语定义:
ZKMS:Z Key Management System,自营密钥管理系统,在本发明中是一种密钥分发系统;
POS:Point Of Sale,销售点终端,在本发明中是密钥分发的接收者;
密钥母POS:一种作为密钥分发端的终端设备,其管理并分发收单系统的密钥;
HSM:High Security Machine,高安全设备,在本发明中为硬件加密机;
TMK:Terminal Master Key,终端主密钥,在本发明中是密钥分发的主体;
CPK:Custom Protect Key,客户保护密钥,其被用于加密保护TMK,客户端和ZKMS端的HSM应该预先同步该密钥;
TK:Transfer Key,传输密钥,其是一个概念性的密钥名称,包含有传输加密密钥TK-TEK和认证密钥TK-AUK;
TK-TEK:Transfer Encryption Key,传输密钥的传输加密密钥;
TK-AUK:Authentication Key,传输密钥的认证密钥;
MAC:Message Authentication Check value,消息校验码,一种数据完整性校验算法。
请参阅图1,一种终端主密钥的远程分发方法,包括:
厂商设备生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
密钥管理系统根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端;
支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中。
从上述描述可知,本发明的有益效果在于:生产阶段将终端主密钥安全可靠地远程分发到支付终端中,减少了终端主密钥分发的人力成本,也提高了业务拓展速度。
进一步地,“将所述客户保护密钥注入至硬件加密机”具体为:
将所述客户保护密钥以密钥分量方式注入至硬件加密机。
由上述描述可知,保证客户保护密钥的安全性。
进一步地,“支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”之前,进一步包括:
硬件加密机生成非对称密钥对,包括产线公钥和产线私钥;
将所述产线公钥通过数字证书发送至支付终端。
进一步地,“将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”具体为:
支付终端使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;
密钥管理系统使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
由上述描述可知,传输密钥TK可由支付终端随机生成,其由产线公钥加密后传输到密钥管理系统ZKMS,密钥管理系统ZKMS使用硬件加密机HSM中的产线私钥才可解密得到传输密钥TK,因此,传输密钥TK的生成、传输以及处理均满足机密性要求。
进一步地,根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用硬件加密机中的客户保护密钥对所述第一终端主密钥密文进行解密,得到终端主密钥;
使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
由上述描述可知,保证终端主密钥在密钥管理系统中都处于加密的状态,从而保证终端主密钥的安全性。
进一步地,所述传输密钥包括传输加密密钥和认证密钥;“使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用所述传输加密密钥对所述终端主密钥进行加密,得到第二终端主密钥密文;
使用所述认证密钥对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
将所述第二终端主密钥密文和第一MAC值发送至支付终端。
进一步地,“支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中”具体为:
支付终端使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
若第二MAC值与所述第一MAC值一致,则使用传输加密密钥解密所述第二终端主密钥密文,得到终端主密钥;
将所述终端主密钥存储至安全区域中。
由上述描述可知,通过采用MAC加密运算的方法,保证传输数据的完整性和可认证性。
进一步地,采用X9.19算法进行MAC运算。
本发明还提出了一种终端主密钥的远程分发系统,包括厂商设备、硬件加密机、密钥管理系统和支付终端;所述厂商设备分别与所述硬件加密机和密钥管理系统通信连接,所述密钥管理系统分别与所述硬件加密机和支付终端通信连接;
所述厂商设备包括第一处理器及第一存储器,所述第一存储器存储有第一程序,并且被配置成由所述第一处理器执行以下步骤:
生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
所述支付终端包括第二处理器及第二存储器,所述第二存储器存储有第二程序,并且被配置成由所述第二处理器执行以下步骤:
生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
接收到密钥管理系统发送的第二终端主密钥密文后,使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中;
所述密钥管理系统包括第三处理器及第三存储器,所述第三存储器存储有第三程序,并且被配置成由所述第三处理器执行以下步骤:
接收到支付终端发送的传输密钥以及所述支付终端的唯一标识码后,根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
进一步地,“将所述客户保护密钥注入至硬件加密机”具体为:
将所述客户保护密钥以密钥分量方式注入至硬件加密机。
进一步地,所述硬件加密机包括第四处理器及第四存储器,所述第四存储器存储有第四程序,并且被配置成由所述第四处理器执行以下步骤:
生成非对称密钥对,包括产线公钥和产线私钥;
将所述产线公钥通过数字证书发送至支付终端。
进一步地,“将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”具体为:
接收到硬件加密机发送的产线公钥后,使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;
所述密钥管理系统的第三程序还被配置成由所述第三处理器执行以下步骤:使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
进一步地,“根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用硬件加密机中的客户保护密钥对所述第一终端主密钥密文进行解密,得到终端主密钥;
使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
进一步地,所述传输密钥包括传输加密密钥和认证密钥;“使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用所述传输加密密钥对所述终端主密钥进行加密,得到第二终端主密钥密文;
使用所述认证密钥对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
将所述第二终端主密钥密文和第一MAC值发送至支付终端。
进一步地,“使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中”具体为:
使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
若第二MAC值与所述第一MAC值一致,则使用传输加密密钥解密所述第二终端主密钥密文,得到终端主密钥;
将所述终端主密钥存储至安全区域中。
进一步地,采用X9.19算法进行MAC运算。
实施例一
请参照图1,本发明的实施例一为:一种终端主密钥的远程分发方法,该方法可在生成阶段完成对终端主密钥的远程分发,适应于任何类型的金融终端设备,如POS机、ATM等。在进行该方法前,需先搭建密钥管理系统ZKMS,其相当于密钥母POS的角色,完成对出厂的子POS的密钥分发。所述方法包括如下步骤:
S1:厂商设备生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;具体地,支付终端生产前,支付厂商设备随机生成终端主密钥TMK和客户保护密钥CPK,并将将客户保护密钥CPK以密钥分量方式注入至硬件加密机HSM中。
S2:使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;具体地,支付终端生产前,支付厂商设备使用客户保护密钥CPK对终端主密钥TMK进行加密,得到第一终端主密钥密文。
S3:将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;即支付终端生产前,支付厂商设备将终端主密钥TMK以安全的方式导入到密钥管理系统ZKMS,同时,将加密后的终端主密钥TMK与支付终端的唯一标识码进行关联,用于后续终端主密钥TMK的分发。其中,支付终端的唯一标识码可以是支付厂商设备生成的唯一编号,生成后再发送给支付终端,也可以是支付终端的设备序列号。
S4:支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;具体地,支付终端在生产阶段,调用安全模块的随机密钥生成方法生成传输密钥TK,并根据密钥管理系统ZKMS交易接口组织密钥分发请求报文,然后通过安全的网络链路请求密钥管理系统ZKMS,其中,密钥分发请求报文中包括传输密钥TK以及支付终端的唯一标识码。
S5:密钥管理系统根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;即密钥管理系统ZKMS接收密钥分发请求后,根据请求报文中的支付终端的唯一标识码,获取该支付终端对应的第一终端主密钥密文。
S6:根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
具体地,使用硬件加密机中的客户保护密钥CPK对所述第一终端主密钥密文进行解密,得到终端主密钥TMK;然后使用所述传输密钥TK对所述终端主密钥TMK进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。即密钥管理系统ZKMS调用加密机应用服务的转加密功能,将终端主密钥TMK由客户保护密钥CPK加密翻译到由传输密钥TK加密,输出第二终端主密钥密文,然后将第二终端主密钥密文响应给支付终端。
S7:支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中,即存储到安全模块中。
优选地,可将支付终端与密钥下载工具进行通信连接,支付终端通过密钥下载工具与密钥管理系统ZKMS进行密钥分发的请求与响应。
本实施例中,终端主密钥TMK生成后使用客户保护密钥CPK加密后输出导入到密钥管理系统ZKMS,客户保护密钥CPK在客户端和密钥管理系统ZKMS端均被注入到硬件加密机HSM中,因此,终端主密钥TMK的生成和传输均满足机密性的要求;密钥管理系统ZKMS使用传输密钥TK对终端主密钥TMK进行加密处理,由于传输密钥TK是一机一密的,只有密钥管理系统ZKMS和对应的支付终端持有该密钥,第三方无法直接获取加密后的终端主密钥TMK,因此,终端主密钥TMK的分发满足机密性要求。本实施例通过一种简单、可靠、安全的方式远程分发终端主密钥,在生产阶段将管理的终端主密钥安全可靠地远程分发到支付终端中,减少了终端主密钥分发的人力成本,也提高了业务拓展速度。
实施例二
本实施例是实施例一的进一步拓展,相同之处不再累述,区别在于,在步骤S4之前,即支付终端发送传输密钥到密钥管理系统ZKMS之前,硬件加密机生成非对称密钥对,包括产线公钥和产线私钥,然后将所述产线公钥通过数字证书发送至支付终端,即可以将包括产线公钥的数字证书发送给支付终端,支付终端对数字证书进行验证后,获取产线公钥。
在支付终端发送传输密钥到密钥管理系统ZKMS时,即步骤S4中,支付终端使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;密钥管理系统使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
本实施例中,传输密钥TK是由支付终端随机生成的,其由产线公钥加密后传输到密钥管理系统ZKMS,密钥管理系统ZKMS使用硬件加密机HSM中的产线私钥才可解密得到传输密钥TK,保证传输密钥TK的生成、传输以及处理的机密性。
实施例三
请参照图2-3,本实施例是实施例一中步骤S6、S7的进一步拓展。
本实施例中,传输密钥TK包括传输加密密钥TK-TEK和认证密钥TK-AUK。
如图2所示,步骤S6包括如下步骤:
S61:使用硬件加密机中的客户保护密钥CPK对所述第一终端主密钥密文进行解密,得到终端主密钥TMK;
S62:使用传输加密密钥TK-TEK对所述终端主密钥TMK进行加密,得到第二终端主密钥密文;
S63:使用认证密钥TK-AUK对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
S64:将所述第二终端主密钥密文和第一MAC值发送至支付终端。
如图3所示,步骤S7包括如下步骤:
S71:支付终端使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
S72:判断所述第二MAC值与所述第一MAC值是否一致,若是,则执行步骤S73。
S73:使用传输加密密钥TK-TEK解密所述第二终端主密钥密文,得到终端主密钥TMK;
S74:将所述终端主密钥TMK存储至安全区域中。
进一步地,步骤S63和步骤S71中,采用X9.19算法进行MAC运算。
终端主密钥的分发过程中,使用支付终端预置的认证密钥TK-AUK对加密后的终端主密钥进行了X9.19算法的MAC运算,支付终端在收到第二终端主密钥密文后,使用支付终端预置的认证密钥TK-AUK即可验证密文数据的MAC值。本实施例通过采用MAC加密运算的方法,保证传输数据的完整性和可认证性。
实施例四
本实施例是上述实施例的一具体应用场景。
在进行终端主密钥的远程分发之前,先进行前期部署,主要包括以下几个方面的准备工作:
1、密钥管理系统ZKMS的搭建
由于涉及到终端主密钥TMK的远程分发,且由于采用了一机一密的解决方案,因此要求搭建统一的客户密钥管理系统ZKMS,用于导入、管理和翻译终端主密钥TMK。
密钥管理系统ZKMS的主要功能是管理客户信息和其终端主密钥TMK,其接受终端的密钥远程分发请求,获取分发的终端主密钥TMK并将其翻译到终端的传输密钥TK进行加密,由传输密钥TK的加密机制保证分发密钥块信息的机密性和完整性。
2、客户保护密钥CPK的同步
客户保护密钥CPK是保护终端主密钥TMK的顶级密钥,其要求被输入到硬件加密机HSM中,在终端主密钥TMK被导入到密钥管理系统ZKMS前就应该完成注入。
3、终端主密钥TMK的传输和导入
终端主密钥TMK由客户保护密钥CPK加密后,从客户密钥管理平台(如实施例一中的厂商设备)输出,并通过安全、有效的方式传输到密钥管理系统ZKMS,密钥管理系统ZKMS收到终端主密钥TMK的密文后,通过密钥管理系统ZKMS的管理页面导入到系统中。
前期部署成功完成后,开始进行终端主密钥TMK的分发,包括如下步骤:
S101:支付终端在生成阶段,调用安全模块的随机密钥生成方法,生成传输加密密钥TK-TEK和认证密钥TK-AUK,统称为传输密钥TK;
S102:密钥下载工具从支付终端获取传输密钥TK,并根据密钥管理系统ZKMS交易接口组织密钥分发请求报文,然后用产线公钥加密后通过安全的网络链路请求密钥管理系统ZKMS;
S103:密钥管理系统ZKMS接收密钥分发请求并用产线私钥解密后,根据请求的终端编号或终端序列号等信息获取对应的终端主密钥TMK的密文,并根据请求中的传输密钥TK,调用加密机应用服务的转加密功能,将终端主密钥TMK的密文由客户保护密钥CPK加密翻译为由传输加密密钥TK-TEK加密,输出最终的终端主密钥TMK的密文;
S104:密钥管理系统ZKMS根据预设的密钥块的生成格式组织密钥块,并使用认证密钥TK-AUK对密钥块的内容进行X9.19算法的MAC运算,然后根据响应接口格式发送交易响应;
S105:密钥下载工具接收交易响应后,将密钥块数据注入到支付终端中;
S106:支付终端接收密钥块数据后,使用认证密钥TK-AUK校验密钥块的MAC值,验证通过后使用传输加密密钥TK-TEK处理密钥块数据,处理成功后得到终端主密钥TMK,并存入到支付终端的安全模块中。
本实施例中,密钥分发的相关密钥的生成、处理、传输以及存储都是满足机密性要求的。
实施例五
本实施例是对应上述实施例的一种终端主密钥的远程分发系统,包括厂商设备、硬件加密机、密钥管理系统和支付终端;所述厂商设备分别与所述硬件加密机和密钥管理系统通信连接,所述密钥管理系统分别与所述硬件加密机和支付终端通信连接;
所述厂商设备包括第一处理器及第一存储器,所述第一存储器存储有第一程序,并且被配置成由所述第一处理器执行以下步骤:
生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
所述支付终端包括第二处理器及第二存储器,所述第二存储器存储有第二程序,并且被配置成由所述第二处理器执行以下步骤:
生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
接收到密钥管理系统发送的第二终端主密钥密文后,使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中;
所述密钥管理系统包括第三处理器及第三存储器,所述第三存储器存储有第三程序,并且被配置成由所述第三处理器执行以下步骤:
接收到支付终端发送的传输密钥以及所述支付终端的唯一标识码后,根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
进一步地,“将所述客户保护密钥注入至硬件加密机”具体为:
将所述客户保护密钥以密钥分量方式注入至硬件加密机。
进一步地,所述硬件加密机包括第四处理器及第四存储器,所述第四存储器存储有第四程序,并且被配置成由所述第四处理器执行以下步骤:
生成非对称密钥对,包括产线公钥和产线私钥;
将所述产线公钥通过数字证书发送至支付终端。
进一步地,“将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”具体为:
接收到硬件加密机发送的产线公钥后,使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;
所述密钥管理系统的第三程序还被配置成由所述第三处理器执行以下步骤:使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
进一步地,“根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用硬件加密机中的客户保护密钥对所述第一终端主密钥密文进行解密,得到终端主密钥;
使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
进一步地,所述传输密钥包括传输加密密钥和认证密钥;“使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
使用所述传输加密密钥对所述终端主密钥进行加密,得到第二终端主密钥密文;
使用所述认证密钥对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
将所述第二终端主密钥密文和第一MAC值发送至支付终端。
进一步地,“使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中”具体为:
使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
若第二MAC值与所述第一MAC值一致,则使用传输加密密钥解密所述第二终端主密钥密文,得到终端主密钥;
将所述终端主密钥存储至安全区域中。
进一步地,采用X9.19算法进行MAC运算。
进一步地,当支付终端的唯一标识码是厂商设备生成的唯一编号时,厂商设备还可以与支付终端通信连接,用于传输支付终端的唯一标识码。
综上所述,本发明提供的一种终端主密钥的远程分发方法及其系统,终端主密钥生成后使用客户保护密钥加密后输出导入到密钥管理系统,客户保护密钥在客户端和密钥管理系统端均被注入到硬件加密机中,因此,终端主密钥的生成和传输均满足机密性的要求;密钥管理系统使用传输密钥对终端主密钥进行加密处理,由于传输密钥是一机一密的,只有密钥管理系统和对应的支付终端持有该密钥,第三方无法直接获取加密后的终端主密钥,因此,终端主密钥的分发满足机密性要求。传输密钥是由支付终端随机生成的,其由产线公钥加密后传输到密钥管理系统,密钥管理系统使用硬件加密机中的产线私钥才可解密得到传输密钥,保证传输密钥的生成、传输以及处理的机密性。终端主密钥的分发过程中,使用支付终端预置的认证密钥对加密后的终端主密钥进行了MAC运算,支付终端在收到第二终端主密钥密文后,使用支付终端预置的认证密钥即可验证密文数据的MAC值,通过采用MAC加密运算的方法,保证传输数据的完整性和可认证性。本发明通过一种简单、可靠、安全的方式远程分发终端主密钥,在生产阶段将管理的终端主密钥安全可靠地远程分发到支付终端中,减少了终端主密钥分发的人力成本,也提高了业务拓展速度。
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等同变换,或直接或间接运用在相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (16)

  1. 一种终端主密钥的远程分发方法,其特征在于,包括:
    厂商设备生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
    使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
    将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
    支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
    密钥管理系统根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
    根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端;
    支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中。
  2. 根据权利要求1所述的终端主密钥的远程分发方法,其特征在于,“将所述客户保护密钥注入至硬件加密机”具体为:
    将所述客户保护密钥以密钥分量方式注入至硬件加密机。
  3. 根据权利要求1所述的终端主密钥的远程分发方法,其特征在于,“支付终端生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”之前,进一步包括:
    硬件加密机生成非对称密钥对,包括产线公钥和产线私钥;
    将所述产线公钥通过数字证书发送至支付终端。
  4. 根据权利要求3所述的终端主密钥的远程分发方法,其特征在于,“将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”具体为:
    支付终端使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;
    密钥管理系统使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
  5. 根据权利要求1所述的终端主密钥的远程分发方法,其特征在于,“根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
    使用硬件加密机中的客户保护密钥对所述第一终端主密钥密文进行解密,得到终端主密钥;
    使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
  6. 根据权利要求5所述的终端主密钥的远程分发方法,其特征在于,所述传输密钥包括传输加密密钥和认证密钥;“使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
    使用所述传输加密密钥对所述终端主密钥进行加密,得到第二终端主密钥密文;
    使用所述认证密钥对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
    将所述第二终端主密钥密文和第一MAC值发送至支付终端。
  7. 根据权利要求6所述的终端主密钥的远程分发方法,其特征在于,“支付终端使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中”具体为:
    支付终端使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
    若第二MAC值与所述第一MAC值一致,则使用传输加密密钥解密所述第二终端主密钥密文,得到终端主密钥;
    将所述终端主密钥存储至安全区域中。
  8. 根据权利要求7所述的终端主密钥的远程分发方法,其特征在于,采用X9.19算法进行MAC运算。
  9. 一种终端主密钥的远程分发系统,其特征在于,包括厂商设备、硬件加密机、密钥管理系统和支付终端;所述厂商设备分别与所述硬件加密机和密钥管理系统通信连接,所述密钥管理系统分别与所述硬件加密机和支付终端通信连接;
    所述厂商设备包括第一处理器及第一存储器,所述第一存储器存储有第一程序,并且被配置成由所述第一处理器执行以下步骤:
    生成终端主密钥和客户保护密钥,并将所述客户保护密钥注入至硬件加密机;
    使用所述客户保护密钥加密所述终端主密钥,得到第一终端主密钥密文;
    将所述第一终端主密钥密文与支付终端的唯一标识码进行关联,并将关联关系保存至密钥管理系统;
    所述支付终端包括第二处理器及第二存储器,所述第二存储器存储有第二程序,并且被配置成由所述第二处理器执行以下步骤:
    生成传输密钥,并将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统;
    接收到密钥管理系统发送的第二终端主密钥密文后,使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中;
    所述密钥管理系统包括第三处理器及第三存储器,所述第三存储器存储有第三程序,并且被配置成由所述第三处理器执行以下步骤:
    接收到支付终端发送的传输密钥以及所述支付终端的唯一标识码后,根据所述支付终端的唯一标识码,获取对应的第一终端主密钥密文;
    根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
  10. 根据权利要求9所述的终端主密钥的远程分发系统,其特征在于,“将所述客户保护密钥注入至硬件加密机”具体为:
    将所述客户保护密钥以密钥分量方式注入至硬件加密机。
  11. 根据权利要求9所述的终端主密钥的远程分发系统,其特征在于,所述硬件加密机包括第四处理器及第四存储器,所述第四存储器存储有第四程序,并且被配置成由所述第四处理器执行以下步骤:
    生成非对称密钥对,包括产线公钥和产线私钥;
    将所述产线公钥通过数字证书发送至支付终端。
  12. 根据权利要求11所述的终端主密钥的远程分发系统,其特征在于,“将所述传输密钥以及所述支付终端的唯一标识码发送至密钥管理系统”具体为:
    接收到硬件加密机发送的产线公钥后,使用所述产线公钥加密所述传输密钥以及所述支付终端的唯一标识码,得到请求密文,并将所述请求密文发送至密钥管理系统;
    所述密钥管理系统的第三程序还被配置成由所述第三处理器执行以下步骤:使用硬件加密机中的产线私钥解密所述请求密文,得到传输密钥以及所述支付终端的唯一标识码。
  13. 根据权利要求9所述的终端主密钥的远程分发系统,其特征在于,“根据硬件加密机中的客户保护密钥和所述传输密钥,对所述第一终端主密钥密文进行转加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
    使用硬件加密机中的客户保护密钥对所述第一终端主密钥密文进行解密,得到终端主密钥;
    使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端。
  14. 根据权利要求13所述的终端主密钥的远程分发系统,其特征在于,所述传输密钥包括传输加密密钥和认证密钥;“使用所述传输密钥对所述终端主密钥进行加密,得到第二终端主密钥密文,并将所述第二终端主密钥密文发送至支付终端”具体为:
    使用所述传输加密密钥对所述终端主密钥进行加密,得到第二终端主密钥密文;
    使用所述认证密钥对所述第二终端主密钥密文进行MAC运算,得到第一MAC值;
    将所述第二终端主密钥密文和第一MAC值发送至支付终端。
  15. 根据权利要求14所述的终端主密钥的远程分发系统,其特征在于,“使用传输密钥解密所述第二终端主密钥密文,并将解密得到的终端主密钥存储至安全区域中”具体为:
    使用认证密钥对所述第二终端主密钥密文进行MAC运算,得到第二MAC值;
    若第二MAC值与所述第一MAC值一致,则使用传输加密密钥解密所述第二终端主密钥密文,得到终端主密钥;
    将所述终端主密钥存储至安全区域中。
  16. 根据权利要求15所述的终端主密钥的远程分发系统,其特征在于,采用X9.19算法进行MAC运算。
PCT/CN2018/083366 2018-04-17 2018-04-17 终端主密钥的远程分发方法及其系统 WO2019200530A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/083366 WO2019200530A1 (zh) 2018-04-17 2018-04-17 终端主密钥的远程分发方法及其系统
CN201880000280.2A CN108513704B (zh) 2018-04-17 2018-04-17 终端主密钥的远程分发方法及其系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/083366 WO2019200530A1 (zh) 2018-04-17 2018-04-17 终端主密钥的远程分发方法及其系统

Publications (1)

Publication Number Publication Date
WO2019200530A1 true WO2019200530A1 (zh) 2019-10-24

Family

ID=63404314

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083366 WO2019200530A1 (zh) 2018-04-17 2018-04-17 终端主密钥的远程分发方法及其系统

Country Status (2)

Country Link
CN (1) CN108513704B (zh)
WO (1) WO2019200530A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510702B (zh) * 2018-10-27 2023-05-16 福建福诺移动通信技术有限公司 一种基于计算机特征码的密钥存储及使用的方法
CN109547208B (zh) * 2018-11-16 2021-11-09 交通银行股份有限公司 金融电子设备主密钥在线分发方法及系统
CN109617672B (zh) * 2018-12-27 2022-07-12 八维通科技有限公司 一种新型的灌装秘钥方法
CN109792380B (zh) * 2018-12-27 2022-08-16 福建联迪商用设备有限公司 一种传递密钥的方法、终端及系统
CN111385085B (zh) * 2018-12-27 2022-12-30 山东量子科学技术研究院有限公司 一种量子三级密钥体系实现方法及系统
CN110048831A (zh) * 2018-12-29 2019-07-23 中国银联股份有限公司 Pos终端主密钥的分发方法和分发装置
CN109995532A (zh) * 2019-04-11 2019-07-09 晏福平 一种终端主密钥的在线管理方法及系统
CN110830243B (zh) * 2019-10-18 2023-06-09 中国第一汽车股份有限公司 对称密钥分发方法、装置、车辆及存储介质
CN111565107B (zh) * 2020-07-14 2020-11-27 腾讯科技(深圳)有限公司 基于云服务平台的密钥处理方法、装置和计算机设备
CN113708923A (zh) * 2021-07-29 2021-11-26 银盛支付服务股份有限公司 一种远程下载主密钥的方法及系统
CN114039728A (zh) * 2021-12-24 2022-02-11 中电长城(长沙)信息技术有限公司 一种报文加解密方法及其系统
CN114531238B (zh) * 2022-04-24 2022-07-19 中电信量子科技有限公司 基于量子密钥分发的密钥安全充注方法及系统
CN116886317B (zh) * 2023-09-07 2023-11-07 飞天诚信科技股份有限公司 一种服务器和终端设备之间分发密钥的方法、系统及设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100131756A1 (en) * 2008-11-26 2010-05-27 James Paul Schneider Username based authentication and key generation
CN101980558A (zh) * 2010-11-16 2011-02-23 北京航空航天大学 一种Ad hoc网络传输层协议上的加密认证方法
CN103716167A (zh) * 2013-03-15 2014-04-09 福建联迪商用设备有限公司 一种安全采集和分发传输密钥的方法及装置
CN107135070A (zh) * 2017-04-25 2017-09-05 上海汇尔通信息技术有限公司 Rsa密钥对和证书的注入方法、架构及系统

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5991399A (en) * 1997-12-18 1999-11-23 Intel Corporation Method for securely distributing a conditional use private key to a trusted entity on a remote system
US7159114B1 (en) * 2001-04-23 2007-01-02 Diebold, Incorporated System and method of securely installing a terminal master key on an automated banking machine
US20050091173A1 (en) * 2003-10-24 2005-04-28 Nokia Corporation Method and system for content distribution
CN103297224B (zh) * 2012-02-23 2016-05-25 中国移动通信集团公司 密钥信息分发方法及相关设备
CN105260884A (zh) * 2015-11-18 2016-01-20 北京微智全景信息技术有限公司 Pos机密钥分发方法及装置
CN106027247A (zh) * 2016-07-29 2016-10-12 宁夏丝路通网络支付有限公司北京分公司 Pos密钥远程下发方法
CN107800538B (zh) * 2016-09-01 2021-01-29 中电长城(长沙)信息技术有限公司 一种自助设备远程密钥分发方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100131756A1 (en) * 2008-11-26 2010-05-27 James Paul Schneider Username based authentication and key generation
CN101980558A (zh) * 2010-11-16 2011-02-23 北京航空航天大学 一种Ad hoc网络传输层协议上的加密认证方法
CN103716167A (zh) * 2013-03-15 2014-04-09 福建联迪商用设备有限公司 一种安全采集和分发传输密钥的方法及装置
CN107135070A (zh) * 2017-04-25 2017-09-05 上海汇尔通信息技术有限公司 Rsa密钥对和证书的注入方法、架构及系统

Also Published As

Publication number Publication date
CN108513704A (zh) 2018-09-07
CN108513704B (zh) 2021-01-19

Similar Documents

Publication Publication Date Title
CN108513704B (zh) 终端主密钥的远程分发方法及其系统
TWI715537B (zh) 基於雲環境的加密機金鑰注入系統、方法及裝置
CN108377190B (zh) 一种认证设备及其工作方法
US7697691B2 (en) Method of delivering Direct Proof private keys to devices using an on-line service
CN108683501B (zh) 基于量子通信网络的以时间戳为随机数的多次身份认证系统和方法
US20080049942A1 (en) System and method for secure key distribution to manufactured products
CN109981255B (zh) 密钥池的更新方法和系统
US11831753B2 (en) Secure distributed key management system
CN108323230B (zh) 一种传输密钥的方法、接收终端和分发终端
CN101771699A (zh) 一种提高SaaS应用安全性的方法及系统
WO2018090763A1 (zh) 一种终端主密钥的设置方法和装置
CN107104795B (zh) Rsa密钥对和证书的注入方法、架构及系统
CN108809633B (zh) 一种身份认证的方法、装置及系统
CN112532580B (zh) 一种基于区块链及代理重加密的数据传输方法及系统
CN101305542B (zh) 一种数字证书与密钥下载方法
JP2003530635A (ja) 機密情報を安全に記憶するシステム及び方法と、このシステム及び方法で使用されるデジタルコンテンツ配信装置及びサーバー
CN104767766A (zh) 一种Web Service接口验证方法、Web Service服务器、客户端
JP2000347566A (ja) コンテンツ管理装置、コンテンツ利用者端末及びプログラムを記録したコンピュータ読み取り可能な記録媒体
US20220171832A1 (en) Scalable key management for encrypting digital rights management authorization tokens
JP2007206961A (ja) 認証システムおよび同システムにおける認証情報委譲方法ならびにセキュリティデバイス
CA2561644C (en) A method to leverage a secure device to grant trust and identity to a second device
CN114154181A (zh) 基于分布式存储的隐私计算方法
CN111901287B (zh) 一种为轻应用提供加密信息的方法、装置和智能设备
WO2019178760A1 (zh) 一种传输密钥的方法及pos终端
CN108401493B (zh) 一种传输密钥的方法、接收终端及分发终端

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: 18915356

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: 18915356

Country of ref document: EP

Kind code of ref document: A1