Key updating method, key management system, equipment, storage medium and product

Through the collaborative work of POS terminal background management and hardware security modules, working keys are generated and encrypted, which solves the problem of complex and labor-intensive POS terminal key update processes, achieving remote and efficient key updates and improving security. .

CN118631428AActive Publication Date: 2024-09-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202410604916.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-09-10
Estimated Expiration
2044-05-15

AI Technical Summary

Technical Problem

The working key update process of existing POS terminals is complex and labor-intensive, making it difficult to update remotely and efficiently.

Method used

The key generation interface is called through the POS terminal background management to generate a public and private key pair, and the public key is forwarded to the hardware security module to generate and encrypt the working key to achieve remote updates.

Benefits of technology

It realizes remote and efficient updating of POS terminal working keys, reduces labor costs, and improves the security and efficiency of key updating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631428A
    Figure CN118631428A
Patent Text Reader

Abstract

The invention provides a key updating method, a key management system, equipment, a storage medium and a product, and relates to the field of information security. The method comprises the following steps: a POS terminal background manager calls a key generation interface of a POS terminal to enable a password keyboard of the POS terminal to generate a public and private key pair and return a public key, and forwards the public key to a hardware security module and calls the hardware security module to generate a first working key; the hardware security module sends a first ciphertext generated by encrypting the first working key based on the public key and a key verification value corresponding to the first working key to the POS terminal; after the POS terminal receives the first ciphertext and the secret key verification value, the first working secret key is obtained based on the private key, and the current working secret key is updated to be the first working secret key. According to the scheme, the POS terminal background management is used for instruction scheduling, information encryption and decryption are configured on the POS terminal and the hardware security module, and the working key of the POS terminal can be remotely and efficiently updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security, and in particular to a key updating method, a key management system, a device, a storage medium and a product. Background Art

[0002] POS terminals (Point of Sale, POS) are commonly used in the retail and service industries to process transactions, collect payments, and manage inventory. With the continuous development of technology and changes in consumer demand, POS terminals are also constantly expanding and innovating in terms of function and form.

[0003] The working key of the POS terminal is stored in the password keyboard and is used to protect the data security in financial transactions. At present, before the POS terminal is deployed to the merchant or when the working key needs to be updated, the POS terminal professional service agency or the acquiring agency usually needs to manually use the mother POS to input the working key into the password keyboard of the POS terminal to update the working key. However, the current working key of the POS terminal has the problem of being fixed for a long time, the updating process is complicated and labor-intensive. Therefore, the problem that needs to be solved at present is how to remotely and efficiently update the working key of the POS terminal. Summary of the invention

[0004] The present application provides a key update method, a key management system, a device, a storage medium and a product to improve the security of key update of a POS terminal.

[0005] On the one hand, the present application provides a key update method, which is applied to a key management system, which includes a POS terminal background management, a POS terminal and a hardware security module; the method includes: when the POS terminal background management detects a working key update instruction of the POS terminal, the POS terminal background management calls the key generation interface of the POS terminal, so that the password keyboard of the POS terminal generates a public-private key pair and returns a public key; the POS terminal background management forwards the public key to the hardware security module and calls the working key generation interface of the hardware security module; the hardware security module generates a first working key after the working key generation interface is called, and encrypts the first working key based on the public key to generate a first ciphertext, and sends the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal; the hardware security module encrypts the first working key in an encryption machine format to generate a second ciphertext to the POS terminal background management; wherein the hardware security module obtains the current working key based on the second ciphertext; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key, and updates the current working key to the first working key.

[0006] In one possible implementation, obtaining a first working key based on a private key includes: decrypting a first ciphertext using the private key to obtain a second working key; encrypting a preset verification character based on the second working key to obtain a third ciphertext; performing a consistency comparison between the third ciphertext and a key check value, and if the comparison result is consistent, using the second working key as the first working key; and executing a corresponding warning if the match fails.

[0007] In one possible implementation, the system also includes a personal settlement platform; the method also includes: when the POS terminal detects a card transaction, the POS terminal encrypts the bank card identifier and password based on the current working key to generate a fourth ciphertext, and sends the fourth ciphertext to the POS terminal background management; the POS terminal background management sends the fourth ciphertext, the bank card identifier corresponding to the fourth ciphertext, and the second ciphertext to the hardware security module, so that the hardware security module returns a national secret password envelope; the POS terminal background management sends the bank card identifier and the national secret password envelope to the personal settlement platform; the personal settlement platform verifies the password based on the received bank card identifier and the national secret password envelope, and returns the verification result to the POS terminal through the POS terminal background management.

[0008] In one possible implementation, the hardware security module includes a local master key, which is used to decrypt the second ciphertext generated after encryption in the encryption machine format; the hardware security module returns the national secret password envelope, including: the hardware security module uses the local master key to decrypt the second ciphertext to obtain the current working key, and uses the current working key to decrypt the fourth ciphertext to obtain the decryption result; the hardware security module encapsulates the national secret password envelope based on the decryption result, and returns the national secret password envelope to the POS terminal background management.

[0009] In a possible implementation, the national secret code envelope includes a flag bit; the method also includes: if the personal settlement platform detects that the national secret code envelope has passed the verification, a preset value is written in the flag bit of the national secret code envelope; if the national secret code envelope has failed the verification, no operation is performed.

[0010] In a possible implementation, the method also includes: when the POS terminal background management detects that an update scenario is triggered, a working key update instruction is generated; wherein the update scenario includes at least one of the following: the usage time of the POS terminal is greater than the preset time, the bank card account has an in-bank or out-of-bank dishonesty record, the bank card account has a clearing abnormality, the cumulative amount of private transfers from the bank card account is greater than a first preset amount, and the cumulative amount of public transfers from the bank card account is greater than a second preset amount; wherein the first preset amount is greater than the second preset amount.

[0011] On the other hand, the present application provides a key management system, including: POS terminal background management, POS terminal and hardware security module; the POS terminal background management is used to call the key generation interface of the POS terminal when a working key update instruction of the POS terminal is detected, so that the password keyboard of the POS terminal generates a public-private key pair and returns the public key; the POS terminal background management is also used to forward the public key to the hardware security module and call the working key generation interface of the hardware security module; the hardware security module is used to generate a first working key after the working key generation interface is called, and encrypt the first working key based on the public key to generate a first ciphertext, and send the key verification value corresponding to the first ciphertext and the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal; the hardware security module is also used to send the second ciphertext generated by encrypting the first working key in the encryption machine format to the POS terminal background management; wherein the hardware security module obtains the current working key based on the second ciphertext; the POS terminal is used to obtain the first working key based on the private key after receiving the first ciphertext and the key verification value, and update the current working key to the first working key.

[0012] On the other hand, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the above method.

[0013] On the other hand, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0014] On the other hand, the present application provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0015] The key update method, key management system, device, storage medium and product provided by the present application include: the POS terminal background management calls the key generation interface of the POS terminal so that the password keyboard of the POS terminal generates a public-private key pair and returns the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate the first working key; the hardware security module encrypts the first working key based on the public key to generate the first ciphertext and the key verification value corresponding to the first working key and sends it to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate the second ciphertext and sends it to the POS terminal background management. In the scheme of the present application, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient update of the working key of the POS terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] Figure 1 The flowchart of the key updating method provided in the first embodiment is exemplarily shown in FIG.

[0018] Figure 2 The flowchart of the key updating method provided in the first embodiment is exemplarily shown in FIG.

[0019] Figure 3 The flowchart of the key updating method provided in the first embodiment is shown in FIG.

[0020] Figure 4 The flowchart of the key updating method provided in the first embodiment is exemplarily shown in FIG.

[0021] Figure 5 The structural diagram of the key management system provided by the second embodiment is exemplarily shown in FIG.

[0022] Figure 6 The interactive diagram of the key management system provided in the second embodiment is exemplarily shown in FIG.

[0023] Figure 7 The interactive diagram of the key management system provided in the second embodiment is exemplarily shown in FIG.

[0024] Figure 8 A schematic diagram of the structure of the electronic device provided in the third embodiment is exemplarily shown in FIG.

[0025] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0026] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0027] It should be noted that the brief description of the terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of the present application. Unless otherwise specified, these terms should be understood according to their common and usual meanings. The terms "including" and "having" in the specification and claims and the above-mentioned drawings in this application and any variation thereof are intended to cover but not exclude inclusion. For example, a product or device containing a series of components is not necessarily limited to those components clearly listed, but may include other components that are not clearly listed or inherent to these products or devices. The term "module" used in this application refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or a combination of hardware and / or software code that can perform functions related to the element.

[0028] During the transaction process, the POS terminal can receive bank card information and accept the teller's instructions to complete the exchange of financial transaction information and related information. Among them, the personal identification number (PIN), that is, the personal bank card password, is the data information that identifies the legitimacy of the cardholder's identity in online transactions, and is not allowed to appear in plain text at any link in the computer and network system. Therefore, it is usually necessary to use a working key to encrypt the PIN before transmission, and the working key that is fixed for a long time also has the risk of being stolen by hackers. In the current initialization and update processes of the working key, a professional service agency or a acquiring agency is required to take the password keyboard corresponding to the POS terminal to a safe area, and use the mother POS to re-fill the terminal master key into the password keyboard. However, this solution has the problems of complex process, long cycle, high maintenance cost, and thus low security of the working key.

[0029] The technical content provided by this application is intended to solve the above-mentioned technical problems of related technologies. The key update method, key management system, device, storage medium and product of this application, the method includes: the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate a first working key; the hardware security module encrypts the first working key based on the public key to generate the first ciphertext and the key verification value corresponding to the first working key to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key, and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate the second ciphertext to the POS terminal background management. In the scheme of this application, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient update of the working key of the POS terminal.

[0030] The technical solutions of the present application and the technical solutions of the present application are described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. In the description of the present application, unless otherwise clearly specified and limited, each term should be understood in a broad sense in the art. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0031] Embodiment 1

[0032] Figure 1 A schematic diagram of a key update method is shown in FIG. Figure 1 As shown, the method includes:

[0033] Step 101: When the POS terminal background management detects a working key update instruction of the POS terminal, the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return a public key; the POS terminal background management forwards the public key to the hardware security module and calls the working key generation interface of the hardware security module;

[0034] Step 102: The hardware security module generates a first working key after the working key generation interface is called, and generates a first ciphertext after encrypting the first working key based on the public key, and sends the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal; the hardware security module encrypts the first working key in the encryption machine format to generate a second ciphertext to the POS terminal background management; wherein the hardware security module obtains the current working key based on the second ciphertext;

[0035] Step 103: After receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key, and updates the current working key to the first working key.

[0036] In actual applications, there are many ways to implement POS terminal background management. For example, it can be implemented through computer programs, such as application software, etc.; or it can be implemented as a medium storing relevant computer programs, such as a USB flash drive, a cloud disk, etc.; or it can be implemented through a physical device that integrates or installs relevant computer programs, such as a chip.

[0037] The working key update instruction of the POS terminal in this example can be in various forms, such as an update instruction actively sent by an online counter staff or maintenance engineer, or an update instruction generated according to a fixed period set in advance, or an update instruction triggered by a trigger condition such as after the POS terminal is restarted, or when there is a program abnormality in the POS terminal. The POS terminal background management calls the key generation interface of the POS terminal so that the password keyboard of the POS terminal generates a public-private key pair and returns the public key. Specifically, the key generation interface of the POS terminal can be a web service interface or an http api interface; in actual applications, the SSL / TLS (Secure Sockets Layer / Transport Layer Security) protocol can be used to encrypt HTTP communication. By encrypting and protecting the data transmitted by the interface, the data can be effectively prevented from being stolen or tampered with, thereby improving the security of the system. When generating public and private keys, the password keyboard of the POS terminal uses an asymmetric algorithm such as the RSA encryption algorithm, elliptic curve encryption technology, etc. to generate them. It should be noted that when the password keyboard of the POS terminal returns the public key to the POS terminal background management after generating the public and private keys, the public key is encrypted using the current working key, that is, the unupdated working key, before being transmitted. After receiving the public key, the POS terminal backend management forwards the public key to the hardware security module and calls the working key generation interface of the hardware security module.

[0038] The hardware security module generates a first working key after the working key generation interface is called, and generates a first ciphertext after encrypting the first working key based on the public key, and sends the key verification value corresponding to the first ciphertext and the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal. In the related art, the hardware security module, also known as HSM (Hardware Security Module, HSM), is a hardware security module used to protect and manage encryption keys, perform encryption operations and provide security services. The hardware security module usually includes a dedicated hardware security chip, secure storage, an isolated environment and security software to provide highly secure key management and encryption functions. Specifically, the hardware security module can generate a first working key based on a symmetric algorithm such as the DES algorithm (Data Encryption Standard, DES) or the AES algorithm (Advanced Encryption Standard, AES). In this example, by encrypting the first working key with a public key, it can be ensured that the encrypted first ciphertext can only be decrypted by a POS terminal with a corresponding private key. On the other hand, the hardware security module encrypts the first working key in the encryption machine format to generate the second ciphertext, and sends it to the POS terminal background management; wherein, the hardware security module can obtain the current working key based on the second ciphertext. The hardware security module encrypts the first working key locally in the encryption machine format to generate the second ciphertext, which can facilitate the hardware security module to locally decrypt the second ciphertext. In the scheme of this example, by encrypting the first working key with different keys, the possibility of cracking the first ciphertext or the second ciphertext during transmission can be reduced; in addition, the encryption and decryption of the working key are configured in the POS terminal or the hardware security module, and the POS terminal background management is only used for ciphertext transmission, which can also improve the security of the working key. In actual applications, the POS terminal background management may manage multiple POS terminals, and the POS terminal background management can list and store the POS terminal number-second ciphertext in the form of key-value pairs, and the second ciphertext stores the current working key of the POS terminal. To facilitate understanding of the role of the second ciphertext, take the example of POS terminal A sending a public key. POS terminal A will encrypt the public key with the current working key and send it to the POS terminal background management; the POS terminal background management will send the encrypted public key sent by POS terminal A and the second ciphertext corresponding to POS terminal A in the list to the hardware security module, so that the hardware security module can locally decrypt the second ciphertext corresponding to POS terminal A to obtain the current working key, and further obtain the public key. The solution of this example can avoid the POS terminal background management from performing decryption and encryption, and reduce the probability of leakage of the public key or working key.

[0039] After receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key, and updates the current working key to the first working key. Among them, the key verification value is also called KCV (Key Check Value), which can verify the accuracy of key transmission and import. There are many ways to implement it. For example, the working key is processed by rules such as bitwise XOR operation or hash operation, and the result after rule processing is used as the key verification value; another implementation method is to encrypt the working key with 16 hexadecimal zeros, and use the encrypted result as the key verification value. It should be noted that the POS terminal and the hardware security module generate the key verification value in the same way, and the POS terminal proves the validity of the working key when the key verification value it generates is consistent with the key verification value sent by the hardware security module.

[0040] The key update method of the present application includes: the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate a first working key; the hardware security module encrypts the first working key based on the public key to generate the first ciphertext and the key verification value corresponding to the first working key and sends it to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate the second ciphertext and sends it to the POS terminal background management. In the solution of this example, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient updating of the working key of the POS terminal.

[0041] As an example, Figure 2 A schematic diagram of a key update method is shown in FIG. Figure 2 As shown, based on any example, obtaining the first working key based on the private key in step 103 includes:

[0042] Step 201: Decrypt the first ciphertext using the private key to obtain a second working key;

[0043] Step 202: Encrypt the preset verification character based on the second working key to obtain a third ciphertext;

[0044] Step 203: perform consistency comparison between the third ciphertext and the key check value. If the comparison result is consistent, the second working key is used as the first working key; if the match fails, execute a corresponding warning.

[0045] In this example, the second working key obtained after decrypting the first ciphertext using the private key is used as the working key to be verified. The verification rule is to compare the third ciphertext obtained after encrypting the preset verification characters based on the second working key with the key verification value. Specifically, the preset verification characters can be 16 hexadecimal zeros, or data carried in the first ciphertext such as the time information in the first ciphertext or the first 8 bytes in the first ciphertext. It should be noted that the hardware security module generates the key verification value according to the agreed generation rules, and the POS terminal generates the third ciphertext according to the same generation rules, and the POS terminal compares the key verification value and the third ciphertext. The scheme of this example can verify the validity of the working key in the first ciphertext.

[0046] As an example, Figure 3 A schematic diagram of a key update method is shown in FIG. Figure 3 As shown, based on any example, the system also includes a personal settlement platform; the key update method also includes:

[0047] Step 301: When the POS terminal detects a card transaction, the POS terminal encrypts the identifier and password of the bank card based on the current working key to generate a fourth ciphertext, and sends the fourth ciphertext to the POS terminal backend management;

[0048] Step 302: The POS terminal backend management sends the fourth ciphertext, the bank card identifier corresponding to the fourth ciphertext, and the second ciphertext to the hardware security module, so that the hardware security module returns the national secret code envelope; the POS terminal backend management sends the bank card identifier and the national secret code envelope to the personal settlement platform;

[0049] Step 303: The personal settlement platform verifies the password based on the received bank card identifier and national secret code envelope, and returns the verification result to the POS terminal through the POS terminal backend management.

[0050] In this example, the bank card may include a credit card and a debit card, and the identifier of the bank card may be the card number or the bank card account number of the bank card. In one example, after the POS terminal sends the fourth ciphertext to the POS terminal background management, the POS terminal background management obtains the second ciphertext corresponding to the POS terminal according to the device ID or number of the POS terminal in the list containing multiple second ciphertexts. On the other hand, the hardware security module decrypts the second ciphertext corresponding to the received POS terminal, obtains the current working key of the POS terminal, and uses the current working key of the POS terminal to decrypt the fourth ciphertext to obtain the identifier and password of the bank card in the fourth ciphertext, and encapsulates the national secret password envelope. Among them, the national secret password envelope refers to a digital envelope that uses national secret algorithms such as SM2, SM3, SM4, etc. to encrypt and protect data. In practical applications, the SM2 asymmetric encryption algorithm can be used to encrypt data, the SM3 hash algorithm can be used to perform summary calculations on data, and the SM4 symmetric encryption algorithm can be used to protect the key. The hardware security module uses dedicated hardware and security chips, has strict physical and logical security measures, and can effectively prevent various attack methods, such as side channel attacks, physical attacks, etc. Therefore, the security of information encapsulation can be improved by encapsulating the national secret code through the hardware security module. After receiving the bank card identifier and the national secret code envelope, the personal settlement platform verifies the code and returns the verification result to the POS terminal through the POS terminal background management. In actual applications, the personal settlement platform can be a third-party payment platform or a bank's online banking payment platform. The solution in this example can improve the security of bank card transactions.

[0051] As an example, Figure 4 A schematic diagram of a key update method is shown in FIG. Figure 4 As shown, based on any example, the hardware security module includes a local master key, and the local master key is used to decrypt the second ciphertext generated after encryption in the encryption machine format; in step 302, the hardware security module returns a national secret code envelope, including:

[0052] Step 401: The hardware security module uses the local master key to decrypt the second ciphertext to obtain the current working key, and uses the current working key to decrypt the fourth ciphertext to obtain a decryption result;

[0053] Step 402: The hardware security module encapsulates the national secret code envelope based on the decryption result, and returns the national secret code envelope to the POS terminal backend management.

[0054] In this example, the hardware security module stores different data or keys locally and manages them through the local master key. In actual applications, the hardware security module can be mapped to the corresponding local master key when generating the second ciphertext. When the POS terminal background management returns the second ciphertext, it can be linked to the corresponding local master key according to the mapping relationship. In this example, the decryption result includes the bank card password and the bank card identifier sent by the POS terminal. In one example, the national secret password envelope can also match the bank card identifier in the decryption result with the bank card identifier sent by the POS terminal background management to verify the consistency of the bank card identifier data. The solution in this example, which decrypts the second ciphertext through the local master key of the hardware security module, can improve the security of the national secret envelope encapsulation.

[0055] As another example, the national secret code envelope includes a flag bit; the key update method also includes:

[0056] If the personal settlement platform detects that the national secret code envelope has passed the verification, a preset value will be written into the flag of the national secret code envelope; if the national secret code envelope fails the verification, no operation will be performed.

[0057] In this example, the flag bit indicates the status of the national secret code envelope verification. For example, the flag bit is the preset value 1, indicating that the national secret code envelope verification has been passed; the flag bit is other values, indicating that it has not been verified or the verification has not passed. Specifically, the flag bit can only be written by the personal settlement platform and is read-only during the transmission of the national secret code envelope. The solution of this example can quickly determine the status of the national secret code envelope verification through the flag bit of the national secret code envelope.

[0058] As yet another example, the key updating method further includes:

[0059] When the POS terminal background management detects that an update scenario is triggered, a work key update instruction is generated; wherein, the update scenario includes at least one of the following: the usage time of the POS terminal is greater than the preset time, the bank card account has an in-bank or out-of-bank dishonesty record, the bank card account has a clearing abnormality, the cumulative amount of private transfers from the bank card account is greater than the first preset amount, and the cumulative amount of public transfers from the bank card account is greater than the second preset amount; wherein the first preset amount is greater than the second preset amount.

[0060] In actual applications, the preset time can be set to 5 hours or 6 hours, or the preset time can be adjusted according to the number of times the same POS terminal is accessed. If the number of accesses exceeds 10 times, the preset time will be reduced from 5 hours to 4 hours. On the other hand, the bank card account's internal dishonesty record can be obtained through the bank's dishonesty maintenance list; the bank card account's external dishonesty list can be queried through a website or public documents. On the other hand, the clearing black list established by the bank can also be accessed to check whether there is a clearing anomaly in the bank card account. On the other hand, by setting the first preset amount corresponding to the private transfer to be greater than the second preset amount corresponding to the public transfer, the security of the public transfer can be improved. In actual applications, the first preset amount can be set to 1 million yuan or 1.2 million yuan, and the second preset amount can be set to 500,000 yuan or 600,000 yuan. As an example, when another update scenario is triggered 5 to 10 minutes after any of the above update scenarios is triggered, the generation time of the work key update instruction corresponding to the other scenario trigger can be delayed to improve the rationality of the work key update. The solution of this example provides different triggering scenarios for generating work key update instructions, which can improve the security of the key management system.

[0061] The key update method provided in this embodiment includes: the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate a first working key; the hardware security module encrypts the first working key based on the public key to generate a first ciphertext and a key verification value corresponding to the first working key and sends it to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate a second ciphertext and sends it to the POS terminal background management. In the solution of this application, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient updating of the working key of the POS terminal.

[0062] Embodiment 2

[0063] Figure 5 The structural diagram of the key management system provided by the second embodiment of the present application is shown in FIG. Figure 5 As shown, the system includes: POS terminal background management 51, POS terminal 52 and hardware security module 53;

[0064] The POS terminal background management 51 is used to call the key generation interface of the POS terminal 52 when a working key update instruction of the POS terminal 52 is detected, so that the password keyboard of the POS terminal 52 generates a public-private key pair and returns a public key; the POS terminal background management 51 is also used to forward the public key to the hardware security module 53 and call the working key generation interface of the hardware security module 53;

[0065] The hardware security module 53 is used to generate a first working key after the working key generation interface is called, and to generate a first ciphertext after encrypting the first working key based on the public key, and to send the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management 51, so that the POS terminal background management 51 forwards the first ciphertext and the key verification value to the POS terminal 52; the hardware security module 53 is also used to send the second ciphertext generated by encrypting the first working key in the encryption machine format to the POS terminal background management 51; wherein the hardware security module 53 obtains the current working key based on the second ciphertext;

[0066] The POS terminal 52 is configured to obtain a first working key based on a private key after receiving the first ciphertext and the key verification value, and update the current working key to the first working key.

[0067] In actual applications, there are many ways to implement the POS terminal background management 51. For example, it can be implemented through a computer program, such as application software, etc.; or it can be implemented as a medium storing relevant computer programs, such as a USB flash drive, a cloud disk, etc.; or it can be implemented through a physical device that integrates or installs relevant computer programs, such as a chip, etc.

[0068] The working key update instruction of the POS terminal 52 in this example can be in various forms, such as an update instruction actively sent by an online counter staff or maintenance engineer, or an update instruction generated according to a fixed period set in advance, or an update instruction triggered by a trigger condition such as after the POS terminal 52 is restarted, or there is a program abnormality in the POS terminal 52. The POS terminal background management 51 calls the key generation interface of the POS terminal 52 so that the password keyboard of the POS terminal 52 generates a public-private key pair and returns the public key. Specifically, the key generation interface of the POS terminal can be a web service interface or an httpapi interface; in actual applications, the SSL / TLS (Secure Sockets Layer / Transport LayerSecurity) protocol can be used to encrypt HTTP communication. By encrypting and protecting the data transmitted by the interface, the data can be effectively prevented from being stolen or tampered with, thereby improving the security of the system. When generating public and private keys, the password keyboard of the POS terminal uses an asymmetric algorithm such as the RSA encryption algorithm, elliptic curve encryption technology, etc. It should be noted that when the password keyboard of the POS terminal returns the public key to the POS terminal background management 51 after generating the public and private keys, the public key is encrypted with the current working key, i.e., the unupdated working key, before being transmitted. After receiving the public key, the POS terminal background management 51 forwards the public key to the hardware security module 53 and calls the working key generation interface of the hardware security module 53.

[0069] The hardware security module 53 generates a first working key after the working key generation interface is called, and generates a first ciphertext after encrypting the first working key based on the public key, and sends the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management 51, so that the POS terminal background management 51 forwards the first ciphertext and the key verification value to the POS terminal 52. In the related art, the hardware security module 53, also known as HSM (Hardware Security Module, HSM), is a hardware security module 53 used to protect and manage encryption keys, perform encryption operations and provide security services. The hardware security module 53 usually includes a dedicated hardware security chip, secure storage, an isolated environment and security software to provide highly secure key management and encryption functions. Specifically, the hardware security module 53 can generate the first working key based on a symmetric algorithm such as the DES algorithm (Data Encryption Standard, DES) or the AES algorithm (Advanced Encryption Standard, AES). In this example, by encrypting the first working key with a public key, it can be ensured that the encrypted first ciphertext can only be decrypted by the POS terminal 52 that has the corresponding private key. On the other hand, the hardware security module 53 encrypts the first working key in the encryption machine format to generate the second ciphertext, and sends it to the POS terminal background management 51; wherein, the hardware security module 53 can obtain the current working key based on the second ciphertext. The hardware security module 53 encrypts the first working key locally in the encryption machine format to generate the second ciphertext, which can facilitate the hardware security module 53 to locally decrypt the second ciphertext. In the scheme of this example, by encrypting the first working key with different keys, the possibility of cracking the first ciphertext or the second ciphertext during transmission can be reduced; in addition, the encryption and decryption of the working key are configured in the POS terminal 52 or the hardware security module 53, and the POS terminal background management 51 is only used for ciphertext transmission, which can also improve the security of the working key. In actual applications, the POS terminal background management 51 may manage multiple POS terminals 52, and the POS terminal background management 51 can list and store the POS terminal 52 number-second ciphertext in the form of key-value pairs, and the second ciphertext stores the current working key of the POS terminal 52. To facilitate understanding of the role of the second ciphertext, taking the sending of the public key by the POS terminal 52 numbered A as an example, the POS terminal 52 numbered A will encrypt the public key with the current working key and send it to the POS terminal background management 51; the POS terminal background management 51 will send the encrypted public key sent by the POS terminal 52 numbered A and the second ciphertext corresponding to the POS terminal 52 numbered A in the list to the hardware security module 53, so that the hardware security module 53 locally decrypts the second ciphertext corresponding to the POS terminal 52 numbered A to obtain the current working key, and further obtain the public key.The solution of this example can prevent the POS terminal background management from performing decryption and encryption, thereby reducing the probability of leakage of the public key or the working key.

[0070] After receiving the first ciphertext and the key verification value, the POS terminal 52 obtains the first working key based on the private key, and updates the current working key to the first working key. Among them, the key verification value is also called KCV (Key Check Value), which can verify the accuracy of key transmission and import. There are many ways to implement it. For example, the working key is processed by rules such as bitwise XOR operation or hash operation, and the result after rule processing is used as the key verification value; another implementation method is to encrypt the working key with 16 hexadecimal zeros, and use the encrypted result as the key verification value. It should be noted that the POS terminal 52 and the hardware security module 53 generate the key verification value in the same way, and the POS terminal 52 proves the validity of the working key when the key verification value it generates is consistent with the key verification value sent by the hardware security module 53.

[0071] Figure 6 An example of an interaction diagram of a key management system is shown in FIG. Figure 6 As shown, after the POS terminal background management 51 detects the working key update instruction, the key generation interface of the POS terminal 52 is called to enable the password keyboard of the POS terminal 52 to generate a public-private key pair and return the public key; the POS terminal background management 51 sends the public key to the hardware security module 53, and calls the working key generation interface of the hardware security module 53, so that the hardware security module 53 generates a first working key, encrypts the first working key into a first ciphertext with the public key, and encrypts the first working key into a second ciphertext in an encryption machine format; the hardware security module 53 forwards the key verification value corresponding to the first ciphertext and the first working key to the POS terminal 52 through the POS terminal background management 51, and sends the second ciphertext to the POS terminal background management 51, so that the POS terminal background management 51 stores the second ciphertext; the POS terminal 52 updates the current working key to the first working key based on the private key and the received key verification value corresponding to the first ciphertext and the first working key.

[0072] The key management system of this example includes: the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate a first working key; the hardware security module encrypts the first working key based on the public key to generate the first ciphertext and the key verification value corresponding to the first working key and sends it to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate the second ciphertext and sends it to the POS terminal background management. In the solution of this application, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient update of the working key of the POS terminal.

[0073] As an example, the POS terminal 52 is specifically used for:

[0074] Decrypt the first ciphertext using the private key to obtain a second working key;

[0075] After encrypting the preset verification character based on the second working key, a third ciphertext is obtained;

[0076] The third ciphertext and the key check value are compared for consistency. If the comparison result is consistent, the second working key is used as the first working key; if the match fails, a corresponding warning is executed.

[0077] In this example, the second working key obtained by decrypting the first ciphertext with the private key is used as the working key to be verified. The verification rule is to compare the third ciphertext obtained by encrypting the preset verification characters based on the second working key with the key verification value. Specifically, the preset verification characters can be 16 hexadecimal zeros, or data carried in the first ciphertext such as the time information in the first ciphertext or the first 8 bytes in the first ciphertext. It should be noted that the hardware security module generates the key verification value according to the agreed generation rules, and the POS terminal 52 generates the third ciphertext according to the same generation rules, and the POS terminal 52 compares the key verification value and the third ciphertext. The scheme of this example can verify the validity of the working key in the first ciphertext.

[0078] As an example, the system also includes a personal settlement platform 54;

[0079] The POS terminal 52 is further used for: when a card transaction is detected, encrypting the identifier and password of the bank card based on the current working key to generate a fourth ciphertext, and sending the fourth ciphertext to the POS terminal backend management 51;

[0080] The POS terminal backend management 51 is further used to: send the fourth ciphertext, the bank card identifier corresponding to the fourth ciphertext, and the second ciphertext to the hardware security module 53, so that the hardware security module 53 returns the national secret code envelope; the POS terminal backend management 51 is further used to: send the bank card identifier and the national secret code envelope to the personal settlement platform 54;

[0081] The personal settlement platform 54 is used to: perform password verification based on the received bank card identifier and national secret code envelope and return the password verification result to the POS terminal 52 through the POS terminal background management 51.

[0082] In this example, the bank card may include a credit card and a debit card, and the identifier of the bank card may be the card number or the bank card account number of the bank card. In one example, after the POS terminal 52 sends the fourth ciphertext to the POS terminal background management 51, the POS terminal background management 51 obtains the second ciphertext corresponding to the POS terminal 52 according to the device ID or number of the POS terminal 52 in the list containing multiple second ciphertexts. On the other hand, the hardware security module 53 decrypts the received second ciphertext corresponding to the POS terminal 52, obtains the current working key of the POS terminal 52, and uses the current working key of the POS terminal 52 to decrypt the fourth ciphertext to obtain the identifier and password of the bank card in the fourth ciphertext, and encapsulates the national secret password envelope. Among them, the national secret password envelope refers to a digital envelope that uses national secret algorithms such as SM2, SM3, SM4, etc. to encrypt and protect data. In practical applications, the SM2 asymmetric encryption algorithm can be used to encrypt data, the SM3 hash algorithm can be used to perform summary calculations on data, and the SM4 symmetric encryption algorithm can be used to protect the key. The hardware security module 53 uses dedicated hardware and security chips, and has strict physical and logical security measures, which can effectively prevent various attack methods, such as side channel attacks, physical attacks, etc. Therefore, the national secret code encapsulation through the hardware security module can improve the security of information encapsulation. After receiving the bank card identifier and the national secret code envelope, the personal settlement platform 54 verifies the code and returns the verification result to the POS terminal 52 through the POS terminal background management 51. In actual applications, the personal settlement platform 54 can be a third-party payment platform or a bank's online banking payment platform. The solution of this example can improve the security in the bank card transaction process.

[0083] Figure 7 An interactive diagram of a key management system is shown in FIG. Figure 7As shown, when the POS terminal 52 detects a card transaction, the bank card identifier and password are encrypted based on the current working key to generate a fourth ciphertext, and the fourth ciphertext is sent to the POS terminal background management 51; the POS terminal background management 51 determines the second ciphertext according to the POS terminal 52 number, and sends the fourth ciphertext, the bank card identifier corresponding to the fourth ciphertext, and the second ciphertext to the hardware security module 53; the hardware security module 53 uses the local master key to decrypt the second ciphertext to obtain the current working key, decrypts the fourth ciphertext based on the current working key, and encapsulates the decryption result in a national secret password envelope, and returns the national secret password envelope to the POS terminal background management 51. The POS terminal 52 sends the national secret password envelope and the bank card identifier corresponding to the national secret password envelope to the personal settlement platform 54, so that the personal settlement platform 54 verifies the password based on the received bank card identifier and the national secret password envelope, and so that the personal settlement platform 54 returns the verification result and sends the verification result to the POS terminal 52.

[0084] As an example, the hardware security module 53 includes a local master key, and the local master key is used to decrypt the second ciphertext generated after encryption in the encryption machine format; the hardware security module 53 is specifically used to:

[0085] Decrypting the second ciphertext using the local master key to obtain the current working key, and decrypting the fourth ciphertext using the current working key to obtain a decryption result;

[0086] The national secret code envelope is encapsulated based on the decryption result, and the national secret code envelope is returned to the POS terminal background management 51.

[0087] In this example, the hardware security module 53 stores different data or keys locally and manages them through the local master key. In actual applications, the hardware security module 53 can be mapped to the corresponding local master key when generating the second ciphertext. When the POS terminal background management 51 returns the second ciphertext, it can be linked to the corresponding local master key according to the mapping relationship. In this example, the decryption result includes the bank card password and the bank card identifier sent by the POS terminal 52. In one example, the national secret password envelope can also match the bank card identifier in the decryption result with the bank card identifier sent by the POS terminal background management 51 to verify the consistency of the bank card identifier data. The solution of this example, decrypting the second ciphertext through the local master key of the hardware security module, can improve the security of the national secret envelope encapsulation.

[0088] As yet another example, the national secret code envelope includes a flag bit;

[0089] The personal settlement platform 54 is also used to write a preset value in the flag bit of the national secret code envelope if the national secret code envelope verification is passed; if the national secret code envelope verification fails, no operation is performed.

[0090] In this example, the flag bit indicates the state of the national secret code envelope verification. For example, the flag bit is the preset value 1, indicating that the national secret code envelope verification has been passed; the flag bit is other values, indicating that it has not been verified or the verification has not passed. Specifically, the flag bit can only be written by the personal settlement platform 54 and is read-only during the transmission of the national secret code envelope. The solution of this example can quickly determine the state of the national secret code envelope verification through the flag bit of the national secret code envelope.

[0091] As another example, the POS terminal background management 51 is also used to generate a work key update instruction when an update scenario trigger is detected; wherein the update scenario includes at least one of the following: the usage time of the POS terminal 52 is greater than the preset time, the bank card account has an in-bank or out-of-bank dishonesty record, the bank card account has a clearing abnormality, the cumulative amount of private transfers from the bank card account is greater than a first preset amount, and the cumulative amount of public transfers from the bank card account is greater than a second preset amount; wherein the first preset amount is greater than the second preset amount.

[0092] In actual application, the preset time can be set to 5 hours or 6 hours, or the preset time can be adjusted according to the number of times the same POS terminal 52 is accessed. If the number of accesses exceeds 10 times, the preset time will be reduced from 5 hours to 4 hours. On the other hand, the bank card account's internal dishonesty record can be obtained through the bank's dishonesty maintenance list; the bank card account's external dishonesty list can be queried through a website or public documents. On the other hand, the clearing black list established by the bank can also be accessed to check whether there is a clearing anomaly in the bank card account. On the other hand, by setting the first preset amount corresponding to the private transfer to be greater than the second preset amount corresponding to the public transfer, the security of the public transfer can be improved. In actual application, the first preset amount can be set to 1 million yuan or 1.2 million yuan, and the second preset amount can be set to 500,000 yuan or 600,000 yuan. As an example, when another update scenario is triggered 5 to 10 minutes after any of the above update scenarios is triggered, the generation time of the work key update instruction corresponding to the other scenario trigger can be postponed to improve the rationality of the work key update. The solution of this example provides different triggering scenarios for generating work key update instructions, which can improve the security of the key management system.

[0093] The key management system provided in this embodiment includes: the POS terminal background management calls the key generation interface of the POS terminal to enable the password keyboard of the POS terminal to generate a public-private key pair and return the public key, and forwards the public key to the hardware security module and calls the hardware security module to generate a first working key; the hardware security module encrypts the first working key based on the public key to generate a first ciphertext and a key verification value corresponding to the first working key and sends it to the POS terminal; after receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key and updates the current working key to the first working key; the hardware security module encrypts the first working key in the encryption machine format to generate a second ciphertext and sends it to the POS terminal background management. In the solution of this application, the POS terminal background management is used for instruction scheduling, and the encryption and decryption of information are configured in the POS terminal and the hardware security module, which can realize remote and efficient update of the working key of the POS terminal.

[0094] Embodiment 3

[0095] Figure 8 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present application, and the electronic device includes:

[0096] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, the memory 292, and the communication interface 293 may communicate with each other through the bus 294. The communication interface 293 may be used for information transmission. The processor 291 may call the logic instructions in the memory 292 to execute the above-mentioned example method.

[0097] In addition, the logic instructions in the above-mentioned memory 292 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0098] The memory 292 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, implementing the methods in the above method examples.

[0099] The memory 292 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 292 may include a high-speed random access memory and may also include a non-volatile memory.

[0100] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method in any embodiment.

[0101] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in any embodiment when executed by a processor.

[0102] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0103] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A key updating method, characterized in that: Applied to a key management system, the key management system includes POS terminal background management, POS terminal and hardware security module; the method includes: When the POS terminal background management detects a working key update instruction of the POS terminal, the POS terminal background management calls the key generation interface of the POS terminal so that the password keyboard of the POS terminal generates a public-private key pair and returns a public key; the POS terminal background management forwards the public key to the hardware security module and calls the working key generation interface of the hardware security module; The hardware security module generates a first working key after the working key generation interface is called, and generates a first ciphertext after encrypting the first working key based on the public key, and sends the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal; the hardware security module encrypts the first working key in an encryption machine format to generate a second ciphertext to the POS terminal background management; wherein the hardware security module obtains the current working key based on the second ciphertext; After receiving the first ciphertext and the key verification value, the POS terminal obtains the first working key based on the private key, and updates the current working key to the first working key.

2. The method according to claim 1, characterized in that The acquiring the first working key based on the private key includes: Decrypting the first ciphertext using the private key to obtain a second working key; After encrypting the preset verification character based on the second working key, a third ciphertext is obtained; The third ciphertext and the key check value are compared for consistency. If the comparison result is consistent, the second working key is used as the first working key; if the match fails, a corresponding warning is executed.

3. The method according to claim 1, characterized in that The system further includes a personal settlement platform; the method further includes: When the POS terminal detects a card transaction, the POS terminal encrypts the identifier and password of the bank card based on the current working key to generate a fourth ciphertext, and sends the fourth ciphertext to the POS terminal backend management; The POS terminal backend management sends the fourth ciphertext, the bank card identifier corresponding to the fourth ciphertext, and the second ciphertext to the hardware security module, so that the hardware security module returns the national secret code envelope; the POS terminal backend management sends the bank card identifier and the national secret code envelope to the personal settlement platform; The personal settlement platform verifies the password based on the received bank card identifier and the national secret code envelope, and returns the verification result to the POS terminal through the POS terminal backend management.

4. The method according to claim 3, characterized in that The hardware security module includes a local master key, and the local master key is used to decrypt the second ciphertext generated after encryption in the encryption machine format; The hardware security module returns a national secret code envelope, including: The hardware security module uses the local master key to decrypt the second ciphertext to obtain a current working key, and uses the current working key to decrypt the fourth ciphertext to obtain a decryption result; The hardware security module performs national secret code envelope encapsulation based on the decryption result, and returns the national secret code envelope to the POS terminal backend management.

5. The system according to claim 3, characterized in that The national secret code envelope includes a flag bit; the method also includes: If the personal settlement platform detects that the national secret code envelope has passed the verification, a preset value is written into the flag bit of the national secret code envelope; if the national secret code envelope has failed the verification, no operation is performed.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the POS terminal background management detects that an update scenario is triggered, a working key update instruction is generated; wherein, the update scenario includes at least one of the following: the usage time of the POS terminal is greater than the preset time, the bank card account has an in-bank or out-of-bank dishonesty record, the bank card account has a clearing abnormality, the cumulative amount of private transfers from the bank card account is greater than a first preset amount, and the cumulative amount of public transfers from the bank card account is greater than a second preset amount; wherein the first preset amount is greater than the second preset amount.

7. A key management system, characterized in that: include: POS terminal backend management, POS terminal and hardware security module; The POS terminal background management is used to call the key generation interface of the POS terminal when a working key update instruction of the POS terminal is detected, so that the password keyboard of the POS terminal generates a public-private key pair and returns the public key; POS terminal backend management, also used to forward the public key to the hardware security module and call the working key generation interface of the hardware security module; The hardware security module is used to generate a first working key after the working key generation interface is called, and to generate a first ciphertext after encrypting the first working key based on the public key, and to send the first ciphertext and the key verification value corresponding to the first working key to the POS terminal background management, so that the POS terminal background management forwards the first ciphertext and the key verification value to the POS terminal; The hardware security module is further used to send the second ciphertext generated by encrypting the first working key in the encryption machine format to the POS terminal background management; wherein the hardware security module obtains the current working key based on the second ciphertext; The POS terminal is configured to, after receiving the first ciphertext and the key verification value, obtain the first working key based on the private key, and update the current working key to the first working key.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Intelligent POS terminal main key updating system and updating method

    CN104954123A

  • Terminal master key setting method and apparatus

    CN106571915A

  • POS terminal remote key updating system and updating method

    CN106961326A

  • Hardware equipment key management method and system, storage medium and computer equipment

    CN110460436A

  • Method for safely and automatically downloading terminal master key in bank card payment system and the system thereof

    WO2010148646A1

Cited By

  • Implementation method and apparatus for key import and key usage

    WO2026118116A1