A method, a collection device and an apparatus for preventing double offline transaction amounts from being tampered with
By using a shared key or public/private key mechanism to encrypt and verify the transaction amount in the payment device, the problem of tampering with the transaction amount of digital currency is solved, improving transaction security and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING NAT DIGITAL FINANCIAL TECH TESTING CENT CO LTD
- Filing Date
- 2022-07-11
- Publication Date
- 2026-06-05
AI Technical Summary
In existing cryptocurrency transactions, transaction amounts are easily tampered with by malicious software, resulting in over-deductions from the payer's balance.
The payment device uses a shared key or public/private key between the keyboard and security chip to verify the transaction amount through encryption and signature mechanisms, generating offline payment initialization information to ensure the security of the transaction amount.
It effectively prevents transaction amounts from being tampered with, improves the security and user experience of digital currency transactions, and avoids situations where the payer's balance is over-deducted.
Smart Images

Figure CN115422558B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer information processing, and more specifically, to a digital currency payment method, apparatus, and system based on a hardware cloud wallet. Background Technology
[0002] Digital currency is a form of money that converts cash into a series of electronically encrypted sequences. The security of the currency itself relies on cryptographic algorithms for protection. In terms of cryptographic algorithms, the security of digital currency systems involves symmetric cryptography, asymmetric cryptography, message digest algorithms, and identity-based cryptography. System implementation must deeply consider the overall security of the cryptographic system, the selection of cryptographic algorithms, the implementation of cryptographic algorithms, the design of interaction protocols, and compatibility with international and domestic standards to ensure the security of digital currency transactions.
[0003] The People's Bank of China has also launched the digital form of legal tender, the digital yuan, which is equivalent to paper money and coins, has value characteristics and legal tender status, supports controlled anonymity, and is gradually being applied to various transaction scenarios in life.
[0004] In current practical applications, the receiving device inputs the payment amount via keyboard, which then generates payment initialization data for the paying device. The paying device then makes the payment based on this data. However, sometimes, due to malware intrusion into the receiving device, the amount entered can be maliciously altered, resulting in over-deduction from the paying device's balance. Summary of the Invention
[0005] This invention aims to address the problem that transaction amounts in existing digital currencies may be tampered with by malicious software during the transaction process.
[0006] To address the aforementioned technical problems, the first aspect of this invention proposes a method for preventing the tampering of transaction amounts in offline digital currency transactions, the method comprising:
[0007] The recipient enters the payment amount using the keyboard of the payment device;
[0008] The security chip of the payment device verifies the amount received. After the verification is successful, the security chip of the payment device generates offline payment initialization information based on the amount received and sends the offline payment initialization information to the payment device.
[0009] The payment device receives the payment initialization information and executes a dual offline transaction.
[0010] According to a preferred embodiment of the present invention, the keyboard and security chip of the payment device share a set of shared keys.
[0011] According to a preferred embodiment of the present invention, the verification of the payment amount by the security chip of the payment device further includes:
[0012] The keyboard uses the shared key to encrypt the received amount, generating first encrypted information;
[0013] The first encrypted information is sent to the security chip of the payment device;
[0014] The security chip of the payment device uses the shared key to decrypt the first encrypted information, obtain the payment amount, and use the payment amount to generate offline payment initialization information.
[0015] According to a preferred embodiment of the present invention, the keyboard of the payment device generates a set of public and private keys, and sends the public key to the security chip of the payment device.
[0016] According to a preferred embodiment of the present invention, the verification of the payment amount by the security chip of the payment device further includes:
[0017] The keyboard uses the private key to sign the received amount to obtain a digital signature, generating second encrypted information;
[0018] The second encrypted information is sent to the security chip of the payment device, wherein the second encrypted information includes the payment amount and the digital signature;
[0019] The security chip of the payment device uses the public key to verify the digital signature in the second encrypted information. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0020] According to a preferred embodiment of the present invention, the keyboard and security chip of the payment device share a set of shared keys, and the keyboard of the payment device generates a set of public and private keys, and sends the public key to the security chip of the payment device.
[0021] According to a preferred embodiment of the present invention, the keyboard uses the private key to sign the received amount to obtain a digital signature, and uses the shared key to encrypt the received amount and the digital signature to generate third encrypted information;
[0022] The third encrypted information is sent to the security chip of the payment device;
[0023] The security chip of the payment device uses the shared key to decrypt the third encrypted information to obtain the payment amount and the digital signature;
[0024] The security chip of the payment device uses the public key to verify the digital signature. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0025] A second aspect of this invention provides a payment receiving device to prevent tampering with the amount of offline transactions, for offline digital currency transactions, the payment receiving device comprising:
[0026] The keyboard is connected to the security chip and stores a shared key that is shared with the security chip. The shared key is used to encrypt the amount of payment entered by the user, generate first encrypted information, and send the first encrypted information to the security chip.
[0027] The security chip receives the first encrypted information, decrypts the first encrypted information using the shared key, obtains the payment amount, and generates payment initialization information based on the payment amount.
[0028] A third aspect of this invention provides a payment receiving device to prevent tampering with the amount of offline transactions, used for offline digital currency transactions, the payment receiving device comprising:
[0029] The keyboard is connected to a security chip and stores a private key. The private key is used to sign the amount of payment entered by the user to obtain a digital signature. A second encrypted message is generated based on the amount of payment and the digital signature, and the second encrypted message is sent to the security chip.
[0030] The security chip stores a public key generated by the keyboard that corresponds to the private key. The public key is used to verify the digital signature in the second encrypted information. After successful verification, payment initialization information is generated based on the amount received.
[0031] A fourth aspect of this invention provides a payment receiving device to prevent tampering with the amount of offline transactions, for offline digital currency transactions, characterized in that the payment receiving device comprises:
[0032] The keyboard is connected to a security chip and stores a private key and a shared key. The private key is used to sign the amount of payment entered by the user to obtain a digital signature. The shared key is used to encrypt the amount of payment and the digital signature to generate third encrypted information, and the third encrypted information is sent to the security chip.
[0033] The security chip stores a public key and a shared key generated by the keyboard corresponding to the private key. The shared key is used to decrypt the third encrypted information to obtain the payment amount and the digital signature. The public key is used to verify the digital signature. After successful verification, payment initialization information is generated based on the payment amount.
[0034] The fifth aspect of this invention provides an apparatus for preventing the alteration of transaction amounts in offline digital currency transactions, the apparatus comprising:
[0035] The input module is designed for recipients to input the amount to be received using the keyboard of their payment device.
[0036] The verification module is used to verify the payment amount by the security chip of the payment device. After the verification is successful, the security chip of the payment device generates offline payment initialization information based on the payment amount and sends the offline payment initialization information to the payment device.
[0037] The payment execution module is used by the payment device to receive the payment initialization information and execute dual offline transactions.
[0038] By adopting this technical solution, the receiving device will encrypt and verify the entered amount during transactions, which improves the security of digital currency hardware wallets, prevents the payer's balance from being over-deducted, significantly enhances the user experience of using hardware wallets, and cultivates users' habit of using hardware wallets for digital RMB payments. Attached Figure Description
[0039] To make the technical problems solved by this invention, the technical means adopted, and the technical effects achieved clearer, specific embodiments of this invention will be described in detail below with reference to the accompanying drawings. However, it should be noted that the drawings described below are merely drawings of exemplary embodiments of this invention. Those skilled in the art can obtain drawings of other embodiments based on these drawings without any creative effort.
[0040] Figure 1 This is a flowchart illustrating the process of a digital currency wallet conducting transactions according to an embodiment of the present invention.
[0041] Figure 2 This is a schematic flowchart of a method for preventing the amount of offline transactions from being tampered with in an embodiment of the present invention.
[0042] Figure 3 This is a schematic diagram of the structure of a payment receiving device in an embodiment of the present invention to prevent the amount of transactions in dual offline transactions from being tampered with;
[0043] Figure 4 This is a schematic diagram of the device for preventing the amount of offline transactions from being tampered with in an embodiment of the present invention;
[0044] Figure 5 This is a schematic diagram of the structural framework of a system for preventing the alteration of transaction amounts in dual offline transactions, as described in this embodiment of the invention.
[0045] Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. Detailed Implementation
[0046] Exemplary embodiments of the invention will now be described more fully with reference to the accompanying drawings. While these exemplary embodiments can be implemented in various specific ways, they should not be construed as limiting the invention to the embodiments set forth herein. Rather, these exemplary embodiments are provided to make the content of the invention more complete and to facilitate a full communication of the inventive concept to those skilled in the art.
[0047] Subject to the inventive concept, the structures, performance, effects or other features described in a particular embodiment may be combined in any suitable manner with one or more other embodiments.
[0048] In the description of specific embodiments, detailed descriptions of structures, performance, effects, or other features are provided to enable those skilled in the art to fully understand the embodiments. However, this does not preclude those skilled in the art from implementing the present invention with technical solutions that do not contain the aforementioned structures, performance, effects, or other features under specific circumstances.
[0049] The flowcharts in the accompanying drawings are merely illustrative examples and do not imply that the solution of this invention must include all the content, operations, and steps shown in the flowcharts, nor do they imply that the execution must be performed in the order shown in the diagrams. For example, some operations / steps in the flowcharts can be decomposed, some operations / steps can be combined or partially combined, etc. Without departing from the inventive spirit of this invention, the execution order shown in the flowcharts can be changed according to the actual situation.
[0050] The box in the attached diagram Figure 1 Generally, these refer to functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processing unit devices and / or microcontroller devices.
[0051] The same reference numerals in the accompanying drawings denote the same or similar elements, components, or parts, and therefore, repeated descriptions of the same or similar elements, components, or parts may be omitted below. It should also be understood that although terms such as first, second, third, etc., indicating numbers may be used herein to describe various devices, elements, components, or parts, these devices, elements, components, or parts should not be limited by these terms. That is, these terms are only used to distinguish one from another. For example, a first device may also be referred to as a second device, without departing from the essential technical solution of the invention. Furthermore, the terms "and / or" and "and / or" refer to all combinations including any one or more of the listed items.
[0052] Figure 1 This is a flowchart illustrating the transaction process of a digital currency wallet according to an embodiment of the present invention. Figure 1 As shown, digital currency wallets can conduct transactions even when both devices are offline. The process is as follows:
[0053] S101, A transaction occurs;
[0054] S102. The payer sends its own information to the payee, including hardware ID, key, certificate, etc.
[0055] S103. The payee verifies the identity of the payer based on the received payer information. If successful, proceed to S106; otherwise, proceed to S104.
[0056] S104. Identity verification failed, payer's wallet is abnormal, transaction terminated and feedback information sent to payer.
[0057] S105. The payer receives the feedback information, and the transaction is terminated.
[0058] S106. Identity verification passed. The payee enters the transaction amount, generates offline payment initialization information based on the transaction amount, and sends its own identity information and payment initialization information to the payer.
[0059] S107. The payer verifies the identity of the payee based on the received payee information. If successful, proceed to S110; otherwise, proceed to S108.
[0060] S108. Identity verification failed, recipient's wallet is abnormal, transaction terminated and information is sent to recipient;
[0061] S109. The recipient receives feedback information, and the transaction is terminated.
[0062] S110 authentication passed, and expenditure vouchers were generated and sent based on offline payment initialization information;
[0063] S111. The payee verifies the payment voucher. If it passes, proceed to S114; otherwise, proceed to S112.
[0064] S112. If the payment voucher fails to be verified, the transaction is terminated and the information is sent back to the payer.
[0065] S113. The payer receives feedback information, and the transaction is terminated;
[0066] S114. Once the payment voucher is verified and the payment is received, a transaction receipt is sent to the payer.
[0067] S115. The payer receives the transaction receipt, and the payment is completed.
[0068] Each cryptocurrency wallet has a unique wallet ID. The wallet ID is unique and serves as the receiving address during transactions, similar to a bank card number used for online transactions. This wallet ID allows for accurate and specific identification of the cryptocurrency transaction.
[0069] Transaction elements include the wallet ID, key, and certificate associated with the digital currency wallet. The wallet ID is the transaction address, which is unique and can accurately locate the terminal participating in the transaction. During a transaction, the key and certificate verify the legitimacy and security of the transaction, ensuring the security of the transaction for both parties.
[0070] However, during the transaction, the amount entered into the receiving device may be tampered with by malicious software, resulting in over-deduction of the payer's balance. Therefore, this application provides a method to prevent the alteration of transaction amounts in offline transactions, such as... Figure 2 As shown, for offline digital currency transactions, the method includes:
[0071] S201. The payee enters the amount to be received using the keyboard of the payment device.
[0072] During the transaction, the recipient enters the transaction amount on the keyboard of the receiving device. The keyboard can be a physical keyboard or a touch screen.
[0073] In this embodiment, to enhance transaction security, an authentication unit can be installed on the keyboard to authenticate the user's identity. The authentication unit includes password verification and / or biometric verification. Only after successful authentication can the user enter the transaction amount on the keyboard.
[0074] S202. The security chip of the receiving device verifies the amount received. After the verification is successful, the security chip of the receiving device generates offline payment initialization information based on the amount received and sends the offline payment initialization information to the payment device.
[0075] Based on the above technical solution, the keyboard and security chip of the payment device further share a set of shared keys.
[0076] Based on the above technical solution, the security chip of the payment device further verifies the payment amount by including:
[0077] The keyboard uses the shared key to encrypt the received amount, generating first encrypted information;
[0078] The first encrypted information is sent to the security chip of the payment device;
[0079] The security chip of the payment device uses the shared key to decrypt the first encrypted information, obtain the payment amount, and use the payment amount to generate offline payment initialization information.
[0080] In this embodiment, a shared key is pre-stored in the security chip and keyboard of the payment device. After the transaction amount is entered on the keyboard, it is encrypted using the shared key to generate ciphertext. The ciphertext is sent to the security chip, which uses the shared key to decrypt it and obtain the plaintext of the transaction amount. Based on the plaintext of the transaction amount, offline payment initialization information is generated, and the payer deducts the balance according to the offline payment initialization information.
[0081] In this implementation, the transaction amount entered via keyboard is not transmitted to the security chip in plaintext, but rather encrypted using a shared key and transmitted in ciphertext. Even if malicious software exists, it cannot crack or forge the ciphertext without the shared key, thus ensuring the security of the transaction amount.
[0082] In other implementations, the security chip and keyboard of the payment device can store a shared key matrix, with each shared key having a corresponding key ID. Each time a transaction amount is entered, the keyboard can randomly select a shared key from the shared key matrix to encrypt the transaction amount. The encrypted key ID and the ciphertext of the encrypted transaction amount are then sent to the security chip, which selects the corresponding shared key based on the key ID for decryption.
[0083] Based on the above technical solution, the keyboard of the payment device further generates a set of public and private keys, and sends the public key to the security chip of the payment device.
[0084] Based on the above technical solution, the security chip of the payment device further verifies the payment amount by including:
[0085] The keyboard uses the private key to sign the received amount to obtain a digital signature, generating second encrypted information;
[0086] The second encrypted information is sent to the security chip of the payment device, wherein the second encrypted information includes the payment amount and the digital signature;
[0087] The security chip of the payment device uses the public key to verify the digital signature in the second encrypted information. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0088] In this embodiment, the keyboard of the payment device generates a public key and a private key, and sends the public key to the security chip. After the user enters the transaction amount through the keyboard, the keyboard uses the private key to digitally sign the transaction amount and sends the transaction amount and digital signature together to the security chip. The security chip uses the public key sent by the keyboard to verify the digital signature information. If the verification is successful, it means that the transaction amount is not counterfeit and is a genuine and valid transaction amount entered by the user. The security chip then uses the transaction amount to generate offline payment initialization information; otherwise, it means that the transaction amount is counterfeit and the transaction is stopped.
[0089] In this implementation, the public and private keys are generated by the keyboard and sent to the security chip before a transaction. Since the public key is used for verification and cannot be used for signing, even if malicious software obtains the public key, it cannot forge or sign the transaction amount. To enhance security, the keyboard can generate public and private keys periodically, such as once a day, once every four hours, etc. Alternatively, they can be generated before each transaction. A key generation unit can also be set on the keyboard; when a new public and private key is needed, the unit is triggered to generate it.
[0090] Based on the above technical solution, the keyboard and security chip of the payment device share a set of shared keys. At the same time, the keyboard of the payment device generates a set of public and private keys and sends the public key to the security chip of the payment device.
[0091] Based on the above technical solution, the keyboard further uses the private key to sign the received amount to obtain a digital signature, and uses the shared key to encrypt the received amount and the digital signature to generate third encrypted information;
[0092] The third encrypted information is sent to the security chip of the payment device;
[0093] The security chip of the payment device uses the shared key to decrypt the third encrypted information to obtain the payment amount and the digital signature;
[0094] The security chip of the payment device uses the public key to verify the digital signature. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0095] In this embodiment, the keyboard and security chip of the payment device pre-store a set of public keys. The keyboard also generates a set of public and private keys and sends the public key to the security chip. After the user enters the transaction amount via the keyboard, they first digitally sign it using the private key. Then, the shared key is used to encrypt the digital signature and the transaction amount, generating ciphertext containing the digital signature and the transaction amount, which is then sent to the security chip. The security chip first decrypts the transaction using the corresponding shared key to obtain the transaction amount and digital signature, and then verifies it using the public key corresponding to the private key to determine whether the transaction amount is genuine. If it passes verification, it generates offline payment initialization information based on the transaction amount.
[0096] In this implementation, a two-stage encryption method is used. First, a digital signature is performed using a private key, and then encryption is performed using a shared key, which maximizes the security of the transaction amount.
[0097] In other implementations, the security chip and keyboard of the payment device can store a shared key matrix, with each shared key having a corresponding key ID. Each time a transaction amount is entered, the keyboard can randomly select a shared key from the shared key matrix for encryption, and send the corresponding key ID upon transmission. The security chip then selects the corresponding shared key based on the key ID.
[0098] In other implementations, the keyboard can generate public and private keys periodically, such as once a day, once every 4 hours, etc. They can also be generated before each transaction, or a key generation unit can be set on the keyboard to generate new public and private keys when needed.
[0099] By encrypting and / or prefixing the transaction amount entered by the user with numbers, the possibility of the transaction amount being tampered with by malicious software is prevented, thus improving the user experience and security.
[0100] S203. The payment device receives the payment initialization information and executes a dual offline transaction.
[0101] Since the transaction amount cannot be maliciously altered, the receiving device can proceed with the normal process after receiving the offline payment initialization information, thus ensuring the security of the transaction for both parties.
[0102] Figure 3 This is a schematic diagram of the structure of a payment receiving device in an embodiment of the present invention to prevent the amount of transactions from being tampered with during offline transactions, as shown below. Figure 3 As shown:
[0103] In one embodiment, the payment receiving device 300 includes...
[0104] The keyboard 301 is connected to the security chip 302 and stores a shared key shared with the security chip 302. It uses the shared key to encrypt the amount of payment entered by the user, generates first encrypted information, and sends the first encrypted information to the security chip 302.
[0105] The security chip 302 receives the first encrypted information, decrypts the first encrypted information using the shared key, obtains the payment amount, and generates payment initialization information based on the payment amount.
[0106] In another embodiment, the payment device 300 includes,
[0107] The keyboard 301 is connected to the security chip 302 and stores a private key. The private key is used to sign the amount of payment entered by the user to obtain a digital signature. The second encrypted information is generated based on the amount of payment and the digital signature, and the second encrypted information is sent to the security chip 302.
[0108] The security chip 302 stores a public key generated by the keyboard 301 corresponding to the private key. The public key is used to verify the digital signature in the second encrypted information. After successful verification, payment initialization information is generated based on the amount received.
[0109] In another embodiment, the payment device 300 includes,
[0110] The keyboard 301 is connected to the security chip 302 and stores a private key and a shared key. The private key is used to sign the amount of payment entered by the user to obtain a digital signature. The shared key is used to encrypt the amount of payment and the digital signature to generate third encrypted information. The third encrypted information is then sent to the security chip 302.
[0111] The security chip 302 stores a public key and a shared key generated by the keyboard 301 corresponding to the private key. The shared key is used to decrypt the third encrypted information to obtain the payment amount and the digital signature. The public key is used to verify the digital signature. After successful verification, payment initialization information is generated based on the payment amount.
[0112] Figure 4 This is a schematic diagram of the device for preventing the alteration of transaction amounts in dual offline transactions according to an embodiment of the present invention, as shown below. Figure 4 As shown, the present invention provides a device 400 for preventing the alteration of transaction amounts in offline transactions, used for offline digital currency transactions. The device 400 includes:
[0113] Input module 401 is suitable for the payee to input the amount to be received using the keyboard of the payment device.
[0114] During the transaction, the recipient enters the transaction amount on the keyboard of the receiving device. The keyboard can be a physical keyboard or a touch screen.
[0115] In this embodiment, to enhance transaction security, an authentication unit can be installed on the keyboard to authenticate the user's identity. The authentication unit includes password verification and / or biometric verification. Only after successful authentication can the user enter the transaction amount on the keyboard.
[0116] The verification module 402 is used to verify the payment amount by the security chip of the payment device. After the verification is successful, the security chip of the payment device generates offline payment initialization information based on the payment amount and sends the offline payment initialization information to the payment device.
[0117] Based on the above technical solution, the keyboard and security chip of the payment device further share a set of shared keys.
[0118] Based on the above technical solution, the security chip of the payment device further verifies the payment amount by including:
[0119] The keyboard uses the shared key to encrypt the received amount, generating first encrypted information;
[0120] The first encrypted information is sent to the security chip of the payment device;
[0121] The security chip of the payment device uses the shared key to decrypt the first encrypted information, obtain the payment amount, and use the payment amount to generate offline payment initialization information.
[0122] In this embodiment, a shared key is pre-stored in the security chip and keyboard of the payment device. After the transaction amount is entered on the keyboard, it is encrypted using the shared key to generate ciphertext. The ciphertext is sent to the security chip, which uses the shared key to decrypt it and obtain the plaintext of the transaction amount. Based on the plaintext of the transaction amount, offline payment initialization information is generated, and the payer deducts the balance according to the offline payment initialization information.
[0123] In this implementation, the transaction amount entered via keyboard is not transmitted to the security chip in plaintext, but rather encrypted using a shared key and transmitted in ciphertext. Even if malicious software exists, it cannot crack or forge the ciphertext without the shared key, thus ensuring the security of the transaction amount.
[0124] In other implementations, the security chip and keyboard of the payment device can store a shared key matrix, with each shared key having a corresponding key ID. Each time a transaction amount is entered, the keyboard can randomly select a shared key from the shared key matrix to encrypt the transaction amount. The encrypted key ID and the ciphertext of the encrypted transaction amount are then sent to the security chip, which selects the corresponding shared key based on the key ID for decryption.
[0125] Based on the above technical solution, the keyboard of the payment device further generates a set of public and private keys, and sends the public key to the security chip of the payment device.
[0126] Based on the above technical solution, the security chip of the payment device further verifies the payment amount by including:
[0127] The keyboard uses the private key to sign the received amount to obtain a digital signature, generating second encrypted information;
[0128] The second encrypted information is sent to the security chip of the payment device, wherein the second encrypted information includes the payment amount and the digital signature;
[0129] The security chip of the payment device uses the public key to verify the digital signature in the second encrypted information. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0130] In this embodiment, the keyboard of the payment device generates a public key and a private key, and sends the public key to the security chip. After the user enters the transaction amount through the keyboard, the keyboard uses the private key to digitally sign the transaction amount and sends the transaction amount and digital signature together to the security chip. The security chip uses the public key sent by the keyboard to verify the digital signature information. If the verification is successful, it means that the transaction amount is not counterfeit and is a genuine and valid transaction amount entered by the user. The security chip then uses the transaction amount to generate offline payment initialization information; otherwise, it means that the transaction amount is counterfeit and the transaction is stopped.
[0131] In this implementation, the public and private keys are generated by the keyboard and sent to the security chip before a transaction. Since the public key is used for verification and cannot be used for signing, even if malicious software obtains the public key, it cannot forge or sign the transaction amount. To enhance security, the keyboard can generate public and private keys periodically, such as once a day, once every four hours, etc. Alternatively, they can be generated before each transaction. A key generation unit can also be set on the keyboard; when a new public and private key is needed, the unit is triggered to generate it.
[0132] Based on the above technical solution, the keyboard and security chip of the payment device share a set of shared keys. At the same time, the keyboard of the payment device generates a set of public and private keys and sends the public key to the security chip of the payment device.
[0133] Based on the above technical solution, the keyboard further uses the private key to sign the received amount to obtain a digital signature, and uses the shared key to encrypt the received amount and the digital signature to generate third encrypted information;
[0134] The third encrypted information is sent to the security chip of the payment device;
[0135] The security chip of the payment device uses the shared key to decrypt the third encrypted information to obtain the payment amount and the digital signature;
[0136] The security chip of the payment device uses the public key to verify the digital signature. After successful verification, it uses the payment amount to generate offline payment initialization information.
[0137] In this embodiment, the payment device's keyboard and security chip pre-store a set of public keys. The keyboard also generates a public key and a private key, and sends the public key to the security chip. After the user enters the transaction amount via the keyboard, they first digitally sign it using their private key. Then, they encrypt the digital signature and transaction amount using the shared key, generating ciphertext containing the digital signature and transaction amount, which is sent to the security chip. The security chip first decrypts the transaction using the corresponding shared key to obtain the transaction amount and digital signature, and then verifies it using the public key corresponding to the private key to determine if the transaction amount is genuine. If it passes verification, it generates offline payment initialization information based on the transaction amount.
[0138] In this implementation, a two-stage encryption method is used. First, a digital signature is performed using a private key, and then encryption is performed using a shared key, which maximizes the security of the transaction amount.
[0139] In other implementations, the security chip and keyboard of the payment device can store a shared key matrix, with each shared key having a corresponding key ID. Each time a transaction amount is entered, the keyboard can randomly select a shared key from the shared key matrix for encryption, and send the corresponding key ID upon transmission. The security chip then selects the corresponding shared key based on the key ID.
[0140] In other implementations, the keyboard can generate public and private keys periodically, such as once a day, once every 4 hours, etc. They can also be generated before each transaction, or a key generation unit can be set on the keyboard to generate new public and private keys when needed.
[0141] By encrypting and / or prefixing the transaction amount entered by the user with numbers, the possibility of the transaction amount being tampered with by malicious software is prevented, thus improving the user experience and security.
[0142] The payment execution module 403 is adapted to receive the payment initialization information and execute dual offline transactions.
[0143] Since the transaction amount cannot be maliciously altered, the receiving device can proceed with the normal process after receiving the offline payment initialization information, thus ensuring the security of the transaction for both parties.
[0144] like Figure 5 As shown, one embodiment of the present invention also discloses a system for preventing the alteration of transaction amounts in dual offline transactions. Figure 5 The system shown to prevent the alteration of transaction amounts in offline transactions is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0145] A system 500 for preventing tampering of offline transaction amounts includes a storage unit 520 for storing a computer-executable program; and a processing unit 510 for reading the computer-executable program in the storage unit to execute the steps of various embodiments of the present invention.
[0146] In this embodiment, the system 500 for preventing the alteration of offline transaction amounts also includes a bus 530 and a display unit 540 that connect different system components (including storage unit 520 and processing unit 510).
[0147] The storage unit 520 stores a computer-readable program, which may be source code or read-only code. The program can be executed by the processing unit 510, causing the processing unit 510 to perform the steps of various embodiments of the present invention. For example, the processing unit 510 can perform actions such as... Figure 2 The steps are shown.
[0148] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 5201 and / or a cache memory 5202, and may further include a read-only memory (ROM) 5203. The storage unit 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment.
[0149] Bus 530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0150] The system 500 for preventing tampering of offline transaction amounts can also communicate with one or more external devices 570 (e.g., keyboard, monitor, network device, Bluetooth device, etc.), enabling users to interact with the processing unit 510 via input / output (I / O) interfaces 550 through these external devices 570. It can also connect to one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 560. The network adapter 560 can communicate with other modules of the system 500 for preventing tampering of offline transaction amounts via a bus 530. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in the system 500 for preventing tampering of offline transaction amounts, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0151] Figure 6 This is a schematic diagram of a computer-readable medium embodiment of the present invention. Figure 6 As shown, the computer program can be stored on one or more computer-readable media. The computer-readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage unit, a magnetic storage unit, or any suitable combination thereof. When the computer program is executed by one or more data processing devices, it enables the computer-readable medium to implement the above-described method of the present invention, namely:
[0152] S201. The payee uses the keyboard of the payment device to enter the amount to be received;
[0153] S202. The security chip of the receiving device verifies the amount received. After the verification is successful, the security chip of the receiving device generates offline payment initialization information based on the amount received and sends the offline payment initialization information to the payment device.
[0154] S203. The payment device receives the payment initialization information and executes a dual offline transaction.
[0155] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described in this invention can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a data processing device (such as a personal computer, server, or network device, etc.) to execute the methods described above according to this invention.
[0156] The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0157] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0158] In summary, the present invention can be implemented by methods, apparatus, electronic devices, or computer-readable media that execute computer programs. In practice, some or all of the functions of the present invention can be implemented using general-purpose data processing devices such as microprocessor units or digital signal processing units (DSPs).
[0159] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for preventing the alteration of transaction amounts in offline digital currency transactions, characterized in that, The method includes: The recipient enters the payment amount using the keyboard of the payment device; The security chip of the payment device verifies the amount received. After the verification is successful, the security chip of the payment device generates offline payment initialization information based on the amount received and sends the offline payment initialization information to the payment device. The payment device receives the payment initialization information and executes a dual offline transaction. The security chip of the payment device verifies the payment amount by including: The payment device's keyboard and security chip share a set of shared keys. The keyboard uses the shared keys to encrypt the payment amount, generating first encrypted information. The shared set of shared keys includes a shared key matrix stored by the payment device's security chip and keyboard; and / or... The keyboard of the payment device generates a public key and a private key, sends the public key to the security chip of the payment device, and the keyboard of the payment device uses the private key to sign the payment amount to obtain a digital signature, generating second encrypted information; and / or, The keyboard and security chip of the payment device share a set of shared keys. At the same time, the keyboard of the payment device generates a set of public and private keys, sends the public key to the security chip of the payment device, and uses the private key to sign the payment amount to obtain a digital signature. The keyboard then uses the shared key to encrypt the payment amount and the digital signature to generate third encrypted information.
2. The method for preventing tampering with the amount of offline transactions as described in claim 1, characterized in that, The security chip of the payment device further verifies the payment amount by: The first encrypted information is sent to the security chip of the payment device; The security chip of the payment device uses the shared key to decrypt the first encrypted information, obtain the payment amount, and use the payment amount to generate offline payment initialization information.
3. The method for preventing the alteration of transaction amounts in dual offline transactions as described in claim 2, characterized in that, The security chip and keyboard storage shared key matrix of the payment device specifically include: each shared key has a corresponding key ID.
4. The method for preventing the alteration of transaction amounts in dual offline transactions as described in claim 3, characterized in that, The security chip of the payment device further verifies the payment amount by: Each time a transaction amount is entered, the keyboard can randomly select a set of shared keys from the shared key matrix to encrypt the transaction amount. The encryption key ID and the encrypted transaction amount are sent to the security chip, which then selects the corresponding shared key to decrypt the transaction based on the key ID.
5. The method for preventing the alteration of transaction amounts in dual offline transactions as described in claim 1, characterized in that, The security chip of the payment device further verifies the payment amount by: The second encrypted information is sent to the security chip of the payment device, wherein the second encrypted information includes the payment amount and the digital signature; The security chip of the payment device uses the public key to verify the digital signature in the second encrypted information. After successful verification, it uses the payment amount to generate offline payment initialization information.
6. The method for preventing the alteration of transaction amounts in dual offline transactions as described in claim 1, characterized in that, The security chip of the payment device further verifies the payment amount by: The third encrypted information is sent to the security chip of the payment device; The security chip of the payment device uses the shared key to decrypt the third encrypted information to obtain the payment amount and the digital signature; The security chip of the payment device uses the public key to verify the digital signature. After successful verification, it uses the payment amount to generate offline payment initialization information.
7. A payment receiving device for preventing tampering with offline transaction amounts, used for offline digital currency transactions, characterized in that, The payment receiving device includes: The keyboard, connected to a security chip, stores a shared key that is shared with the security chip. The shared key is used to encrypt the payment amount entered by the user, generating first encrypted information. This first encrypted information is then sent to the security chip. The security chip receives the first encrypted information, decrypts it using the shared key, obtains the payment amount, and generates payment initialization information based on the payment amount. The shared key includes a shared key matrix stored in the security chip and the keyboard of the payment device. And / or, The keyboard, connected to a security chip, stores a private key. The private key is used to sign the user-inputted payment amount to obtain a digital signature. Based on the payment amount and the digital signature, second encrypted information is generated and sent to the security chip. The keyboard periodically generates a public key and a private key and sends the public key to the security chip. The security chip stores the public key generated by the keyboard corresponding to the private key. The public key is used to verify the digital signature in the second encrypted information. Upon successful verification, payment initialization information is generated based on the payment amount. And / or, The keyboard is connected to a security chip and stores a private key and a shared key. The private key is used to sign the amount of payment entered by the user to obtain a digital signature. The shared key is used to encrypt the amount of payment and the digital signature to generate third encrypted information, and the third encrypted information is sent to the security chip. The shared key set includes a security chip of the payment device and a keyboard storing a shared key matrix. The keyboard periodically generates a public key and a private key and sends the public key to the security chip. The security chip stores the public key generated by the keyboard corresponding to the private key and the shared key. The shared key is used to decrypt the third encrypted information to obtain the payment amount and the digital signature. The public key is used to verify the digital signature. After successful verification, payment initialization information is generated based on the payment amount.
8. A device for preventing the alteration of transaction amounts in offline transactions, used for offline digital currency transactions, characterized in that, The device includes: The input module is designed for recipients to input the amount to be received using the keyboard of their payment device. The verification module is used to verify the payment amount by the security chip of the payment device. After the verification is successful, the security chip of the payment device generates offline payment initialization information based on the payment amount and sends the offline payment initialization information to the payment device. The verification of the payment amount by the security chip of the payment device includes: the keyboard and security chip of the payment device sharing a shared key; the keyboard using the shared key to encrypt the payment amount to generate first encrypted information; the shared key includes a shared key matrix stored by the security chip and keyboard of the payment device; and / or, The keyboard of the payment device generates a public key and a private key, sends the public key to the security chip of the payment device, and the keyboard of the payment device uses the private key to sign the payment amount to obtain a digital signature, generating second encrypted information; and / or, The keyboard and security chip of the payment device share a set of shared keys. At the same time, the keyboard of the payment device generates a set of public and private keys. The public key is sent to the security chip of the payment device. The keyboard uses the private key to sign the payment amount to obtain a digital signature. The payment amount and the digital signature are encrypted using the shared key to generate third encrypted information. The payment execution module is used by the payment device to receive the payment initialization information and execute dual offline transactions.