POS machine key management system and method

By adopting blockchain technology and smart contracts in POS machines, distributed key management is realized, which solves the problems of low efficiency and centralized management of POS key updates, and enhances the anti-compilation and modification capabilities of keys.

CN119863243AActive Publication Date: 2025-04-22SHANGHAI SHIMAI INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510332572.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-04-22
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

Existing POS machines are inefficient in key updates and cannot adapt to the high-frequency key update requirements. Due to the centralized characteristics, it is difficult to effectively prevent and control key corrections.

Method used

Using blockchain technology and smart contracts, node addresses are registered in the blockchain network through POS machine terminal devices and backend systems to realize distributed key management. When the POS terminal device updates the key, the transaction trigger module provides the terminal node address to the contract module. The contract module conducts blockchain transactions to generate public and private keys, and stores them in the blockchain ledger.

Benefits of technology

It realizes that POS machines can update keys without cumbersome online interaction or offline check-in, reducing the efficiency of key updates, and enhancing the anti-compilation and modification capabilities of keys through distributed management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863243A_ABST
    Figure CN119863243A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data communication, in particular to a POS machine key management system and method. The key management system comprises a transaction triggering module and a contract module. When the system runs, the transaction triggering module provides a terminal node address for the contract module and triggers the contract module when updating the secret key. The contract module performs block chain transaction according to the terminal node address to generate a public key and a private key, the public key is published in a transaction result of the block chain transaction, the private key is stored in a node account book, and the POS terminal device and the POS background system obtain the public key according to the transaction result and obtain the private key according to the node account book. According to the method, the problem of low key updating efficiency in the prior art is solved, additional computing power requirements cannot be brought to the POS machine, distributed management of the keys of the POS machine is realized, and the anti-tampering capability of the keys of the POS machine is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communications, and in particular to a POS machine key management system and method. Background Art

[0002] A POS machine is a payment terminal device. Due to its hardware configuration limitations, it usually does not have very high computing power. Therefore, when it is attacked, it is difficult to detect and intercept it effectively like a computer system, resulting in the leakage of transaction information and even malicious manipulation to cause property loss.

[0003] At present, in order to solve the communication data security problem of POS machines, the elliptic cryptographic algorithm (ECC) based on asymmetric keys is usually used to encrypt the session process. The encryption process requires the use of two keys, namely the public key and the private key. The sender uses the private key to encrypt the data, and the receiver uses the sender's public key to verify and decrypt the data.

[0004] However, once the key is leaked or tampered with, there will be a risk of data leakage or the key being imitated for malicious operations. Current POS machines usually update keys through online interaction or offline sign-in with regional centers, which cannot adapt to the high-frequency key update needs. Due to its centralized nature, the prevention and control measures for key tampering are also difficult to have a good effect, and rely on the trust level of the regional center. The data security of POS machines still has certain risks. Summary of the invention

[0005] The present application provides a POS machine key management system and method. In a first aspect, the POS machine key management system provided by the present application includes a transaction trigger module and a contract module.

[0006] When the POS terminal device updates the key, the transaction trigger module provides the terminal node address of the POS terminal device to the contract module and triggers the contract module. The terminal node address is the address of the node registered by the POS terminal device in the blockchain network.

[0007] The contract module performs a blockchain transaction according to the terminal node address to generate a public key and a private key. The public key is published in the transaction result of the blockchain transaction, and the private key is stored in the node account book corresponding to the terminal node address and the background node address. The POS terminal device and the POS background system obtain the public key according to the transaction result and obtain the private key according to the node account book. The background node address is the node address registered by the POS background system in the blockchain network.

[0008] Specifically, the transaction trigger module is deployed in the POS terminal device, and the contract module is deployed in the POS backend system.

[0009] Specifically, the system also includes a node registration module, which is used to register the POS terminal device as a terminal node in the blockchain network, and register the POS backend system as a backend node in the blockchain network. The terminal node address of the terminal node is stored in the POS terminal device, and the backend node address of the backend node is stored in the POS backend system.

[0010] Specifically, the node registration module is deployed in the POS machine backend system.

[0011] Specifically, the contract module is provided with a trigger condition verification program unit, and the trigger condition verification program unit authenticates the background node address.

[0012] Specifically, a key update program unit is provided in the transaction trigger module, which is used to obtain the public key from the transaction result, and obtain the private key whose generation time is closest to the POS system time from the node ledger corresponding to the terminal node address of the POS terminal device in the blockchain network and delete other private keys in the node ledger.

[0013] Specifically, the transaction trigger module is provided with an automatic trigger program unit, which is used to send a terminal node address and a transaction request signal to the contract module according to the set trigger condition to trigger the contract module.

[0014] Specifically, a key update program unit and an automatic trigger program unit are provided in the transaction trigger module. The automatic trigger program unit obtains the transaction status in the transaction result corresponding to the sending time from the blockchain network according to the sending time of the transaction request signal. When the transaction status is successful, the automatic trigger program unit activates the key update program unit to update the key. When the transaction status is failed, the automatic trigger program unit re-sends the terminal node address and the transaction request signal to the contract module.

[0015] Specifically, the contract module is provided with a key generation program unit. When the blockchain transaction is performed, the key generation program unit inputs the dynamic parameter into the hash function output and the output belongs to the range [1, n -1] k Get the private key, where n The preset elliptic curve base point G The hash result is calculated k The base point of the elliptic curve G The scalar product ofK = k · G , the dynamic parameters include the timestamp when the transaction trigger module sends the terminal node address, the terminal node address and the hash adjustment value.

[0016] In a second aspect, a POS machine key management method provided by the present application is operated using the system as described above, comprising the following steps: When the POS terminal device updates the key, the terminal node address of the POS terminal device is obtained; Conducting a blockchain transaction according to the terminal node address to generate a public key and a private key; The public key is published in the transaction result of the blockchain transaction, and the private key is stored in the node account book corresponding to the terminal node address and the background node address; The POS terminal device and the POS backend system obtain the public key according to the transaction result, and obtain the private key according to the node account book.

[0017] This application has the following technical effects: The problem of low key update efficiency in the prior art is overcome, and a system is provided in which a POS machine can update keys without cumbersome online interaction or offline sign-in process, and the system does not bring additional computing power requirements to the POS machine; The system overcomes the problem of centralized key management in the prior art, realizes distributed management of POS machine keys, and enhances the anti-tampering capability of POS machine keys. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-restrictive manner, and the same or corresponding numbers represent the same or corresponding parts.

[0019] Figure 1 This is a structural diagram of the POS machine key management system in the embodiment of the present application; Figure 2 It is a flow chart of the POS machine key management method in the embodiment of the present application. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0021] The POS machine of this application uses a Quad-core Cortex®-A7 processor, equipped with 1GB of running memory and a main frequency of 1GHz. It can run smoothly in the daily transaction scenarios of the POS machine, but it cannot cope with the computing tasks during the operation of the blockchain, nor can it run complex program codes. Therefore, in order not to cause an operating burden on the POS machine, this embodiment only deploys a lightweight interface program in the POS machine, grabs key data from the blockchain through the TLS network, and sends signals to the background system of the POS machine. The complete functional code of the blockchain is deployed in the background system of the POS machine, which is operated and managed by the regional center.

[0022] Based on this, the POS machine key management system used in this embodiment adopts the following method: Figure 1 The framework shown in the figure is constructed, and the core functions are performed by the transaction trigger module and the contract module.

[0023] When the POS terminal device updates the key, the transaction trigger module provides the terminal node address of the POS terminal device to the contract module and triggers the contract module. Then the contract module performs a blockchain transaction based on the terminal node address to generate a public key and a private key. The public key is published in the transaction result of the blockchain transaction, and the private key is stored in the node account book corresponding to the terminal node address and the background node address. The POS terminal device and the POS background system obtain the public key based on the transaction result and the private key based on the node account book. The background node address is the node address registered by the POS background system in the blockchain network.

[0024] The blockchain used in this embodiment is the Corda private chain, because its node-based architecture mode is more in line with the distribution mode of POS machines and POS machine backend systems, and the confidential node mechanism of the Corda private chain enables only the POS machines and POS machine backend systems that participate in the key update process to obtain transaction information, thereby avoiding key leakage during key transfer during the key update process.

[0025] Specifically, this embodiment is developed based on the Android platform. By adding the Corda dependency library to the Android project, the program that sends the transaction request signal from the POS machine to the POS machine background is encapsulated as an interface for repeated calls. It can also be automatically called according to the set conditions, for example, when the number of consecutive transactions of the POS machine reaches the limit value, the time from the last key update of the POS machine reaches the limit time, and it is triggered at a fixed frequency. A transaction trigger module with this interface is installed in the POS machine, and the transaction request signal and the terminal node address of the POS machine can be sent to the POS machine background through the POS machine to trigger the POS machine background to generate and issue keys. The POS machine background, as a high-computing power node, is responsible for deploying programs related to the contract module and handling the complex tasks of key generation and issuance. Such a design reduces the operating burden of the POS machine to the greatest extent, realizes the automatic key update of the POS machine, does not require cumbersome manual operations, and can cope with high-frequency key update requirements.

[0026] In this embodiment, the function of key generation and issuance is realized by using smart contracts during blockchain transactions. First, it is necessary to register the POS terminal device as a terminal node in the blockchain network through the node registration module, and register the POS backend system as a backend node in the blockchain network. The terminal node address of the terminal node is stored in the POS terminal device, and the backend node address of the backend node is stored in the POS backend system. Because the Corda private chain is developed based on the Java language, the function of the node registration module is executed by the POS backend system, and a configuration file is created in the node registration module for each POS machine in the area covered by the POS backend system, including the node identifier myLegalName of the POS machine, the communication address and port p2pAddress, the remote call address rpcSettings, the database port h2port and other information, and the identity key and digital certificate for blockchain communication are generated for the POS machine and the POS backend system through the corda-tools-network-bootstrapper command. It is worth noting that the identity key here is used for identity authentication when the POS machine and the POS backend communicate in the blockchain network, which is not the same concept as the public key and private key finally generated by the key management system of this embodiment. Each POS machine will have a unique, non-repetitive terminal node address when it leaves the factory, which is stored in the hardware encryption module of the POS machine. When an attacker attempts to create a new node in the blockchain network, due to the consensus mechanism of the Corda private chain, it can only be successfully created when all trusted nodes pass, thus effectively reducing the risk of blockchain attacks.

[0027] In order to further protect the contract module from malicious calls, the contract module is also provided with a trigger condition verification program unit, which authenticates the background node address. When the POS machine sends a transaction request signal and a terminal node address to the POS machine background, the POS machine background sends the terminal node address and the background node address to the contract module through an encrypted network. The contract module first obtains the digital certificate information in the terminal node address and the background node address through the identity key of the POS machine node and the POS machine background node. When the authenticity of the digital certificate information of the two nodes is verified, the contract module will trigger the blockchain transaction according to the contract content, otherwise it will directly send an alarm signal to the POS machine and the POS machine background system.

[0028] After the contract module executes the blockchain transaction according to the contract content, if the transaction is successful, the contract module will publish the public key and the transaction success mark in the transaction result, and if the transaction fails, the transaction failure mark will be published in the transaction result. After the transaction is successful, the public key in the transaction result can be directly accessed and viewed by the POS machine and the POS machine background system, and the private key is stored in the node account book by modifying the node account book of the POS machine and the POS machine background system. The transaction trigger module of the POS machine is provided with a corresponding key update program unit, which obtains the public key from the transaction result through the interface program, and obtains the private key with the generation time closest to the POS machine system time from the node account book corresponding to the terminal node address of the POS terminal device in the blockchain network and deletes other private keys in the node account book. The POS machine background system directly accesses the transaction result to obtain the public key, and directly accesses the node account book of the POS machine background to obtain the private key. When accessing the node account book, the contract module also needs to authenticate the identity of the POS machine and the POS machine background system to avoid key leakage. Since the ledger data is stored in a distributed manner in the blockchain, each block contains a hash value and a timestamp. Once the ledger data of a block is tampered with, its hash value and the hash values ​​of all subsequent blocks will change accordingly, and the timestamp of the block will also become different from other blocks. Therefore, if you want to tamper with a part of the ledger data, you need to tamper with the data of the entire chain of related blocks in the ledger, which is computationally impossible. Therefore, generating public and private keys through blockchain transactions can effectively prevent the keys from being maliciously tampered with.

[0029] According to different business needs, the logic of automatic triggering can be set for the transaction triggering process. The transaction triggering module of this embodiment is provided with an automatic triggering program unit, which is used to send the terminal node address and the transaction request signal to the contract module according to the set triggering conditions to trigger the contract module. For example, when the number of consecutive transactions of the POS machine reaches the limit value, the time from the last key update of the POS machine reaches the limit time, and the fixed frequency triggering is met, the transaction triggering module automatically sends the terminal node address and the transaction request signal to the contract module.

[0030] Furthermore, each time the automatic triggering program unit sends the terminal node address and transaction request signal to the contract module, it will call the interface to obtain the transaction status in the transaction result corresponding to the sending time from the blockchain network according to the sending time of the transaction request signal. When the transaction status is successful, the automatic triggering program unit activates the key update program unit to update the key. When the transaction status is failed, the automatic triggering program unit re-sends the terminal node address and transaction request signal to the contract module.

[0031] In this embodiment, considering that the gas consumption during contract execution should be reduced as much as possible under the blockchain operation conditions, the inventor of this application designed such a key generation program unit in the contract module: when conducting a blockchain transaction, the key generation program unit inputs the dynamic parameter into the hash function output belonging to the range [1, n -1] k Get the private key, where n The preset elliptic curve base point G , calculate the hash result k Base points of elliptic curves G The scalar product of K = k · G , dynamic parameters include the timestamp, terminal node address and hash adjustment value when the transaction trigger module sends the terminal node address. When creating a contract, create a Kotlin file under the contracts module of Corda, and define the algorithm and call flow of contract execution in the Kotlin file. In this embodiment, p-384 is selected as the prime number domain because the calculation efficiency of the p-384 prime number domain is the highest, which can further reduce Gas consumption. p= , the elliptic curve is ,in, b To fix the ellipse parameters, mod pis the modulus of the p-384 prime field. The private key and public key length required in this embodiment should reach 256 bits, so the SHA-256 hash function of the Corda private chain is used. When the function is running, a hash object is first generated according to the timestamp, terminal node address and hash adjustment value (default is 1), and the SHA-256 function is called on the hash object to generate a hash result with a length of 256 bits. Check whether the hash result is in the range [1, n -1], if it is, the hash result is used as the private key, if not, the hash adjustment value is adjusted until the hash result falls within the range [1, n -1]. After testing, the Gas consumption when generating keys can be stabilized between 3000 and 35000, which reduces the running consumption of the contract module.

[0032] In summary, when using the POS machine key management system provided in this embodiment to manage keys, it includes the following steps: Figure 2 The execution steps shown include: S1. When the POS terminal device updates the key, the terminal node address of the POS terminal device is obtained; S2. Conduct blockchain transactions based on the terminal node address to generate public and private keys; S3. Publish the public key in the transaction result of the blockchain transaction, and store the private key in the node account book corresponding to the terminal node address and the background node address; S4, POS terminal equipment and POS backend system obtain the public key according to the transaction results and obtain the private key according to the node ledger.

[0033] Obviously, the embodiments described above are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0034] It should be understood that when the terms "first", "second", etc. are used in the claims, specification and drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

Claims

1. A POS machine key management system, characterized in that: Including transaction trigger module and contract module; When the POS terminal device updates the key, the transaction trigger module provides the terminal node address of the POS terminal device to the contract module and triggers the contract module, wherein the terminal node address is the address of the node registered by the POS terminal device in the blockchain network; The contract module performs a blockchain transaction according to the terminal node address to generate a public key and a private key. The public key is published in the transaction result of the blockchain transaction, and the private key is stored in the node account book corresponding to the terminal node address and the background node address. The POS terminal device and the POS background system obtain the public key according to the transaction result and obtain the private key according to the node account book. The background node address is the node address registered by the POS background system in the blockchain network.

2. The system according to claim 1, characterized in that The transaction trigger module is deployed in the POS terminal device, and the contract module is deployed in the POS backend system.

3. The system according to claim 1, characterized in that The system also includes a node registration module, which is used to register the POS terminal device as a terminal node in the blockchain network, and register the POS backend system as a backend node in the blockchain network. The terminal node address of the terminal node is stored in the POS terminal device, and the backend node address of the backend node is stored in the POS backend system.

4. The system according to claim 3, characterized in that The node registration module is deployed in the POS machine background system.

5. The system according to claim 3, characterized in that The contract module is provided with a trigger condition verification program unit, and the trigger condition verification program unit authenticates the background node address.

6. The system according to claim 1, characterized in that The transaction trigger module is provided with a key update program unit, which is used to obtain the public key from the transaction result, and obtain the private key whose generation time is closest to the POS system time from the node account book corresponding to the terminal node address of the POS terminal device in the blockchain network and delete other private keys in the node account book.

7. The system according to claim 1, characterized in that The transaction trigger module is provided with an automatic trigger program unit, which is used to send a terminal node address and a transaction request signal to the contract module according to the set trigger conditions to trigger the contract module.

8. The system according to claim 1, characterized in that The transaction trigger module is provided with a key update program unit and an automatic trigger program unit. The automatic trigger program unit obtains the transaction status in the transaction result corresponding to the sending time from the blockchain network according to the sending time of the transaction request signal. When the transaction status is successful, the automatic trigger program unit activates the key update program unit to update the key. When the transaction status is failed, the automatic trigger program unit re-sends the terminal node address and the transaction request signal to the contract module.

9. The system according to claim 1, characterized in that The contract module is provided with a key generation program unit. When the blockchain transaction is performed, the key generation program unit inputs the dynamic parameter into the hash function output belonging to the range [1, n -1] k Get the private key, where n The preset elliptic curve base point G The hash result is calculated k The base point of the elliptic curve G The scalar product of K = k · G , the dynamic parameters include the timestamp when the transaction trigger module sends the terminal node address, the terminal node address and the hash adjustment value.

10. A POS machine key management method, using the system according to any one of claims 1 to 9, characterized in that: The following steps are involved: When the POS terminal device updates the key, the terminal node address of the POS terminal device is obtained; Conducting a blockchain transaction according to the terminal node address to generate a public key and a private key; The public key is published in the transaction result of the blockchain transaction, and the private key is stored in the node account book corresponding to the terminal node address and the background node address; The POS terminal device and the POS backend system obtain the public key according to the transaction result, and obtain the private key according to the node account book.

Citation Information

Patent Citations

  • Blockchain-based transaction method and a blockchain-based transaction system

    CN109767220A

  • Aggregated payment method and system for digital currencies, and edge server

    CN111937020A

  • Key processing method and device based on block chain system, medium and electronic equipment

    CN116015614A

  • Key determination method and device, computer equipment and storage medium

    CN116132065A

  • Pos machine settlement business data management system based on block chain

    CN117592985A