[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2018090763A1 - 一种终端主密钥的设置方法和装置 - Google Patents

一种终端主密钥的设置方法和装置 Download PDF

Info

Publication number
WO2018090763A1
WO2018090763A1 PCT/CN2017/105732 CN2017105732W WO2018090763A1 WO 2018090763 A1 WO2018090763 A1 WO 2018090763A1 CN 2017105732 W CN2017105732 W CN 2017105732W WO 2018090763 A1 WO2018090763 A1 WO 2018090763A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
master key
key
identifier
updated
Prior art date
Application number
PCT/CN2017/105732
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 中国银联股份有限公司
Publication of WO2018090763A1 publication Critical patent/WO2018090763A1/zh

Links

Images

Classifications

    • 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/0891Revocation or update of secret information, e.g. encryption key update or rekeying

Definitions

  • the embodiments of the present invention relate to the field of network authentication, and in particular, to a method and an apparatus for setting a terminal master key.
  • POS Point of Sales
  • the terminal master key is required to encrypt the working key to ensure the security of the information exchange process information.
  • the professional service organization or the acquiring institution needs to take the PIN pad corresponding to each POS terminal to a secure area, and an integrated circuit (IC) chip or The parent POS is used to load the terminal master key into the PIN terminal of the POS terminal; and when the terminal master key of the POS terminal needs to be updated, the professional service organization or the acquirer needs to correspond to the POS terminal.
  • the PIN pad is taken to a secure area, and an integrated circuit (IC) chip is used or the POS key of the POS terminal to be updated is used to refill the terminal master key to be updated.
  • the initialization and update of the POS terminal master key requires the cost of purchasing the parent POS; and before the POS terminal is deployed or the POS terminal needs to update the terminal master key, it needs to be provided by a specialized service organization or an acquirer.
  • the mechanism manually takes the PIN pad to a secure area, and uses the parent POS to fill the terminal master key to the PIN terminal of the POS terminal. The whole process cycle is long, and the transportation cost is increased. And need to invest the corresponding manpower.
  • the embodiment of the invention provides a method and a device for setting a terminal master key, which are used to improve the security and convenience of setting a terminal master key.
  • an embodiment of the present invention provides a method for setting a terminal master key, where the method includes: a background system receiving an update master key request sent by a terminal; receiving a current identifier of the terminal sent by the terminal; wherein, updating the master key
  • the request includes the to-be-updated identifier of the terminal, and the background system determines, according to the preset relationship between the identifier of the terminal and the master key, the master key to be updated corresponding to the identifier to be updated of the terminal, and the current master key corresponding to the current identifier.
  • the background system encrypts the updated master key by using the current master key, and sends the encrypted master key to be updated to the terminal; wherein the encrypted master key to be updated is used to enable the terminal to use the current master key pair.
  • the encrypted master key to be updated is decrypted, the master key to be updated is obtained, and the master key to be updated is written to the terminal.
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal, thereby realizing the remote update of the terminal master key, so that updating the master key is fast and convenient;
  • the background system encrypts the update master key by using the current master key, preventing the background system from being leaked when the background system sends the terminal master key to the server, thereby improving the security of updating the terminal master key;
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if they are stolen, the real terminal master key cannot be obtained, and the stealing or destruction cannot be performed, thereby further improving the security of updating the terminal master key. Sex.
  • the identifier to be updated of the terminal includes a terminal number to be updated and a terminal number to be updated;
  • the original identifier of the terminal includes an original merchant number and an original terminal number of the terminal; wherein the merchant number to be updated and The original merchant numbers are the same or different;
  • the terminal number to be updated is the same as or different from the original terminal number.
  • the background system before receiving the update master key request sent by the terminal, further includes: the background system receiving the initialization master key request sent by the terminal; receiving the original identifier of the terminal sent by the terminal; wherein the initializing the master key request includes The initialization identifier and the public key of the terminal; the background system determines the initialization master key corresponding to the initialization identifier of the terminal according to the preset relationship between the identifier of the terminal and the master key; the background system generates the first key; The key encrypts the first key, and sends the obtained encrypted first key to the terminal; the background system encrypts the initialization master key by using the first key, and sends the encrypted initialization master key to the terminal.
  • the encrypted initialization master key is used to enable the terminal to decrypt the encrypted first key by using the private key to obtain the first key, and then decrypt the encrypted initialization master key by using the first key. Get the initialization master key.
  • the first key is a random key.
  • the background system determines, according to the preset relationship between the identifier of the terminal and the master key, the initialization master key corresponding to the initialization identifier of the terminal, and further includes: a background system
  • the manufacturer preset identifier corresponding to the original identifier of the terminal is determined according to the correspondence between the preset terminal identifier and the manufacturer preset identifier.
  • the embodiment of the present invention provides a method for setting a terminal master key, where the method includes: the terminal sends an update master key request to the background system; the current identifier of the sending terminal; wherein the update master key request includes the terminal The terminal to be updated; the terminal receives the master key to be updated after being encrypted by the current master key, and the current master key is determined by the background system according to the preset relationship between the identifier of the terminal and the master key.
  • the master key corresponding to the current identifier; the master key to be updated is the master key corresponding to the identifier to be updated determined by the background system according to the preset relationship between the identifier of the terminal and the master key; the terminal uses the current master key pair
  • the encrypted master key to be updated is decrypted, the master key to be updated is obtained, and the master key to be updated is replaced with the current master key.
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal, thereby realizing the remote update of the terminal master key, so that updating the master key is fast and convenient;
  • the background system encrypts the update master key by using the current master key, preventing the background system from being leaked when the background system sends the terminal master key to the server, thereby improving the security of updating the terminal master key;
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if they are stolen, the real terminal master key cannot be obtained, and the stealing or destruction cannot be performed, thereby further improving the security of updating the terminal master key. Sex.
  • the method further includes: the terminal sending an initialization master key request to the background system; transmitting the original identifier of the terminal; wherein the initializing the master key request includes initializing the terminal The identifier and the public key; the terminal receives the first key encrypted by the background system and encrypted by using the public key; the terminal receives the initialization master key encrypted by the background system and encrypted by using the first key; and the terminal uses the private key pair to encrypt the first key A key is decrypted to obtain a first key; the terminal decrypts the encrypted initial master key using the first key to obtain an initial master key.
  • the first key is a random key.
  • the initializing the master key is performed by the background system according to the preset relationship between the preset terminal identifier and the manufacturer preset identifier, and determining that the manufacturer preset identifier corresponding to the original identifier of the terminal exists, according to the preset terminal
  • the correspondence between the identifier and the master key determines the master key corresponding to the initialization identifier.
  • an embodiment of the present invention provides an electronic device, including: a processor, a memory, a transceiver, and a communication interface, wherein a processor, a memory, a transceiver, and a communication interface are connected by a bus;
  • the processor is configured to read a program in the memory, and execute the following method: receiving an update master key request sent by the terminal; receiving a current identifier of the terminal sent by the terminal; wherein the updating the primary key
  • the key request includes the identifier of the terminal to be updated; according to the identifier of the preset terminal Corresponding relationship with the master key, determining the master key to be updated corresponding to the identifier to be updated of the terminal, and the current master key corresponding to the current identifier; using the current master key to encrypt the master key to be encrypted, Transmitting the encrypted master key to be updated to the terminal; wherein the encrypted master key to be updated is used to enable the terminal to use the current master key pair to the encrypted host to be updated
  • the key is decrypted, the master key to be updated is obtained, and the master key to be updated is written into the terminal.
  • the memory is configured to store one or more executable programs, and may store data used by the processor when performing operations;
  • the transceiver is configured to receive an update master key request sent by the terminal under the control of the processor, and receive a current identifier of the terminal sent by the terminal.
  • an embodiment of the present invention provides an electronic device, including: a processor, a memory, a transceiver, and a communication interface, wherein a processor, a memory, a transceiver, and a communication interface are connected by a bus;
  • the processor is configured to read a program in the memory, and perform the following method: using the current master key to decrypt the encrypted master key to be updated, to obtain the master key to be updated, and Substituting the to-be-updated master key with the current master key;
  • the memory is configured to store one or more executable programs, and may store data used by the processor when performing operations;
  • the transceiver is configured to send an update master key request to the background system under the control of the processor, and send the current identifier of the terminal, where the update master key request includes the terminal to be updated. And receiving, by the background system, a master key to be updated, which is encrypted by using a current master key, where the current master key is a correspondence between the identifier of the terminal and the master key by the background system according to the preset Determining a master key corresponding to the current identifier; the master key to be updated is a master corresponding to the to-be-updated identifier determined by the background system according to a preset correspondence between the identifier of the terminal and the master key Key.
  • the embodiment of the present application provides a background system, which is used to implement any one of the foregoing first aspect or the first aspect, and includes a corresponding functional module, which is used to implement the steps in the foregoing method.
  • the embodiment of the present application provides a terminal, the method for implementing any one of the foregoing second aspect or the second aspect, including a corresponding functional module, which is used to implement the steps in the foregoing method.
  • an embodiment of the present application provides a non-transitory computer readable storage medium, where a computer storage medium stores instructions that, when run on a computer, cause the computer to perform any of the first aspect or the first aspect.
  • an embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method in the first aspect or any possible implementation manner of the first aspect, or cause the computer to execute The method of any of the second aspect or any possible implementation of the second aspect.
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal, thereby realizing the remote update of the terminal master key, so that updating the master key is fast and convenient;
  • the background system encrypts the update master key by using the current master key, preventing the background system from being leaked when the background system sends the terminal master key to the server, thereby improving the security of updating the terminal master key;
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if they are stolen, the real terminal master key cannot be obtained, and the stealing or destruction cannot be performed, thereby further improving the security of updating the terminal master key. Sex.
  • FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for setting a terminal master key according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a background system according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram showing the architecture of a communication system to which an embodiment of the present invention is applied.
  • the system architecture may include a background system 101 and a terminal 102.
  • the background system 101 may include a server 103 and an encryption machine 104.
  • the terminal 102 may include a terminal client 105, a PIN pad 106, and a terminal and background system.
  • the connection can be made wirelessly or by wire, thereby realizing the remote information interaction between the background system and the terminal.
  • the terminal client in the terminal is connected to the PIN pad through the circuit board, and the server in the background system is connected to the confidential machine through the local area network.
  • the server 103 stores resources that the terminal needs to access.
  • the server may be a network device for communicating with the terminal device, and may invoke an encryption machine for encryption and decryption calculation.
  • the encryption machine 104 belongs to a dedicated device for encrypting and decrypting information; storing a master key.
  • the terminal 102 can communicate with one or more core networks via a Radio Access Network (RAN), and the terminal can be a smart POS terminal.
  • RAN Radio Access Network
  • the terminal client 105 runs on top of the POS terminal and can invoke a password interface for encryption and solution.
  • the secret calculation can update the terminal master key and establish communication with the background system.
  • the PIN pad 106 is installed on the POS terminal through the circuit board for storing the terminal master key; used to protect the process key in the transaction; for decrypting the terminal master key received by the POS terminal, and using the new primary key
  • the key replaces the original master key; the Data Encryption Standard (DES) algorithm, the Message Authentication Codes (MAC) algorithm, and the PINBLOCK operation can be pre-installed.
  • DES Data Encryption Standard
  • MAC Message Authentication Codes
  • the user-selectable National Password Management Committee encrypts the chip.
  • the management program uses the simplest terminal to implement key management to prevent the key from being stolen during the setting process.
  • the key is stored internally in an encrypted manner. No key path is provided. The key and related important data are automatically removed when forcibly disassembled. destroy. It is guaranteed that the password online transmission is performed in cipher text.
  • FIG. 2 is a schematic flowchart showing a method for setting a terminal master key according to an embodiment of the present invention. As shown in FIG. 2, the method for setting the terminal master key includes the following: step:
  • Step 201 The terminal sends an update master key request to the background system, and sends a current identifier of the terminal.
  • the update master key request includes the identifier of the terminal to be updated.
  • Step 202 The background system receives the update master key request sent by the terminal, and receives the current identifier of the terminal sent by the terminal.
  • Step 203 The background system determines, according to the preset relationship between the identifier of the terminal and the master key, the master key to be updated corresponding to the identifier to be updated of the terminal, and the current master key corresponding to the current identifier.
  • Step 204 The background system encrypts the updated master key by using the current master key.
  • step 205 the encrypted master key to be updated is sent to the terminal.
  • the encrypted master key to be updated is used to decrypt the encrypted master key to be updated by using the current master key. Update the master key and replace the current master key with the current master key;
  • Step 206 The terminal receives the to-be-updated master key that is sent by the background system and is encrypted by using the current master key.
  • the current master key is determined by the background system according to the preset relationship between the identifier of the terminal and the master key. Identify the corresponding master key; the master key to be updated is the background system according to the preset end The master key corresponding to the identifier to be updated is determined by the correspondence between the identifier of the terminal and the master key;
  • Step 207 The terminal decrypts the encrypted master key to be updated by using the current master key, obtains the master key to be updated, and writes the master key to be updated to the terminal.
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal, thereby realizing the remote update of the terminal master key, so that updating the master key is fast and convenient;
  • the background system encrypts the update master key by using the current master key, preventing the background system from being leaked when the background system sends the terminal master key to the server, thereby improving the security of updating the terminal master key;
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if stolen, the page cannot obtain the real terminal master key, and cannot be stolen or destroyed, thereby further improving the security of updating the terminal master key. Sex.
  • the identifier of the terminal includes a terminal number and a merchant number; the terminal number and the merchant number can uniquely identify the terminal, and one terminal number and one merchant number correspond to one terminal master key; the terminal is to be updated.
  • the identifier includes a terminal number to be updated and a merchant number to be updated; the current identifier of the terminal includes a current terminal number and a current merchant number; wherein the terminal number to be updated is the same as or different from the current terminal number, and the updated merchant number and the current merchant number may be the same. Or not the same.
  • the terminal before the terminal sends the update master key request to the background system, the terminal establishes a two-way secure authentication channel with the background system.
  • the process of establishing a two-way authentication security channel the terminal sends a security authentication request to the background system, and the background system sends the security authentication information to the terminal after receiving the security authentication request, where the security real person information includes a background system identifier;
  • the terminal performs security authentication on the background system according to the security authentication information received from the background system; if the authentication fails, the terminal disconnects the connection between the terminal and the background; if the authentication passes, the terminal sends the security authentication information to the background system, where
  • the security information includes the identifier of the terminal, and the background system performs security authentication on the terminal according to the security authentication information received from the terminal; if the authentication fails, the terminal and the background system are disconnected.
  • connection between the two if passed, it indicates that a secure mutual authentication channel is established.
  • a two-way secure authentication channel connection between the terminal and the client such as a Secure Socket Layer (SSL)/Transport Layer Security Protocol (TLS), is ensured on the communication link.
  • SSL Secure Socket Layer
  • TLS Transport Layer Security Protocol
  • the terminal can be placed at the remote end of the backend system or at the short end of the backend system.
  • the back-end system can be deployed in a trusted certification authority, such as a specialized service organization or acquirer of a financial POS acquiring service.
  • the back-end system can remotely update the terminal master key, thereby avoiding the manual use of the parent POS.
  • the terminal updates the terminal master key, which greatly shortens the deployment period of the terminal, reduces the labor cost of the terminal deployment, and is beneficial to the promotion and development of the intelligent POS terminal, thereby promoting the development of the financial POS industry.
  • the terminal sends the current identifier of the terminal to the background system, and sends the current identifier in the process of establishing the two-way secure authentication channel.
  • the current identifier of the terminal may also be carried in the update master key request.
  • the two-way secure authentication channel acquisition can also be obtained through the received request for updating the master key.
  • the background system determines, according to the preset relationship between the identifier of the terminal and the master key, the current master key corresponding to the current identifier, and the corresponding identifier to be updated.
  • the master key to be updated.
  • the background server determines that the current master key or the to-be-updated master key does not exist, and the background server sends a non-existent response to the terminal; if it is determined that the current master key and the to-be-updated master key are both present, , the background server sends the current master key and the master key to be updated to the encryption machine.
  • the terminal invokes the password keyboard to decrypt, that is, decrypts the current master using the current master key in the password keyboard.
  • the master key to be updated by the key encryption obtains the master key to be updated, and writes the master key to be updated to the terminal to replace the current master key;
  • the plaintext of the terminal master key includes: the master key to be updated and the current master key The key does not appear anywhere outside the PIN pad and the encryption machine, thereby improving the security of the terminal master key update method.
  • the method further includes: the terminal sending an initialization master key request to the background system; transmitting the original identifier of the terminal; wherein the initializing the master key request includes initializing the terminal The identifier and the public key; the terminal receives the first key encrypted by the background system and encrypted by using the public key; the terminal receives the initialization master key encrypted by the background system and encrypted by using the first key; and the terminal uses the private key pair to encrypt the first key A key is decrypted to obtain a first key; the terminal decrypts the encrypted initial master key using the first key to obtain an initial master key.
  • the background system before receiving the update master key request sent by the terminal, the background system further includes: the background system receiving the initialization master key request sent by the terminal; receiving the original identifier of the terminal sent by the terminal; wherein, initializing the master key
  • the request includes the initialization identifier and the public key of the terminal; the background system determines the initialization master key corresponding to the initialization identifier of the terminal according to the preset relationship between the identifier of the terminal and the master key; the background system generates the first key;
  • the system encrypts the first key by using the public key, and sends the obtained encrypted first key to the terminal; the background system encrypts the initialization master key by using the first key, and the encrypted initial key is obtained.
  • the encrypted initialization master key is used to enable the terminal to decrypt the encrypted first key using the private key to obtain the first key, and then use the first key pair to initialize the encrypted initial key Decryption is performed to obtain an initialization master key, and the initialization master key is written to the terminal.
  • the terminal sends the original identifier of the terminal to the background system, which may be sent through the two-way authentication security channel, or may be sent by the original identifier in the initialization request; therefore, the background system obtains the original identifier through the received initialization request. It can also be obtained by establishing a two-way secure authentication channel.
  • the client of the terminal invokes the cryptographic keyboard interface to generate an asymmetric process key, and saves the private key in the asymmetric process key in the cryptographic keyboard, and the terminal client
  • the public key is invoked and the public key is carried in the initial request; optionally, the original identifier is an identifier preset by the manufacturer, and the background system determines that the obtained original identifier is the identifier preset by the manufacturer.
  • the terminal performs the process of initializing the master key.
  • the first key is a random key.
  • the server in the background system determines the terminal master key corresponding to the initialization identifier of the terminal, and invokes the encryption machine in the background system to generate a random key, where the original identifier is determined by the manufacturer.
  • the random key may be a temporary terminal master key, and the temporary terminal master key and the master key are encrypted by using the same algorithm, and the temporary terminal master key is encrypted by using the public key to obtain the encrypted temporary terminal primary key.
  • the key is used to encrypt the initialization terminal master key using the temporary terminal master key to obtain the encrypted initialization terminal master key.
  • the terminal client decrypts the password by using the password keyboard, and uses the private key in the password interface. Decrypting the temporary terminal master key encrypted with the public key, obtaining the temporary terminal master key, and decrypting the initialization terminal master key encrypted by using the temporary terminal master key using the temporary terminal master key to obtain the initial terminal master key.
  • the obtained initialization terminal master key is written to the cryptographic keyboard. Encryption and decryption through an asymmetric process key greatly improves the security of the initial terminal master key.
  • the security of the initialization terminal master key can be further improved, the temporary terminal master key is used to encrypt and initialize the terminal master key, and the public key encrypts the temporary terminal master key; moreover, the plaintext of the terminal master key does not appear.
  • the background system is prevented from being leaked when the terminal system sends the terminal master key to the server, thereby improving the security of updating the terminal master key; and, due to the current terminal master Both the key and the terminal key to be updated It is a ciphertext. Even if it is stolen, it cannot obtain a real terminal master key, and cannot be stolen or destroyed, further improving the security of updating the terminal master key.
  • the background system determines, according to the preset relationship between the identifier of the terminal and the master key, the initialization master key corresponding to the initialization identifier of the terminal, and further includes: a background system
  • the manufacturer preset identifier corresponding to the original identifier of the terminal is determined according to the correspondence between the preset terminal identifier and the manufacturer preset identifier.
  • the initializing the master key is determined by the background system according to the preset relationship between the preset terminal identifier and the manufacturer preset identifier, and determining that the manufacturer preset identifier corresponding to the original identifier of the terminal exists, according to the preset
  • the correspondence between the identifier of the terminal and the master key determines the master key corresponding to the initialization identifier.
  • the manufacturer usually presets the identifier, and the default terminal master key is written into the password keyboard. Initially, the initialization of the terminal master key in the password keyboard is initialized using the default terminal master key.
  • the original identifier of the terminal includes an original terminal number and an original merchant number.
  • the background system determines that the original identifier is an identifier preset by the manufacturer, the terminal master key is allowed to be initialized, thereby ensuring the security of the terminal, and facilitating accountability when the subsequent terminal has a security problem. .
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal, thereby realizing remote update of the terminal master master key, so that the update master key is updated.
  • the key is fast and convenient; further, the background system encrypts the updated master key by using the current master key during the update process, preventing the background system from being leaked when the background system sends the terminal master key to the server, and the update terminal is improved.
  • Master key security; and, due to current Both the terminal master key and the terminal key to be updated are cipher texts. Even if the terminal is stolen, the page cannot obtain the real terminal master key and cannot be stolen or destroyed, thereby further improving the security of updating the terminal master key.
  • FIG. 3 is a schematic structural diagram of a background system according to an embodiment of the present invention.
  • the embodiment of the present invention provides a background system.
  • the background system 300 includes a receiving unit 301 and a processing unit 302. among them:
  • a receiving unit configured to receive an update master key request sent by the terminal, and receive a current identifier of the terminal sent by the terminal, where the update master key request includes the identifier of the terminal to be updated;
  • the processing unit determines, according to the preset relationship between the identifier of the terminal and the master key, the master key to be updated corresponding to the identifier to be updated of the terminal, and the current master key corresponding to the current identifier; and the current master key is used to update
  • the master key is encrypted, and the encrypted master key to be updated is sent to the terminal; wherein the encrypted master key to be updated is used to enable the terminal to decrypt the encrypted master key to be updated by using the current master key.
  • the master key to be updated is obtained, and the master key to be updated is written to the terminal.
  • the receiving unit is further configured to: receive an initialization master key request sent by the terminal; and receive an original identifier of the terminal sent by the terminal; where the initializing the master key request includes the initialization identifier and the public key of the terminal;
  • the processing unit is configured to: determine, according to a preset relationship between the identifier of the terminal and the master key, an initialization master key corresponding to the initialization identifier of the terminal; generate a first key; use the public key to the first key Encrypting, sending the obtained encrypted first key to the terminal; encrypting the initializing master key by using the first key, and transmitting the encrypted initializing master key to the terminal; wherein the encrypted initializing master The key is used to enable the terminal to decrypt the encrypted first key by using the private key to obtain the first key, and then decrypt the encrypted initializing key by using the first key to obtain an initializing master key.
  • the first key is a random key.
  • the processing unit is further configured to: determine, according to the correspondence between the preset terminal identifier and the manufacturer preset identifier, the manufacturer preset identifier corresponding to the original identifier of the terminal.
  • FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the terminal 400 includes a sending unit 401, a receiving unit 402, and a processing unit 403. among them:
  • a sending unit configured to send an update master key request to the background system; and send a current identifier of the terminal; where the update master key request includes the identifier of the terminal to be updated;
  • a receiving unit configured to receive a to-be-updated master key that is sent by the background system and is encrypted by using the current master key; where the current master key is determined by the background system according to the preset relationship between the identifier of the terminal and the master key.
  • the master key corresponding to the current identifier; the master key to be updated is a master key corresponding to the identifier to be updated determined by the background system according to the preset relationship between the identifier of the terminal and the master key;
  • a processing unit configured to decrypt the encrypted master key to be updated by using the current master key, obtain a master key to be updated, and replace the current master key with the current master key.
  • the sending unit is further configured to: send an initialization master key request to the background system; and send the original identifier of the terminal; where the initializing the master key request includes the initialization identifier and the public key of the terminal;
  • the receiving unit is configured to: receive a first key that is sent by the backend system and is encrypted by using a public key; and receive an initializing key that is sent by the backend system and encrypted by using the first key;
  • the processing unit is configured to: decrypt the encrypted first key by using a private key to obtain a first key; and decrypt the encrypted initializing key by using the first key to obtain an initializing master key.
  • the first key is a random key.
  • the initializing the master key is performed by the background system according to the preset relationship between the preset terminal identifier and the manufacturer preset identifier, and determining that the manufacturer preset identifier corresponding to the original identifier of the terminal exists, according to the preset terminal
  • the correspondence between the identifier and the master key determines the master key corresponding to the initialization identifier.
  • the background system updates the master key of the terminal according to the update master key request sent by the terminal in the embodiment of the present invention, thereby realizing Remotely updating the terminal master master key makes the update master key quick and convenient.
  • the background system encrypts the master key by using the current master key to prevent the background system from transmitting the terminal master key to the server.
  • the master key to be updated is leaked, and the security of the terminal key is updated.
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if stolen, the page cannot obtain the real terminal master. The key cannot be stolen or destroyed, which further improves the security of updating the terminal master key.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by the present application.
  • the electronic device includes a processor 501, a memory 502, a transceiver 503, and a communication interface 504; wherein the processor 501, the memory 502, the transceiver 503, and the communication interface 504 are connected to one another via a bus 505.
  • the bus 505 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 5, but it does not mean that there is only one bus or one type of bus.
  • the memory 502 may include a volatile memory such as a random-access memory (RAM); the memory may also include a non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 502 may also include a combination of the above types of memory.
  • RAM random-access memory
  • flash flash memory
  • HDD hard disk drive
  • SSD solid-state drive
  • the communication interface 504 can be a wired communication access port, a wireless communication interface, or a combination thereof, wherein the wired communication interface can be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless communication interface can be a WLAN interface.
  • the processor 501 can be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP.
  • CPU central processing unit
  • NP network processor
  • the processor 501 may further include a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination.
  • the processor 501 is configured to read a program in the memory 502, and execute the following method: receiving an update master key request sent by the terminal; receiving a current identifier of the terminal sent by the terminal; wherein the update The master key request includes the to-be-updated identifier of the terminal, and the host key to be updated corresponding to the to-be-updated identifier of the terminal is determined according to the preset relationship between the identifier of the terminal and the master key, and the current Identifying the current master key; using the current master key to encrypt the master key, and sending the encrypted master key to be updated to the terminal; wherein the encrypted master key to be updated is used And causing the terminal to decrypt the encrypted master key to be updated by using the current master key to obtain the master key to be updated, and writing the master key to be updated to the terminal.
  • the memory 502 is configured to store one or more executable programs, and may store data used by the processor 501 when performing operations;
  • the transceiver 503 is configured to receive an update master key request sent by the terminal under the control of the processor 501, and receive a current identifier of the terminal sent by the terminal.
  • the transceiver is further configured to: receive an initialization master key request sent by the terminal; and receive an original identifier of the terminal sent by the terminal, where the initialization master key request includes an initialization identifier and a public key of the terminal;
  • the processor is configured to: determine, according to a preset correspondence between a terminal identifier and a master key, Initializing the master key corresponding to the initialization identifier of the terminal; generating the first key; encrypting the first key by using the public key, and transmitting the obtained encrypted first key to the terminal; initializing using the first key pair
  • the master key is encrypted, and the encrypted initialization master key is sent to the terminal; wherein the encrypted initialization master key is used to enable the terminal to decrypt the encrypted first key using the private key to obtain the first key. After that, the encrypted initial master key is decrypted using the first key to obtain an initialized master key.
  • the first key is a random key.
  • the processor is further configured to: determine, according to a preset relationship between the preset terminal identifier and the manufacturer preset identifier, a manufacturer preset identifier corresponding to the original identifier of the terminal.
  • the receiving unit 301 can be implemented by a transceiver
  • the processing unit 302 can be implemented by a processor.
  • the electronic device 500 can include a processor 501, a transceiver 503, and a memory 502.
  • the memory 502 can be used to store a program/code pre-installed at the time of shipment of the electronic device 500, and can also store a code or the like for execution of the processor 501.
  • FIG. 6 is a schematic structural diagram of another electronic device provided by the present application.
  • the electronic device includes a processor 601, a memory 602, a transceiver 603, and a communication interface 604; wherein the processor 601, the memory 602, the transceiver 603, and the communication interface 604 are connected to each other through a bus 605.
  • the bus 605 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 6, but it does not mean that there is only one bus or one type of bus.
  • the memory 602 may include a volatile memory such as a random-access memory (RAM); the memory may also include a non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 602 may also include a combination of the above types of memory.
  • RAM random-access memory
  • non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 602 may also include a combination of the above types of memory.
  • the communication interface 604 can be a wired communication access port, a wireless communication interface, or a combination thereof, wherein the wired communication interface can be, for example, an Ethernet interface.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless communication interface can be a WLAN interface.
  • the processor 601 can be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and an NP.
  • CPU central processing unit
  • NP network processor
  • the processor 601 may further include a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination.
  • the processor 601 is configured to decrypt the encrypted master key to be updated by using the current master key, obtain a master key to be updated, and replace the master key to be updated with the current master key.
  • the memory 602 is configured to store one or more executable programs, and may store data used by the processor 601 when performing operations.
  • the transceiver 603 is configured to send an update master key request to the background system; the current identifier of the sending terminal; wherein the update master key request includes the identifier of the terminal to be updated; and the receiving backend system sends the encryption using the current master key.
  • the master key to be updated is a master key corresponding to the to-be-updated identifier determined by the background system according to the preset relationship between the identifier of the terminal and the master key.
  • the transceiver is further configured to: send an initialization master key request to the background system; send the original identifier of the terminal; receive the first key that is sent by the background system and is encrypted by using the public key; and receive the sent by the background system.
  • the first key is a random key.
  • the initializing the master key is performed by the background system according to the preset relationship between the preset terminal identifier and the manufacturer preset identifier, and determining that the manufacturer preset identifier corresponding to the original identifier of the terminal exists, according to the preset terminal
  • the correspondence between the identifier and the master key determines the master key corresponding to the initialization identifier.
  • the sending unit 401 and the receiving unit 402 are both implemented by the transceiver 603, and the processing unit 403 can be implemented by the processor 601.
  • the electronic device 600 can include a processor 601, a memory 602, and a transceiver 603.
  • the memory 602 can be used to store the code when the processor 601 executes the solution, and the code can be a program/code pre-installed when the electronic device 600 is shipped.
  • the background system updates the master key of the terminal according to the updated master key request sent by the terminal in the embodiment of the present invention, thereby realizing the remote updating of the terminal master key.
  • the key makes the update of the master key fast and convenient.
  • the background system encrypts the update master key by using the current master key, preventing the background system from being updated when the terminal master key is sent to the server. Leaking, improving the security of updating the terminal master key;
  • the current terminal master key and the terminal key to be updated are both ciphertexts, even if stolen, the page cannot obtain the real terminal master key, and cannot be stolen or destroyed, thereby further improving the security of updating the terminal master key. Sex.
  • embodiments of the present invention can be provided as a method, or a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • a computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种终端主密钥的设置方法和装置,后台系统接收终端发送的更新主密钥请求;接收终端发送的终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;后台系统根据预设的终端的标识和主密钥的对应关系,确定出终端的待更新标识对应的待更新主密钥,以及当前标识对应的当前主密钥;后台系统使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给终端;其中,加密后的待更新主密钥用于使终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥写入终端;提高了更新终端主密钥的安全性。

Description

一种终端主密钥的设置方法和装置
本申请要求在2016年11月15日提交中国专利局、申请号为201611006175.9、发明名称为“一种终端主密钥的设置方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及网络认证领域,尤其涉及一种终端主密钥的设置方法和装置。
背景技术
在现有技术中,由于销售点(Point of sales,简称POS)终端安全、便捷的特点,受到用户、商家、银行的青睐,为了确保交易过程的安全性,每台POS终端拥有唯一的终端主密钥;当使用POS终端工作时,需要终端主密钥对工作密钥进行加密,确保信息交互过程信息的安全。因此,当POS终端在布放前,需要由专业化服务机构或收单机构需将每台POS终端对应的密码键盘拿到安全的区域,可以采用专用集成电路(Integrated Circuit,简称IC)芯片或使用母POS将终端主密钥灌入POS终端的密码键盘中;而且,当需要对POS终端的终端主密钥进行更新时,也需要专业化服务机构或收单机构将该台POS终端对应的密码键盘拿到安全的区域,采用专用集成电路(Integrated Circuit,简称IC)芯片或使用母POS往待更新的POS终端的密码键盘中重新灌入待更新的终端主密钥。
由于在现有技术中POS终端主密钥的初始化和更新需要花费购买母POS的成本;且在POS终端布放前或POS终端需要更新终端主密钥时,需要由专业化服务机构或收单机构手动将密码键盘拿到安全的区域,使用母POS往POS终端的密码键盘灌入终端主密钥,整个过程周期较长、增加运输成本、 并需要投入相应的人力。
综上,亟需一种终端主密钥的更新方案,用于安全、便捷地设置终端主密钥。
发明内容
本发明实施例提供了一种终端主密钥的设置方法和装置,用于提高设置终端主密钥的安全性和便捷性。
第一方面,本发明实施例提供一种终端主密钥的设置方法,该方法包括:后台系统接收终端发送的更新主密钥请求;接收终端发送的终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;后台系统根据预设的终端的标识和主密钥的对应关系,确定出终端的待更新标识对应的待更新主密钥,以及当前标识对应的当前主密钥;后台系统使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给终端;其中,加密后的待更新主密钥用于使终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥写入终端。
由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,也无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
可选地,终端的待更新标识包括终端待更新商户号和待更新终端号;终端的原始标识包括终端的原始商户号和原始终端号;其中,待更新商户号和 原始商户号相同或不同;待更新终端号和原始终端号相同或不同。
可选地,后台系统接收终端发送的更新主密钥请求之前,还包括:后台系统接收终端发送的初始化主密钥请求;接收终端发送的终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;后台系统根据预设的终端的标识和主密钥的对应关系,确定出终端的初始化标识对应的初始化主密钥;后台系统产生第一密钥;后台系统使用公钥对第一密钥进行加密,将得到的加密后的第一密钥发送给终端;后台系统使用第一密钥对初始化主密钥进行加密,将得到加密后的初始化主密钥发送给终端;其中,加密后的初始化主密钥用于使终端使用私钥对加密后的第一密钥进行解密得到第一密钥后,使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,后台系统接收终端发送的初始化主密钥请求之后,根据预设的终端的标识和主密钥的对应关系确定出终端的初始化标识对应的初始化主密钥之前,还包括:后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识。
第二方面,本发明实施例提供一种终端主密钥的设置方法,该方法包括:终端向后台系统发送更新主密钥请求;发送终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;终端接收后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,当前主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的当前标识对应的主密钥;待更新主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的待更新标识对应的主密钥;终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥替换当前主密钥。
由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,也无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
可选地,终端向后台系统发送更新主密钥请求后台系统之前,还包括:终端向后台系统发送初始化主密钥请求;发送终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;终端接收后台系统发送的使用公钥加密后的第一密钥;终端接收后台系统发送的使用第一密钥加密后的初始化主密钥;终端使用私钥对加密后的第一密钥进行解密得到第一密钥;终端使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,初始化主密钥为后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的初始化标识对应的主密钥。
第三方面,本发明实施例中提供可一种电子设备,包括:处理器、存储器、收发器和通信接口,其中,处理器、存储器、收发器和通信接口之间通过总线连接;
所述处理器,用于读取所述存储器中的程序,执行下列方法:接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;根据预设的终端的标识 和主密钥的对应关系,确定出所述终端的待更新标识对应的待更新主密钥,以及所述当前标识对应的当前主密钥;使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给所述终端;其中,所述加密后的待更新主密钥用于使所述终端使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥写入所述终端。
所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据;
所述收发器,用于在所述处理器的控制下接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识。
第四方面,本发明实施例中提供可一种电子设备,包括:处理器、存储器、收发器和通信接口,其中,处理器、存储器、收发器和通信接口之间通过总线连接;
所述处理器,用于读取所述存储器中的程序,执行下列方法使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥替换所述当前主密钥;
所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据;
所述收发器,用于在所述处理器的控制下向后台系统发送更新主密钥请求;发送所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;接收所述后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,所述当前主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述当前标识对应的主密钥;所述待更新主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述待更新标识对应的主密钥。
第五方面,本申请实施例提供一种后台系统,用于实现上述第一方面或第一方面中的任意一种方法,包括相应的功能模块,分别用于实现以上方法中的步骤。
第六方面,本申请实施例提供一种终端,用于实现上述第二方面或第二方面中的任意一种的方法,包括相应的功能模块,分别用于实现以上方法中的步骤。
第七方面,本申请实施例提供一种非暂态计算机可读存储介质,计算机存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面或第一方面的任意可能的实现方式中的方法,或者使得计算机执行第二方面或第二方面的任意可能的实现方式中的方法。
第八方面,本申请实施例提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面或第一方面的任意可能的实现方式中的方法,或者使得计算机执行第二方面或第二方面的任意可能的实现方式中的方法。
由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,也无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种通信系统的架构示意图;
图2为本发明实施例提供的一种终端主密钥的设置方法流程示意图;
图3为本发明实施例提供的一种后台系统的结构示意图;
图4为本发明实施例提供的一种终端的结构示意图;
图5为本发明实施例提供的一种电子设备的结构示意图;
图6为本发明实施例提供的另一种电子设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
图1示出了应用本发明实施例的一种通信系统的架构示意图。如图1所示,该系统架构可以包括后台系统101、终端102;其中,后台系统101可以包括服务器103,加密机104;终端102可以包括终端客户端105,密码键盘106;终端与后台系统之间可通过无线或有线的方式进行连接,进而实现了后台系统与终端之间的远程信息交互。终端中的终端客户端与密码键盘通过电路板连接,后台系统中的服务器与机密机通过局域网连接。
服务器103存储有终端需要访问的资源。服务器可以是用于与终端设备进行通信的网络设备,可以调用加密机进行加密、解密计算。
加密机104属于专用设备,用于对信息进行加密、解密计算;存储主密钥。终端102可以经无线接入网(Radio Access Network,简称RAN)与一个或多个核心网进行通信,终端可以为智能POS终端。
终端客户端105运行与POS终端之上,能够调用密码接盘进行加密、解 密计算,可以更新终端主密钥,可以与后台系统建立通信。
密码键盘106通过电路板安装在POS终端上,用于保存终端主密钥;用来保护交易中的过程密钥;用于对POS终端接收到的终端主密钥进行解密,并用新的主密钥替换原来的主密钥;可以预装数据加密标准(Data Encryption Standard,简称DES)算法、(Message Authentication Codes,简称MAC)算法、PINBLOCK运算,用户可选国家密码管理委员会加密芯片内含密钥管理程序,用最简单的终端实现密钥管理,防止密钥在设置过程中被窃取密钥在内部采用加密方式存放,不提供任何密钥问路径,强行拆卸时密钥和相关重要数据会自动销毁。保证了密码在线传输都是以密文的方式进行。
基于图1所示的系统架构,图2示例性示出了本发明实施例提供的一种终端主密钥的设置方法流程示意图,如图2所示,该终端主密钥的设置方法包括以下步骤:
步骤201,终端向后台系统发送更新主密钥请求;发送终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;
步骤202,后台系统接收终端发送的更新主密钥请求;接收终端发送的终端的当前标识;
步骤203,后台系统根据预设的终端的标识和主密钥的对应关系,确定出终端的待更新标识对应的待更新主密钥,以及当前标识对应的当前主密钥;
步骤204,后台系统使用当前主密钥对待更新主密钥进行加密;
步骤205,将得到加密后的待更新主密钥发送给终端;其中,加密后的待更新主密钥用于使终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥替换当前主密钥;
步骤206,终端接收后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,当前主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的当前标识对应的主密钥;待更新主密钥为后台系统根据预设的终 端的标识和主密钥的对应关系确定出的待更新标识对应的主密钥;
步骤207,终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥写入终端。
由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,页无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
可选地,本发明实施例中,终端的标识包括终端号和商户号;终端号和商户号能唯一的标识该终端,一个终端号和一个商户号对应一个终端主密钥;终端的待更新标识包括待更新终端号和待更新商户号;终端的当前标识包括当前终端号和当前商户号;其中,待更新终端号和当前终端号相同或者不相同,待更新商户号和当前商户号可以相同或者不相同。
可选地,终端向后台系统发送更新主密钥请求之前,终端与后台系统建立双向安全认证通道。可选地,双向认证安全通道的建立过程:终端向后台系统发送安全认证请求,后台系统在接收到该安全认证请求后,向终端发送安全认证信息,其中,该安全真人信息包括后台系统标识;终端根据从后台系统接收的安全认证信息对后台系统进行安全认证;如果认证未通过,则断开终端和后台之间的连接;如果认证通过,则终端向后台系统发送安全认证信息,其中,该安全信息包括终端的标识,后台系统根据从终端接收的安全认证信息对终端进行安全认证;如果认证未通过,则断开终端和后台系统之 间的连接;如果通过,表明建立了安全双向认证通道。可选地,终端与客户端之间的双向安全认证通道连接,如安全套层协议(Secure Socket Layer,简称SSL)/安全传输层(Transport Layer Security Protocol,简称TLS),进而确保在通信链路上保证传输的数据的完整性和安全性,进而,进一步提高了更新终端主密钥的安全性。
可选地,终端可置于后台系统的远程端,也可置于后台系统的近程端。后台系统可部署在可信的认证机构内,如金融POS收单服务的专业化服务机构或收单机构,如此,后台系统可远程更新终端主密钥,进而避免了通过手动的方式使用母POS终端更新终端主密钥,极大的缩短了终端的布放周期,降低了终端布放的人力成本,有利于智能POS终端的推广与发展,从而推动金融POS行业的发展。
可选地,终端向后台系统发送终端的当前标识,在建立双向安全认证通道的过程中发送;也可以将终端的当前的标识携带在更新主密钥请求中;所以后台系统获取当前标识可以通过双向安全认证通道获取,也可以通过接收到的更新主密钥的请求中获取。
可选地,后台系统接收到终端的当前标识和待更新标识后,根据预设的终端的标识与主密钥的对应的关系,确定出当前标识对应的当前主密钥,待更新标识对应的待更新主密钥。可选地,后台服务器在确定当前主密钥或待更新主密钥至少一个不存在,则后台服务器向终端发送不存在响应;在确定当前主密钥和待更新主密钥均存在的情况下,则后台服务器将当前主密钥和待更新主密钥发送到加密机中。
可选地,终端接收到后台系统发送的使用当前主密钥加密的待更新主密钥后,调用密码键盘解解密,即使用密码键盘中的当前主密钥解密用当前主 密钥加密的待更新主密钥,得到待更新主密钥,将待更新主密钥写入终端,替换当前主密钥;终端主密钥的明文包括:待更新主密钥和当前主密钥,均不出现在密码键盘和加密机外的的任何其他地方,进而提高了终端主密钥的更新方法安全性。
可选地,终端向后台系统发送更新主密钥请求后台系统之前,还包括:终端向后台系统发送初始化主密钥请求;发送终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;终端接收后台系统发送的使用公钥加密后的第一密钥;终端接收后台系统发送的使用第一密钥加密后的初始化主密钥;终端使用私钥对加密后的第一密钥进行解密得到第一密钥;终端使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
相应地,可选地,后台系统接收终端发送的更新主密钥请求之前,还包括:后台系统接收终端发送的初始化主密钥请求;接收终端发送的终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;后台系统根据预设的终端的标识和主密钥的对应关系,确定出终端的初始化标识对应的初始化主密钥;后台系统产生第一密钥;后台系统使用公钥对第一密钥进行加密,将得到的加密后的第一密钥发送给终端;后台系统使用第一密钥对初始化主密钥进行加密,将得到加密后的初始化主密钥发送给终端;其中,加密后的初始化主密钥用于使终端使用私钥对加密后的第一密钥进行解密得到第一密钥后,使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥,并将初始化主密钥写入终端。
可选地,终端向后台系统发送终端的原始标识,可以通过双向认证安全通道发送,也可以通过将原始标识携带在初始化请求中发送;所以,后台系统获取原始标识可以通过接收到的初始化请求,也可以通过建立双向安全认证通道获取。
可选地,终端与后台系统建立安全认证双向通道后,终端的客户端调用密码键盘接口产生非对称过程密钥,并将非对称过程密钥中的私钥保存在密码键盘中,终端客户端调用公钥,并将公钥携带在初始化的请求中;可选地,原始标识为生产商预置的标识,当后台系统确定获取到的原始标识为生产商预置的标识时,才执行对该终端进行主密钥初始化的过程。
可选地,第一密钥为随机密钥。
可选地,后台系统中的服务器在确定原始标识为生产商预置的标识的情况下,确定终端的初始化标识对应的终端主密钥,调用后台系统中的加密机产生随机密钥,其中,随机密钥可以为临时终端主密钥,该临时终端主密钥与主密钥使用相同的算法对随机信息加密获得,使用公钥对临时终端主密钥进行加密获得加密后的临时终端主密钥;使用临时终端主密钥对初始化终端主密钥进行加密,获得加密后的初始化终端主密钥。
可选地,终端接收到用公钥加密的临时终端主密钥和用临时终端主密钥加密的初始化主密钥之后,终端客户端调用密码键盘对其进行解密,在密码接盘中使用私钥对用公钥加密的临时终端主密钥进行解密,获得临时终端主密钥,使用临时终端主密钥对使用临时终端主密钥加密的初始化终端主密钥进行解密获得初始化终端主密钥,将获得的初始化终端主密钥写入密码键盘。通过非对称过程密钥进行加密解密极大的提高了初始终端主密钥的安全性。
通过上述初始化的方法,可以进一步提高初始化终端主密钥的安全性,使用临时终端主密钥加密初始化终端主密钥,公钥加密临时终端主密钥;而且,终端主密钥的明文不出现在密码键盘和加密机外的的任何其他地方,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都 是密文,即使被窃取,也无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
可选地,后台系统接收终端发送的初始化主密钥请求之后,根据预设的终端的标识和主密钥的对应关系确定出终端的初始化标识对应的初始化主密钥之前,还包括:后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识。
相应地,可选地,初始化主密钥为后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的初始化标识对应的主密钥。
可选地,在终端初次布放前,生产商通常预置标识,默认终端主密钥写入密码键盘,初次进行密码键盘中终端主密钥的初始化使用该默认的终端主密钥进行初始化。可选地,终端的原始标识包括原始终端号和原始商户号。可选地,后台系统确定原始标识为生产商预置的标识的情况下,才允许对终端主密钥进行初始化操作,进而确保了终端的安全性,以及便于后续终端出现安全问题时进行追究责任。
需要说明的一点是:上述针对终端主密钥的设置的说明仅是示例性和解释性的,并不用于限定本发明。
从上述内容可以看出:由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前 终端主密钥和待更新终端主密钥都是密文,即使被窃取,页无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
图3示例性示出了本发明实施例提供的一种后台系统的结构示意图。
基于相同构思,本发明实施例提供一种后台系统,如图3所示,后台系统300包括接收单元301、处理单元302。其中:
接收单元,用于接收终端发送的更新主密钥请求;接收终端发送的终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;
处理单元,根据预设的终端的标识和主密钥的对应关系,确定出终端的待更新标识对应的待更新主密钥,以及当前标识对应的当前主密钥;使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给终端;其中,加密后的待更新主密钥用于使终端使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥写入终端。
可选地,接收单元,还用于:接收终端发送的初始化主密钥请求;接收终端发送的终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;
所述处理单元,用于:根据预设的终端的标识和主密钥的对应关系,确定出终端的初始化标识对应的初始化主密钥;产生第一密钥;使用公钥对第一密钥进行加密,将得到的加密后的第一密钥发送给终端;使用第一密钥对初始化主密钥进行加密,将得到加密后的初始化主密钥发送给终端;其中,加密后的初始化主密钥用于使终端使用私钥对加密后的第一密钥进行解密得到第一密钥后,使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,处理单元,还用于:根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识。
图4示例性示出了本发明实施例提供的一种终端的结构示意图。
基于相同构思,本发明实施例提供一种终端,如图4所示,终端400包括发送单元401、接收单元402和处理单元403。其中:
发送单元,用于向后台系统发送更新主密钥请求;发送终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;
接收单元,用于接收后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,当前主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的当前标识对应的主密钥;待更新主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的待更新标识对应的主密钥;
处理单元,用于使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥替换当前主密钥。
可选地,发送单元,还用于:向后台系统发送初始化主密钥请求;发送终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;
述接收单元,用于:接收后台系统发送的使用公钥加密后的第一密钥;接收后台系统发送的使用第一密钥加密后的初始化主密钥;
述处理单元,用于:使用私钥对加密后的第一密钥进行解密得到第一密钥;使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,初始化主密钥为后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的初始化标识对应的主密钥。
从上述内容可以看出:本发明实施例中,由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了 远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性;而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,页无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
基于相同构思,本申请提供一种电子设备,可用于执行上述后台系统侧的方法流程。图5为本申请提供的一种电子设备的结构示意图。该电子设备包括处理器501、存储器502、收发器503和通信接口504;其中,处理器501、存储器502、收发器503和通信接口504通过总线505相互连接。
总线505可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器502可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器502还可以包括上述种类的存储器的组合。
通信接口504可以为有线通信接入口,无线通信接口或其组合,其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线通信接口可以为WLAN接口。
处理器501可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。
处理器501还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述处理器501,用于读取所述存储器502中的程序,执行下列方法:接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;根据预设的终端的标识和主密钥的对应关系,确定出所述终端的待更新标识对应的待更新主密钥,以及所述当前标识对应的当前主密钥;使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给所述终端;其中,所述加密后的待更新主密钥用于使所述终端使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥写入所述终端。
所述存储器502,用于存储一个或多个可执行程序,可以存储所述处理器501在执行操作时所使用的数据;
所述收发器503,用于在所述处理器501的控制下接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识。
可选地,所述收发器,还用于:接收终端发送的初始化主密钥请求;接收终端发送的终端的原始标识;其中,初始化主密钥请求中包括终端的初始化标识和公钥;
所述处理器,用于:根据预设的终端的标识和主密钥的对应关系,确定 出终端的初始化标识对应的初始化主密钥;产生第一密钥;使用公钥对第一密钥进行加密,将得到的加密后的第一密钥发送给终端;使用第一密钥对初始化主密钥进行加密,将得到加密后的初始化主密钥发送给终端;其中,加密后的初始化主密钥用于使终端使用私钥对加密后的第一密钥进行解密得到第一密钥后,使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,所述处理器,还用于:根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识。
应理解,以上各个单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。本申请实施例中,接收单元301可以由收发器实现,处理单元302可以由处理器实现。如图5所示,电子设备500可以包括处理器501、收发器503和存储器502。其中,存储器502可以用于存储电子设备500出厂时预装的程序/代码,也可以存储用于处理器501执行时的代码等。
基于相同构思,本申请提供一种电子设备,可用于执行上述终端侧的方法流程。图6为本申请提供的另一种电子设备的结构示意图。该电子设备包括处理器601、存储器602、收发器603和通信接口604;其中,处理器601、存储器602、收发器603和通信接口604之间通过总线605相互连接。
总线605可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器602可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,简称RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,简称HDD)或固态硬盘(solid-state drive,简称SSD);存储器602还可以包括上述种类的存储器的组合。
通信接口604可以为有线通信接入口,无线通信接口或其组合,其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线通信接口可以为WLAN接口。
处理器601可以是中央处理器(central processing unit,简称CPU),网络处理器(network processor,简称NP)或者CPU和NP的组合。
处理器601还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,简称ASIC),可编程逻辑器件(programmable logic device,简称PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,简称CPLD),现场可编程逻辑门阵列(field-programmable gate array,简称FPGA),通用阵列逻辑(generic array logic,简称GAL)或其任意组合。
所述处理器601,用于使用当前主密钥对加密后的待更新主密钥进行解密,得到待更新主密钥,并将待更新主密钥替换当前主密钥。
所述存储器602,用于存储一个或多个可执行程序,可以存储所述处理器601在执行操作时所使用的数据。
所述收发器603,用于向后台系统发送更新主密钥请求;发送终端的当前标识;其中,更新主密钥请求中包括终端的待更新标识;接收后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,当前主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的当前标识对应的主密钥; 待更新主密钥为后台系统根据预设的终端的标识和主密钥的对应关系确定出的待更新标识对应的主密钥。
可选地,所述收发器,还用于:向后台系统发送初始化主密钥请求;发送终端的原始标识;接收后台系统发送的使用公钥加密后的第一密钥;接收后台系统发送的使用第一密钥加密后的初始化主密钥;其中,初始化主密钥请求中包括终端的初始化标识和公钥;所述处理器,用于:使用私钥对加密后的第一密钥进行解密得到第一密钥;使用第一密钥对加密后的初始化主密钥进行解密,得到初始化主密钥。
可选地,第一密钥为随机密钥。
可选地,初始化主密钥为后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的初始化标识对应的主密钥。
应理解,以上各个单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。本申请实施例中,发送单元401和接收单元402均可以由收发器603实现,处理单元403可以由处理器601实现。如图6所示,电子设备600可以包括处理器601、存储器602和收发器603。其中,存储器602可以用于存储处理器601执行方案时的代码,该代码可为电子设备600出厂时预装的程序/代码。
从上述内容可以看出:本发明实施例中,由于本发明实施例中后台系统根据终端的发送的更新主密钥请求,对终端的主密钥进行更新,从而实现了远程更新终端主主密钥,使更新主密钥快捷、方便;而且,在更新过程中后台系统使用当前主密钥对待更新主密钥进行加密,防止后台系统在向服务器发送终端主密钥时时待更新主密钥被泄露,提高了更新终端主密钥的安全性; 而且,由于当前终端主密钥和待更新终端主密钥都是密文,即使被窃取,页无法获得真实的终端主密钥,无法进行窃取或破坏,进一步提高了更新终端主密钥的安全性。
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包括有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权 利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包括这些改动和变型在内。

Claims (18)

  1. 一种终端主密钥的设置方法,其特征在于,包括:
    后台系统接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;
    所述后台系统根据预设的终端的标识和主密钥的对应关系,确定出所述终端的待更新标识对应的待更新主密钥,以及所述当前标识对应的当前主密钥;
    所述后台系统使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给所述终端;其中,所述加密后的待更新主密钥用于使所述终端使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥写入所述终端。
  2. 如权利要求1所述的方法,其特征在于,所述后台系统接收终端发送的更新主密钥请求之前,还包括:
    所述后台系统接收终端发送的初始化主密钥请求;接收所述终端发送的所述终端的原始标识;其中,所述初始化主密钥请求中包括所述终端的初始化标识和公钥;
    所述后台系统根据所述预设的终端的标识和主密钥的对应关系,确定出所述终端的所述初始化标识对应的初始化主密钥;
    所述后台系统产生第一密钥;
    所述后台系统使用公钥对所述第一密钥进行加密,将得到的加密后的第一密钥发送给所述终端;
    所述后台系统使用所述第一密钥对所述初始化主密钥进行加密,将得到加密后的初始化主密钥发送给所述终端;
    其中,所述加密后的初始化主密钥用于使所述终端使用私钥对加密后的第一密钥进行解密得到所述第一密钥后,使用所述第一密钥对加密后的初始化主密钥进行解密,得到所述初始化主密钥。
  3. 如权利要求2所述的方法,其特征在于,所述第一密钥为随机密钥。
  4. 如权利要求2所述的方法,其特征在于,所述后台系统接收终端发送的初始化主密钥请求之后,根据预设的终端的标识和主密钥的对应关系确定出所述终端的所述初始化标识对应的初始化主密钥之前,还包括:
    所述后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在所述终端的原始标识对应的生产商预置标识。
  5. 一种终端主密钥的设置方法,其特征在于,包括:
    终端向后台系统发送更新主密钥请求;发送所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;
    所述终端接收所述后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,所述当前主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述当前标识对应的主密钥;所述待更新主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述待更新标识对应的主密钥;
    所述终端使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥替换所述当前主密钥。
  6. 如权利要求5所述的方法,其特征在于,所述终端向后台系统发送更新主密钥请求后台系统之前,还包括:
    终端向所述后台系统发送初始化主密钥请求;发送所述终端的原始标识;其中,所述初始化主密钥请求中包括所述终端的初始化标识和公钥;
    所述终端接收所述后台系统发送的使用所述公钥加密后的第一密钥;所述终端接收所述后台系统发送的使用所述第一密钥加密后的所述初始化主密钥;
    所述终端使用私钥对加密后的第一密钥进行解密得到所述第一密钥;
    所述终端使用所述第一密钥对加密后的初始化主密钥进行解密,得到所述初始化主密钥。
  7. 如权利要求5所述的方法,其特征在于,所述第一密钥为随机密钥。
  8. 如权利要求5所述的方法,其特征在于,所述初始化主密钥为所述后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在所述终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的所述初始化标识对应的主密钥。
  9. 一种电子设备,其特征在于,包括处理器、存储器、收发器、通信接口,其中处理器、存储器与收发器之间通过总线连接;
    所述处理器,用于读取所述存储器中的程序,执行下列方法:根据预设的终端的标识和主密钥的对应关系,确定出所述终端的待更新标识对应的待更新主密钥,以及所述当前标识对应的当前主密钥;使用当前主密钥对待更新主密钥进行加密,将得到加密后的待更新主密钥发送给所述终端;其中,所述加密后的待更新主密钥用于使所述终端使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥写入所述终端;
    所述收发器,用于接收终端发送的更新主密钥请求;接收所述终端发送的所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;
    所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据。
  10. 如权利要求9所述的电子设备,其特征在于,所述收发器,还用于:
    接收终端发送的初始化主密钥请求;接收所述终端发送的所述终端的原始标识;其中,所述初始化主密钥请求中包括所述终端的初始化标识和公钥;
    所述处理器,用于:
    根据所述预设的终端的标识和主密钥的对应关系,确定出所述终端的所述初始化标识对应的初始化主密钥;产生第一密钥;使用公钥对所述第一密钥进行加密,将得到的加密后的第一密钥发送给所述终端;使用所述第一密钥对所述初始化主密钥进行加密,将得到加密后的初始化主密钥发送给所述终端;其中,所述加密后的初始化主密钥用于使所述终端使用私钥对加密后 的第一密钥进行解密得到所述第一密钥后,使用所述第一密钥对加密后的初始化主密钥进行解密,得到所述初始化主密钥。
  11. 如权利要求9所述的电子设备,其特征在于,所述第一密钥为随机密钥。
  12. 如权利要求9~11所述的电子设备,其特征在于,所述处理器,还用于:根据预设的终端标识和生产商预置标识的对应关系,确定存在所述终端的原始标识对应的生产商预置标识。
  13. 一种电子设备,其特征在于,包括:处理器、存储器、收发器和通信接口,其中,处理器、存储器、收发器和通信接口之间通过总线连接;
    所述收发器,用于向后台系统发送更新主密钥请求;发送所述终端的当前标识;其中,所述更新主密钥请求中包括所述终端的待更新标识;
    接收所述后台系统发送的使用当前主密钥加密后的待更新主密钥;其中,所述当前主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述当前标识对应的主密钥;所述待更新主密钥为所述后台系统根据预设的终端的标识和主密钥的对应关系确定出的所述待更新标识对应的主密钥;
    所述处理器,用于使用所述当前主密钥对所述加密后的待更新主密钥进行解密,得到所述待更新主密钥,并将所述待更新主密钥替换所述当前主密钥。
  14. 如权利要求13所述的电子设备,其特征在于,所述收发器,还用于:
    向所述后台系统发送初始化主密钥请求;发送所述终端的原始标识;其中,所述初始化主密钥请求中包括所述终端的初始化标识和公钥;
    接收所述后台系统发送的使用所述公钥加密后的第一密钥;接收所述后台系统发送的使用所述第一密钥加密后的所述初始化主密钥;
    所述处理器,用于:
    使用私钥对加密后的第一密钥进行解密得到所述第一密钥;使用所述第一密钥对加密后的初始化主密钥进行解密,得到所述初始化主密钥。
  15. 如权利要求13所述的电子设备,其特征在于,所述第一密钥为随机密钥。
  16. 如权利要求13所述的电子设备,其特征在于,所述初始化主密钥为所述后台系统根据预设的终端标识和生产商预置标识的对应关系,确定存在所述终端的原始标识对应的生产商预置标识的情况下,根据预设的终端的标识和主密钥的对应关系确定出的所述初始化标识对应的主密钥。
  17. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1~4任一所述方法,或者所述计算机指令用于使所述计算机执行权利要求5~8任一所述方法。
  18. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1~4任一所述方法;或者使所述计算机执行权利要求5~8任一所述方法。
PCT/CN2017/105732 2016-11-15 2017-10-11 一种终端主密钥的设置方法和装置 WO2018090763A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611006175.9A CN106571915A (zh) 2016-11-15 2016-11-15 一种终端主密钥的设置方法和装置
CN201611006175.9 2016-11-15

Publications (1)

Publication Number Publication Date
WO2018090763A1 true WO2018090763A1 (zh) 2018-05-24

Family

ID=58542875

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105732 WO2018090763A1 (zh) 2016-11-15 2017-10-11 一种终端主密钥的设置方法和装置

Country Status (3)

Country Link
CN (1) CN106571915A (zh)
TW (1) TWI644557B (zh)
WO (1) WO2018090763A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545542A (zh) * 2019-06-13 2019-12-06 银联商务股份有限公司 基于非对称加密算法的主控密钥下载方法、装置和计算机设备
CN111666558A (zh) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 密钥轮换方法、装置、计算机设备及存储介质
CN113452654A (zh) * 2020-03-25 2021-09-28 深圳法大大网络科技有限公司 一种数据解密的方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106571915A (zh) * 2016-11-15 2017-04-19 中国银联股份有限公司 一种终端主密钥的设置方法和装置
CN110875902A (zh) * 2018-08-31 2020-03-10 阿里巴巴集团控股有限公司 通信方法、装置及系统
CN110048831A (zh) * 2018-12-29 2019-07-23 中国银联股份有限公司 Pos终端主密钥的分发方法和分发装置
CN109830035A (zh) * 2019-01-23 2019-05-31 中山大学深圳研究院 密码键盘的远程密钥加载方法
CN112735007A (zh) * 2020-12-25 2021-04-30 熵基科技股份有限公司 一种门禁控制方法、软件平台和门禁系统
CN113645590B (zh) * 2021-07-16 2023-10-03 北汽福田汽车股份有限公司 基于加密算法的远程控制车辆的方法、装置、设备及介质
CN115037450B (zh) * 2021-11-19 2023-04-14 荣耀终端有限公司 数据保护方法及电子设备
CN114095165B (zh) * 2021-11-22 2024-04-26 中国建设银行股份有限公司 密钥更新方法、服务端设备、客户端设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030219129A1 (en) * 2002-05-21 2003-11-27 Robert Whelan System and method for providing WLAN security through synchronized update and rotation of WEP keys
CN101370248A (zh) * 2007-08-15 2009-02-18 中国移动通信集团公司 密钥更新方法、第三方服务器及激活第三方应用的系统
CN102118385A (zh) * 2010-12-14 2011-07-06 北京握奇数据系统有限公司 安全域的管理方法和装置
CN104954123A (zh) * 2014-03-28 2015-09-30 中国银联股份有限公司 智能pos终端主密钥更新系统及更新方法
CN105743654A (zh) * 2016-02-02 2016-07-06 上海动联信息技术股份有限公司 一种pos机密钥远程下载的服务系统以及密钥下载方法
CN106571915A (zh) * 2016-11-15 2017-04-19 中国银联股份有限公司 一种终端主密钥的设置方法和装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7093128B2 (en) * 2000-04-06 2006-08-15 Sony Corporation Information recording/reproducing apparatus and method
JP4622064B2 (ja) * 2000-04-06 2011-02-02 ソニー株式会社 情報記録装置、情報再生装置、情報記録方法、情報再生方法、および情報記録媒体、並びにプログラム提供媒体
CN100561916C (zh) * 2006-12-28 2009-11-18 北京飞天诚信科技有限公司 一种更新认证密钥的方法和系统
CN102025486A (zh) * 2009-09-21 2011-04-20 深圳市证通电子股份有限公司 安全智能芯片的密钥管理方法
CN103051641A (zh) * 2013-01-17 2013-04-17 中国银行股份有限公司 多客户端密钥更新方法和系统及信息安全传输方法
US9094191B2 (en) * 2013-03-14 2015-07-28 Qualcomm Incorporated Master key encryption functions for transmitter-receiver pairing as a countermeasure to thwart key recovery attacks
CN103714633B (zh) * 2013-03-15 2016-05-04 福建联迪商用设备有限公司 一种安全生成传输密钥的方法及pos终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030219129A1 (en) * 2002-05-21 2003-11-27 Robert Whelan System and method for providing WLAN security through synchronized update and rotation of WEP keys
CN101370248A (zh) * 2007-08-15 2009-02-18 中国移动通信集团公司 密钥更新方法、第三方服务器及激活第三方应用的系统
CN102118385A (zh) * 2010-12-14 2011-07-06 北京握奇数据系统有限公司 安全域的管理方法和装置
CN104954123A (zh) * 2014-03-28 2015-09-30 中国银联股份有限公司 智能pos终端主密钥更新系统及更新方法
CN105743654A (zh) * 2016-02-02 2016-07-06 上海动联信息技术股份有限公司 一种pos机密钥远程下载的服务系统以及密钥下载方法
CN106571915A (zh) * 2016-11-15 2017-04-19 中国银联股份有限公司 一种终端主密钥的设置方法和装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545542A (zh) * 2019-06-13 2019-12-06 银联商务股份有限公司 基于非对称加密算法的主控密钥下载方法、装置和计算机设备
CN110545542B (zh) * 2019-06-13 2023-03-14 银联商务股份有限公司 基于非对称加密算法的主控密钥下载方法、装置和计算机设备
CN113452654A (zh) * 2020-03-25 2021-09-28 深圳法大大网络科技有限公司 一种数据解密的方法
CN113452654B (zh) * 2020-03-25 2023-04-28 深圳法大大网络科技有限公司 一种数据解密的方法
CN111666558A (zh) * 2020-04-30 2020-09-15 平安科技(深圳)有限公司 密钥轮换方法、装置、计算机设备及存储介质
CN111666558B (zh) * 2020-04-30 2023-08-01 平安科技(深圳)有限公司 密钥轮换方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN106571915A (zh) 2017-04-19
TWI644557B (zh) 2018-12-11
TW201820818A (zh) 2018-06-01

Similar Documents

Publication Publication Date Title
WO2018090763A1 (zh) 一种终端主密钥的设置方法和装置
CN110519260B (zh) 一种信息处理方法及信息处理装置
US9735962B1 (en) Three layer key wrapping for securing encryption keys in a data storage system
US10154018B2 (en) Method and system for facilitating network joining
CN108377190B (zh) 一种认证设备及其工作方法
US8495383B2 (en) Method for the secure storing of program state data in an electronic device
US11831753B2 (en) Secure distributed key management system
CN104836784B (zh) 一种信息处理方法、客户端和服务器
WO2019200530A1 (zh) 终端主密钥的远程分发方法及其系统
CN111917710B (zh) Pci-e密码卡及其密钥保护方法、计算机可读存储介质
WO2021109963A1 (zh) 初始安全配置方法、安全模块及终端
CN103546289A (zh) 一种基于USBKey的安全传输数据的方法及系统
CN111131416A (zh) 业务服务的提供方法和装置、存储介质、电子装置
WO2018120938A1 (zh) 密钥离线传输方法、终端和存储介质
CN114070614A (zh) 身份认证方法、装置、设备、存储介质和计算机程序产品
CN104767766A (zh) 一种Web Service接口验证方法、Web Service服务器、客户端
US20210306135A1 (en) Electronic device within blockchain based pki domain, electronic device within certification authority based pki domain, and cryptographic communication system including these electronic devices
US20190349198A1 (en) Automated authentication of a new network element
CN112400294B (zh) 来自非易失性存储器装置内的安全通信
WO2019120231A1 (zh) 确定tpm可信状态的方法、装置及存储介质
CN111008400A (zh) 数据处理方法、装置及系统
CN114024711A (zh) 一种数据传输方法、装置及计算机可读存储介质
CN108924822B (zh) 一种基于可信环境的有卡安全通信方法及移动终端
CN109075974A (zh) 指纹算法库与指纹传感器的绑定认证方法及指纹识别系统
CN117041956A (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: 17871083

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

Country of ref document: EP

Kind code of ref document: A1