Digital signature verification method and device
By using hash keys and preset hash algorithms in the payment gateway to generate irreversible digital signature verification sequences, the problem that existing digital signatures are easily cracked by quantum computing is solved, and the security of object payment transactions and high security of IoT devices are achieved.
Patent Information
- Application Number
- CN202110760293.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-07-06
AI Technical Summary
Existing digital signature algorithms such as RSA algorithms are easily cracked by quantum computing systems, threatening IoT devices and network security.
The hash key and preset hash algorithm are used to generate an irreversible digital signature verification sequence, and the verification is carried out through the payment gateway to ensure that the message is not easily cracked during the delivery process.
It improves the security of payment transactions in matters, enhances the security of IoT devices and networks, and prevents quantum computers from cracking electronic signature processes.
Smart Images

Figure CN115587811B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things encryption algorithms, and more particularly to a method and device for verifying a digital signature. Background Art
[0002] At present, with the rapid development of Internet of Things technology, various payment processes will be completed directly between objects without human intervention. For example, in the field of industrial Internet digital economy, Internet of Things electronic payment and other scenarios, object-to-object payment can be realized through digital currency. It can be seen that payment security is one of the most urgent needs to ensure the realization of object-to-object payment scenarios.
[0003] During the barter payment process, IoT devices can use digital signatures for authentication to ensure payment security. Currently, the credibility of digital signature algorithms, such as the RSA algorithm, depends on the complexity of the algorithm, which is generally low.
[0004] However, with the maturity and application of quantum computing systems, the above digital signatures can be easily cracked by quantum computing systems, threatening the security of IoT devices and networks. Summary of the Invention
[0005] The present invention provides a digital signature verification method and device, which can ensure the security of barter payment transactions and improve the security of Internet of Things devices and networks.
[0006] According to a first aspect of an embodiment of the present invention, an embodiment of the present invention provides a digital signature verification method, which is applied to a payment device, and the method includes: receiving a first hash key sent by a payment gateway, where the first hash key is a random number pair of preset bits; obtaining a first payment message sequence based on a preset hash algorithm and an encrypted payment message; generating a first digital signature verification sequence based on the first payment message sequence and the first hash key; and sending the first digital signature verification sequence to the payment gateway, so that the payment gateway performs verification based on the first digital signature verification sequence.
[0007] In some embodiments, the encrypted payment message is obtained through the following steps: receiving a first payment message encryption key sent by the payment gateway; encrypting the generated payment message according to the first payment message encryption key to obtain the encrypted payment message, wherein the payment message carries payee information, payer information, bill information, and payment amount.
[0008] According to a second aspect of an embodiment of the present invention, an embodiment of the present invention provides a digital signature verification method, which is applied to a payment gateway, and the method includes: sending a first hash key to a payment device and sending a second hash key to a payment device, wherein the second hash key is obtained by operating the first hash key through a preset hash function; receiving a first digital signature verification sequence sent by the payment device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated by the payment device based on the first hash key and the encrypted payment message, and the second digital signature verification sequence is generated by the payment device based on the second hash key and the received encrypted payment message; performing the preset hash function operation on the first digital signature verification sequence to obtain a first digital signature verification sequence after the operation; and confirming that the verification is successful when the first digital signature verification sequence after the operation is the same as the received second digital signature verification sequence.
[0009] In some embodiments, before receiving the first digital signature verification sequence sent by the payment device and the second digital signature verification sequence sent by the payment device, the method further includes: sending a first payment message encryption key to the payment device.
[0010] According to the third aspect of an embodiment of the present invention, an embodiment of the present invention provides a digital signature verification method, which is applied to a payment device, and the method includes: receiving a second hash key sent by a payment gateway, wherein the second hash key is obtained by operating the first hash key through a preset hash function; obtaining a second payment message sequence according to a preset hash algorithm and the received encrypted payment message; generating a second digital signature verification sequence according to the second payment message sequence and the second hash key; and sending the second digital signature verification sequence to the payment gateway so that the payment gateway performs verification according to the second digital signature verification sequence.
[0011] In some embodiments, the preset bit number is 256 bits, and the preset hash algorithm includes: a secure hash algorithm SHA256 algorithm.
[0012] In some embodiments, the first Hash key includes a first random number sequence and a second random number sequence; generating a first digital signature verification sequence according to the first payment message sequence and the first Hash key may include: when it is determined that the nth digit of the first payment message sequence is a first preset value, then using the nth digit of the first random number sequence in the first Hash key as the nth digit of the first digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the first payment message sequence is a second preset value, then using the nth digit of the second random number sequence in the first Hash key as the nth digit of the first digital signature verification sequence; wherein the first preset value is 0 and the second preset value is 1, or the first preset value is 1 and the second preset value is 0; or
[0013] The second Hash key includes a third random number sequence and a fourth random number sequence;
[0014] Generating a second digital signature verification sequence according to the second payment message sequence and the second Hash key includes: when it is determined that the nth digit of the second payment message sequence is a first preset value, using the nth digit of the third random number sequence in the second Hash key as the nth digit of the second digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the second payment message sequence is a second preset value, using the nth digit of the fourth random number sequence in the second Hash key as the nth digit of the second digital signature verification sequence; wherein, the first preset value is 0 and the second preset value is 1, or, the first preset value is 1 and the second preset value is 0.
[0015] According to the fourth aspect of an embodiment of the present invention, an embodiment of the present invention provides a digital signature verification device, which is applied to a payment device, and the verification device includes: a first receiving module, used to receive a first hash key sent by a payment gateway, the first hash key is a random number pair of preset bits; a first transformation module, used to obtain a first payment message sequence according to a preset hash algorithm and an encrypted payment message; a first generation module, used to generate a first digital signature verification sequence according to the first payment message sequence and the first Hash key; and a first sending module, used to send the first digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the first digital signature verification sequence.
[0016] According to the fifth aspect of the embodiments of the present invention, the embodiments of the present invention provide a digital signature verification device, which is applied to a payment device, and the verification device includes: a second receiving module, used to receive a second hash key sent by the payment gateway, wherein the second hash key is obtained by operating the first hash key through a preset hash function; a second transformation module, used to obtain a second payment message sequence according to a preset hash algorithm and the received encrypted payment message; a second generation module, used to generate a second digital signature verification sequence according to the second payment message sequence and the second hash key; and a second sending module, used to send the second digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the second digital signature verification sequence.
[0017] According to the sixth aspect of an embodiment of the present invention, an embodiment of the present invention provides a digital signature verification device, which is applied to a payment gateway, and the digital signature verification device includes: a third sending module, used to send a first hash key to a payment device and a second hash key to a payment device, wherein the second hash key is obtained by operating the first hash key through a preset hash function; a third receiving module, used to receive a first digital signature verification sequence sent by the payment device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated by the payment device based on the first hash key and the encrypted payment message, and the second digital signature verification sequence is generated by the payment device based on the second hash key and the received encrypted payment message; an operation module, used to perform the preset hash function operation on the first digital signature verification sequence to obtain the first digital signature verification sequence after the operation; and a verification module, used to confirm that the verification is successful when the first digital signature verification sequence after the operation is the same as the received second digital signature verification sequence.
[0018] The beneficial effects of the embodiments of the present invention are that the digital signature verification and device provided by the present invention can further enhance the security level by adding a random encryption key to the payment message through the payment gateway, so that the payment message is not easily cracked when it is transmitted to the payment device; by performing a hash transformation on the encrypted payment message, an irreversible payment message sequence hash value can be obtained to ensure the security of the payment message; by performing an irreversible hash transformation on the first hash key to obtain the second hash key, the second hash key cannot be reversed to obtain the first hash key, and the verification process can only be completed in the electronic payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, ensuring the security of barter payment transactions and improving the security of Internet of Things devices and networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1A flowchart of a digital signature verification method provided in accordance with the first aspect of the present invention;
[0020] Figure 2 A flowchart of a digital signature verification method provided in accordance with the second aspect of an embodiment of the present invention;
[0021] Figure 3 A flowchart of a digital signature verification method provided in accordance with the third aspect of an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of a digital signature verification method provided by an embodiment of the present invention;
[0023] Figure 5 Another schematic diagram of a digital signature verification method provided by an embodiment of the present invention;
[0024] Figure 6 A schematic structural diagram of a digital signature verification device provided in accordance with a fourth aspect of an embodiment of the present invention;
[0025] Figure 7 A schematic structural diagram of a digital signature verification device provided in accordance with a fifth aspect of an embodiment of the present invention;
[0026] Figure 8 A schematic structural diagram of a digital signature verification device provided in accordance with the sixth aspect of an embodiment of the present invention.
[0027] Reference numerals:
[0028] 11. First receiving module, 12. First transformation module, 13. First generating module, 14. First sending module, 21. Second receiving module, 22. Second transformation module, 23. Second generating module, 24. Second sending module, 31. Second sending module, 32. Second receiving module, 33. Operation module, 34. Verification module. DETAILED DESCRIPTION
[0029] In the following description, specific details such as particular system structures, interfaces, and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in alternative embodiments without these specific details. In other cases, detailed descriptions of well-known systems, circuits, and methods are omitted to avoid obscuring the description of the present invention with unnecessary detail.
[0030] Before introducing the embodiments of the present invention, we first briefly introduce current IoT encryption algorithms. Currently, digital signatures are commonly used to verify the legitimacy of IoT messages when they are transmitted. However, in reality, with the maturity and application of quantum computing systems, the encryption algorithms used in digital signatures (such as the RSA public key encryption algorithm) are relatively complex and can be easily deciphered by quantum computers, making it difficult to effectively ensure IoT information security.
[0031] The first aspect of the embodiment of the present invention provides a method for verifying a digital signature. Figure 1 As shown, it is a flow chart of the digital signature verification method provided by the first aspect of the embodiment of the present invention. The digital signature verification method provided by this embodiment can be applied to a payment device, and the verification method includes:
[0032] Step S101: Receive a first Hash key sent by a payment gateway; wherein the first Hash key is a random number pair with a preset number of bits.
[0033] The random number pair of the preset number of bits can be composed of a first random number sequence of the preset number of bits and a second random number sequence of the preset number of bits. The preset number of bits is preferably 256 bits. The first random number sequence and the second random number sequence can be generated in various ways, for example, using a secure random number generator to generate the first random number sequence and the second random number sequence. The embodiments of the present invention do not limit the generation method of the first random number sequence and the second random number sequence.
[0034] In some embodiments, before receiving the first hash key sent by the payment gateway, the payment device may initiate a payment request to the payment device.
[0035] Step S102: Obtain a first payment message sequence according to a preset hash algorithm and the encrypted payment message.
[0036] Specifically, the first payment message sequence of a preset number of bits can be obtained by performing a preset hash algorithm operation on the encrypted payment message. The preset hash algorithm is an algorithm agreed upon by the payment device, the payment gateway, and the payment device.
[0037] In some embodiments, the encrypted payment message is obtained by:
[0038] Receiving a first payment message encryption key sent by a payment gateway; and encrypting the generated payment message using the first payment message encryption key to obtain the encrypted payment message. The payment message is generated when a payment device needs to receive payment. The payment message includes payee information, payer information, billing information, and the payment amount. The payment message encryption key may be a random encryption key. After obtaining the first encrypted payment message, the first encrypted payment message may be sent to the payment gateway, which then transmits it to the payment device.
[0039] Step S103: Generate a first digital signature verification sequence according to the first payment message sequence and the first Hash key.
[0040] Generating a first digital signature verification sequence based on the first payment message sequence and the first Hash key includes: when it is determined that the nth digit of the first payment message sequence is a first preset value, using the nth digit of the first random number sequence in the first Hash key as the nth digit of the first digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the first payment message sequence is a second preset value, using the nth digit of the second random number sequence in the first Hash key as the nth digit of the first digital signature verification sequence; wherein the first preset value is 0 and the second preset value is 1, or the first preset value is 1 and the second preset value is 0. That is, for each nth digit in the hash value of the first payment message sequence, the payment device selects a corresponding digit from the first Hash key. For example, if the nth bit of the message sequence is 0, the payment device selects the nth number in the first random list (List A) of the first hash key; if the nth bit is 1, the payment device selects the nth number from the second random list (List B) of the first hash key; if the n+1th bit of the message sequence is 0, the payment device selects the n+1th number in the first random list (List A) of the first hash key; if the n+1th bit is 1, the payee selects the n+1th number from the second random list (List B) of the first hash key, and so on, completing the selection of all numbers in the first payment message sequence. This set of digital sequences becomes the first digital signature verification sequence.
[0041] Step S104: sending the first digital signature verification sequence to a payment gateway, so that the payment gateway performs verification according to the first digital signature verification sequence.
[0042] Accordingly, the payment gateway performs the same preset hash function operation on the first digital signature sequence, generating a post-calculation first digital signature verification sequence. If the post-calculation first digital signature verification sequence matches the second digital signature sequence received from the payment device, verification is confirmed successful, indicating the legitimacy of both parties. The payment request is then sent to the payee, who completes the payment. The electronic payment gateway then pays the payee the corresponding amount of digital currency, completing the transaction.
[0043] It should be noted that the preset hash function H(M) is a hash function randomly specified by the electronic payment gateway, and one transaction corresponds to only one H(M), so it can effectively prevent hackers from deciphering the algorithm.
[0044] In some embodiments, the preset bit number is 256 bits, and the preset hash algorithm includes: a secure hash algorithm SHA256 algorithm.
[0045] Therefore, in this embodiment, the payment gateway adds a random encryption key to the payment message, which can further enhance the security level and make the payment message not easily cracked when it is transmitted to the payment device; by performing a hash transformation on the encrypted payment message, an irreversible payment message sequence hash value can be obtained to ensure the security of the payment message; in addition, by performing an irreversible hash transformation on the first hash key to obtain the second hash key, the second hash key cannot be reversed to obtain the first hash key, and the verification process can only be completed in the electronic payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0046] The second aspect of the embodiment of the present invention further provides a digital signature verification method. This embodiment is described in further detail based on the above embodiment.
[0047] like Figure 2 As shown, it is a flow chart of the digital signature verification method provided by the second aspect of the embodiment of the present invention. A digital signature verification method provided by this embodiment is applied to a payment gateway, which includes:
[0048] Step S201: Send a first hash key to a payment device and send a second hash key to a payment device, wherein the second hash key is obtained by operating the first hash key using a preset hash function H(M).
[0049] Specifically, the first hash key is a random number pair of a preset number of bits. The first hash key may include a first random sequence of a preset number of bits and a second random sequence of a preset number of bits. The preset number of bits is preferably 256 bits. There are various ways to generate the first random number sequence and the second random number sequence. For example, a secure random number generator may be used to generate the first random number sequence and the second random number sequence. The embodiments of the present invention do not limit the generation method of the first random number sequence and the second random number sequence.
[0050] Generating a third random number sequence of a second hash key and a fourth random number sequence of a preset number of bits based on the first random number sequence and the second random number sequence of the first hash key includes: obtaining a third random number sequence corresponding to the first random number sequence according to a preset hash algorithm, and obtaining a fourth random number sequence corresponding to the second random number sequence according to a preset hash algorithm. Specifically, when obtaining the hash value of the third random number sequence, the first random number sequence can be hashed according to the preset hash algorithm, and the transformation result can be used as the hash value of the third random number sequence. Similarly, when obtaining the hash value of the fourth random number sequence, the second random number sequence can be hashed according to the preset hash algorithm, and the transformation result can be used as the hash value of the fourth random number sequence. Among them, the above-mentioned preset hash algorithm can be set by those skilled in the art according to actual conditions, and the present invention is not limited to this.
[0051] In some embodiments, before receiving the first digital signature verification sequence sent by the payment receiving device and the second digital signature verification sequence sent by the payment device, the method further includes: after receiving the payment information sent by the payment receiving device, sending a payment message encryption key to the payment receiving device, so that the payment receiving device encrypts the payment message according to the first payment message encryption key; and sending the encrypted payment message back to the payment gateway. The payment message encryption key and the encrypted payment message are sent to the payment device.
[0052] Step S202: Receive a first digital signature verification sequence sent by the payment device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated by the payment device based on the first hash key and the encrypted payment message, and the second digital signature verification sequence is generated by the payment device based on the second hash key and the encrypted payment message received from the payment gateway.
[0053] Step S203: performing a preset hash function H(M) operation on the first digital signature verification sequence to obtain a first digital signature verification sequence after the operation.
[0054] It should be noted that the preset hash function H(M) operation in step S203 is the same as the preset hash function H(M) used to generate the second hash key in step S201.
[0055] Step S204: When the calculated first digital signature verification sequence is identical to the received second digital signature verification sequence, confirm that the verification is successful.
[0056] Specifically, in this step, it is determined whether the first digital signature verification sequence is consistent with the second digital signature verification sequence. If so, the verification is determined to be successful, indicating that the entire payment process has not been tampered with and that the IoT devices are all legitimate IoT terminals. Otherwise, the verification is determined to be a failure, indicating that the message or signature has been tampered with during transmission or does not belong to the original transaction recipient. In specific implementations, the above determination method can be configured by those skilled in the art based on actual circumstances and is not limited by the present invention.
[0057] Therefore, in this embodiment, the second hash key is obtained by performing an irreversible hash transformation on the first hash key. The second hash key cannot be reversed to obtain the first hash key, and the issuance and verification of the first hash key and the second hash key are completed in the payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0058] The third aspect of the embodiment of the present invention further provides a digital signature verification method, and the verification method provided in this embodiment is applied to a payment device. Figure 3 , which is a flow chart of a digital signature verification method provided by the third aspect of an embodiment of the present invention. A digital signature verification method provided by this embodiment includes:
[0059] Step S301: Receive a second Hash key sent by a payment gateway, wherein the second Hash key is obtained by computing the first Hash key through a preset Hash function.
[0060] The second Hash key is a random number pair of a preset number of bits. The second Hash key may include a third random sequence of a preset number of bits and a fourth random sequence of a preset number of bits. The preset number of bits is preferably 256 bits.
[0061] Specifically, generating a third random number sequence of a second hash key and a fourth random number sequence of a preset number of bits based on the first random number sequence and the second random number sequence of the first hash key may include: obtaining a third random number sequence corresponding to the first random number sequence according to a preset hash algorithm, and obtaining a fourth random number sequence corresponding to the second random number sequence according to a preset hash algorithm. Specifically, when obtaining the hash value of the third random number sequence, the first random number sequence may be hashed according to the preset hash algorithm, and the transformation result may be used as the hash value of the third random number sequence. Similarly, when obtaining the hash value of the fourth random number sequence, the second random number sequence may be hashed according to the preset hash algorithm, and the transformation result may be used as the hash value of the fourth random number sequence. Among them, the above-mentioned preset hash algorithm can be set by those skilled in the art according to actual conditions, and the present invention does not limit this.
[0062] Step S302: Obtain a second payment message sequence according to a preset hash algorithm and the received encrypted payment message sent by the payment gateway.
[0063] Among them, the preset hash algorithm is the algorithm agreed upon by the payment device, payment gateway and payment device.
[0064] Step S303: Generate a second digital signature verification sequence according to the second payment message sequence and the second Hash key.
[0065] Specifically, generating a second digital signature verification sequence based on the second payment message sequence and the second Hash key includes: when it is determined that the nth digit of the second payment message sequence is a first preset value, the nth digit of the third random number sequence in the second Hash key is used as the nth digit of the second digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the second payment message sequence is a second preset value, the nth digit of the fourth random number sequence in the second Hash key is used as the nth digit of the second digital signature verification sequence; wherein, the first preset value is 0 and the second preset value is 1, or, the first preset value is 1 and the second preset value is 0.
[0066] Step S304: Send the second digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the second digital signature verification sequence.
[0067] In some embodiments, the preset bit number is 256 bits, and the preset hash algorithm includes: a secure hash algorithm SHA256 algorithm.
[0068] Therefore, in this embodiment, the payment gateway adds a random encryption key to the payment message, which can further enhance the security level and make the payment message not easily cracked when it is transmitted to the payment device; by performing a hash transformation on the encrypted payment message, an irreversible payment message sequence hash value can be obtained to ensure the security of the payment message; in addition, by performing an irreversible hash transformation on the first hash key to obtain the second hash key, the second hash key cannot be reversed to obtain the first hash key, and the verification process can only be completed in the payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0069] Next, the embodiment of the present invention is described in detail by taking the number of the first random number pairs as 256, the preset number of bits as 256, and the preset hash algorithm as the secure hash algorithm SHA256 as an example. Figure 4-Figure 5 , Figure 4 A schematic diagram of a digital signature verification method provided by an embodiment of the present invention, Figure 5 Another schematic diagram of a digital signature verification method provided by an embodiment of the present invention.
[0070] A hash transform is an encryption algorithm. The core of a hash transform is the hash function, a public function that can map a message M of any length into a shorter, fixed-length value H(M), which is also called a hash value. A hash value is a one-way cryptographic system, an irreversible mapping from plaintext to ciphertext, involving only encryption and no decryption. Its function expression is: h = H(m). The characteristic of a hash transform is that no matter what digital format the input is in or how large the file is, the output is a fixed-length bit string. Taking the Sh256 algorithm for payment messages described in this patent as an example, regardless of the input payment data message, the output is 256 bits, each bit is a 0 or 1, and 256 bits is a binary string of 256 0s or 1s, which effectively ensures the strict confidentiality of the payment message before identity verification is passed.
[0071] Step 1: The legal payee (or payment device) initiates a payment request to the payment gateway (or "electronic payment gateway"). The payment message carries the payee information, payer information, bill information, and payment amount.
[0072] Step 2: The electronic payment gateway verifies the legitimacy of the payee and generates a set of random 256-to-256-bit first hash keys and sends them to the payee via the Internet.
[0073] Step 3: The electronic payment gateway operates the first hash key according to the random H(M) hash function to generate a set of second hash keys, and at the same time sends the payment message encryption key and the encrypted payment message to the payee (or payment device) via the Internet.
[0074] Step 4: The payee encrypts the payment message according to the payment message encryption key, performs SHA256 hash transformation on the encrypted payment message, generates a payment message sequence with a 256-bit hash value, and sends it to the payer and gateway.
[0075] Step 4: The payer performs SHA256 hash transformation on the encrypted payment message to generate a payment message sequence with a 256-bit hash value, and sends it to the gateway and the payee at the same time.
[0076] Step 5: The payee generates a first digital signature verification sequence based on the encrypted payment message sequence and the first hash key according to the preset algorithm model, and sends it to the digital currency electronic payment gateway through the network.
[0077] Step 6: The payer generates a second digital signature verification sequence based on the payment message sequence and the second hash key according to the algorithm model of this scheme, and sends it to the digital currency electronic payment gateway through the network.
[0078] The preset algorithm model includes the following: for each n-th digit in the generated 256-bit payment message sequence hash value, the payee selects a corresponding digit from the first hash key. For example, if the n-th digit of the message is 0, the payee selects the n-th digit from the first list (List A) of the first hash key. If the n+1-th digit is 1, the payee selects the n+1-th digit from the second list (List B) of the first hash key, and so on. This method will generate 256 numbers (composed of List A and List B), and this set of numbers becomes the first digital signature verification sequence. For the payer, the payee selects the corresponding digit from the second hash key, generating a set of second digital signature verification sequences composed of List C and List D.
[0079] Step 7: The electronic payment gateway applies the same H(M) hash function to the first digital signature verification sequence to obtain a post-calculation digital signature verification sequence. If the post-calculation digital signature verification sequence is equal to the second digital signature verification sequence, it indicates that both parties are legitimate. The payment request is then sent to the payee, who completes the payment. (Note: Because H(M) is a hash function randomly assigned by the electronic payment gateway, and each transaction corresponds to only one H(M), this effectively prevents hackers from deciphering the algorithm in this scheme.)
[0080] Step 8: The electronic payment gateway pays the corresponding amount of digital currency to the payee to complete the transaction.
[0081] Specifically, both the payment device and the payment device are IoT devices. For example, the payment recipient could be a water company's centralized meter reading platform, and the payer could be a residential smart water meter. In the 5G era, services like smart meter reading and smart parking payment will no longer require human intervention. Instead, payments and settlements will be made directly between objects. This significantly increases the authentication requirements for IoT devices. The encryption algorithm logic of the embodiments of the present invention effectively ensures the security of the object-to-object payment process.
[0082] Therefore, the payee / payer participating in the digital currency payment needs to perform calculations on the first and second hash keys in accordance with the algorithm model and the first and second hash keys issued by the payment gateway to obtain the first and second digital signature verification sequences, and the payment gateway verifies whether the first digital signature verification sequence after calculation is consistent with the second digital signature verification sequence to confirm whether the payee and payer are legal devices (digital signature verification sequences are consistent) in a legal environment (message and key have not been tampered with) for the transaction (the same encrypted payment message). Therefore, the payment gateway device and algorithm model can fully ensure payment security.
[0083] A fourth aspect of the present invention provides a digital signature verification device. Figure 6 , which is a schematic diagram of the structure of a digital signature verification device provided by the fourth aspect of an embodiment of the present invention. The digital signature verification device provided by this embodiment is applied to a payment device, and the verification device includes: a first receiving module 11, a first conversion module 12, a first generation module 13, and a first sending module 14.
[0084] The first receiving module 11 is used to receive a first Hash key sent by the payment gateway, where the first Hash key is a random number pair with a preset number of bits.
[0085] The first transformation module 12 is configured to obtain a first payment message sequence according to a preset hash algorithm and the encrypted payment message.
[0086] The first generating module 13 is used to generate a first digital signature verification sequence according to the first payment message sequence and the first Hash key.
[0087] The first sending module 14 is used to send the first digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the first digital signature verification sequence.
[0088] Therefore, in this embodiment, the payment gateway adds a random encryption key to the payment message, which can further enhance the security level and make the payment message not easily cracked when it is transmitted to the payment device; by performing a hash transformation on the encrypted payment message, an irreversible payment message sequence hash value can be obtained to ensure the security of the payment message; in addition, by performing an irreversible hash transformation on the first hash key to obtain the second hash key, the second hash key cannot be reversed to obtain the first hash key, and the verification process can only be completed in the payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0089] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and their functions will not be repeated here.
[0090] A fifth aspect of the present invention provides a digital signature verification device. Figure 7 As shown, it is a structural diagram of the digital signature verification device provided in the fifth aspect of the embodiment of the present invention.
[0091] The digital signature verification device is applied to a payment device, and includes: a second receiving module 21 , a second transforming module 22 , a second generating module 23 and a second sending module 24 .
[0092] The third receiving module 21 is used to receive a second Hash key sent by the payment gateway, wherein the second Hash key is obtained by computing the first Hash key through a preset Hash function;
[0093] The third transformation module 22 is configured to obtain a second payment message sequence according to a preset hash algorithm and the received encrypted payment message sent by the payment gateway.
[0094] The third generating module 23 is used to generate a second digital signature verification sequence according to the second payment message sequence and the second Hash key.
[0095] The third sending module 24 is used to send the second digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the second digital signature verification sequence.
[0096] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and their functions will not be repeated here.
[0097] Therefore, in this embodiment, the payment gateway adds a random encryption key to the payment message, which can further enhance the security level and make the payment message not easily cracked when it is transmitted to the payment device; by performing a hash transformation on the encrypted payment message, an irreversible payment message sequence hash value can be obtained to ensure the security of the payment message; in addition, by performing an irreversible hash transformation on the first hash key to obtain the second hash key, the second hash key cannot be reversed to obtain the first hash key, and the verification process can only be completed in the payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0098] A sixth aspect of the present invention provides a digital signature verification device. Figure 8 As shown, it is a structural diagram of the digital signature verification device provided in the sixth aspect of the embodiment of the present invention.
[0099] The digital signature verification device is applied to a payment gateway, and includes: a second sending module 31 , a second receiving module 32 , a calculation module 33 and a verification module 34 .
[0100] The second sending module 31 is used to send the first Hash key to the payment device and send the second Hash key to the payment device, wherein the second Hash key is obtained by operating the first Hash key through a preset Hash function.
[0101] The second receiving module 32 is used to receive a first digital signature verification sequence sent by the payment device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated based on the first Hash key and the encrypted payment message, and the second digital signature verification sequence is generated based on the second Hash key and the encrypted payment message.
[0102] The operation module 33 is configured to perform the preset hash function operation on the first digital signature verification sequence to obtain a first digital signature verification sequence after the operation.
[0103] The verification module 34 is configured to confirm that the verification is successful when the first digital signature verification sequence after the operation is identical to the received second digital signature verification sequence.
[0104] Therefore, in this embodiment, the second hash key is obtained by performing an irreversible hash transformation on the first hash key. The second hash key cannot be reversed to obtain the first hash key, and the issuance and verification of the first hash key and the second hash key are completed in the payment gateway, making the electronic signature process difficult to be cracked by a quantum computer, fully ensuring the security of barter transactions, and at the same time improving the security of IoT devices and networks.
[0105] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and their functions will not be repeated here.
[0106] The reader should understand that, in the description of this specification, reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0107] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other division methods may be used, such as combining or integrating multiple modules or components into another system, or ignoring or not implementing certain features.
[0109] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network modules. Some or all of these units may be selected based on actual needs to achieve the objectives of the embodiments of the present invention.
[0110] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing module, each module may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.
[0111] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0112] It should also be understood that in the embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0113] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A digital signature verification method, the verification method being applied to a payment device, characterized in that: The method comprises: Receive a first hash key sent by the payment gateway, where the first hash key is a random number pair with a preset number of bits; Obtaining a first payment message sequence according to a preset hash algorithm and the encrypted payment message; Generate a first digital signature verification sequence according to the first payment message sequence and the first Hash key; and The first digital signature verification sequence is sent to the payment gateway so that the payment gateway performs verification according to the first digital signature verification sequence and the second digital signature verification sequence, wherein the second digital signature verification sequence is sent by the payment device and generated by the payment device according to the second hash key and the received encrypted payment message, and the second hash key is obtained by operating the first hash key through a preset hash function.
2. The verification method according to claim 1, wherein: The encrypted payment message is obtained by the following steps: Receiving a first payment message encryption key sent by the payment gateway; The generated payment message is encrypted according to the first payment message encryption key to obtain the encrypted payment message, wherein the payment message carries the payee information, payer information, bill information, and the payment amount.
3. The verification method according to claim 1, wherein: The preset number of bits is 256 bits, and the preset hash algorithm includes: a secure hash algorithm SHA256 algorithm.
4. The verification method according to claim 1, wherein: The first Hash key includes a first random number sequence and a second random number sequence; The generating of the first digital signature verification sequence according to the first payment message sequence and the first Hash key includes: when it is determined that the nth digit of the first payment message sequence is a first preset value, the nth digit of the first random number sequence in the first Hash key is used as the nth digit of the first digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the first payment message sequence is a second preset value, the nth digit of the second random number sequence in the first Hash key is used as the nth digit of the first digital signature verification sequence; wherein, the first preset value is 0 and the second preset value is 1, or, the first preset value is 1 and the second preset value is 0.
5. A digital signature verification method, the verification method is applied to a payment gateway, characterized in that: The method comprises: Sending a first hash key to a payment device and a second hash key to a payment device, wherein the second hash key is obtained by operating the first hash key through a preset hash function; receiving a first digital signature verification sequence sent by the payment receiving device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated by the payment receiving device based on the first Hash key and the encrypted payment message, and the second digital signature verification sequence is generated by the payment device based on the second Hash key and the received encrypted payment message; Performing the preset hash function operation on the first digital signature verification sequence to obtain a first digital signature verification sequence after the operation; and When the first digital signature verification sequence after the operation is identical to the received second digital signature verification sequence, the verification is confirmed to be successful.
6. The verification method according to claim 5, characterized in that: Before receiving the first digital signature verification sequence sent by the payment device and the second digital signature verification sequence sent by the payment device, the method further includes: Send the first payment message encryption key to the payment device.
7. A digital signature verification method, the verification method being applied to a payment device, characterized in that: The method comprises: Receive a second hash key sent by the payment gateway, where the second hash key is obtained by computing the first hash key through a preset hash function; Obtaining a second payment message sequence according to a preset hash algorithm and the received encrypted payment message; Generate a second digital signature verification sequence according to the second payment message sequence and the second Hash key; and The second digital signature verification sequence is sent to the payment gateway so that the payment gateway performs verification based on the second digital signature verification sequence and the first digital signature verification sequence, wherein the first digital signature verification sequence is sent by the payment device and generated by the payment device based on the first hash key and the encrypted payment message.
8. The verification method according to claim 7, characterized in that: The preset hash algorithm includes: secure hash algorithm SHA256 algorithm.
9. The verification method according to claim 7, characterized in that: The second Hash key includes a third random number sequence and a fourth random number sequence; Generating a second digital signature verification sequence according to the second payment message sequence and the second Hash key includes: when it is determined that the nth digit of the second payment message sequence is a first preset value, using the nth digit of the third random number sequence in the second Hash key as the nth digit of the second digital signature verification sequence; wherein n is a natural number; when it is determined that the nth digit of the second payment message sequence is a second preset value, using the nth digit of the fourth random number sequence in the second Hash key as the nth digit of the second digital signature verification sequence; wherein, the first preset value is 0 and the second preset value is 1, or, the first preset value is 1 and the second preset value is 0.
10. A digital signature verification device, characterized in that: The digital signature verification device is applied to a payment device, and the verification device includes: A first receiving module is configured to receive a first hash key sent by the payment gateway, where the first hash key is a random number pair with a preset number of bits; A first transformation module, configured to obtain a first payment message sequence according to a preset hash algorithm and the encrypted payment message; a first generating module, configured to generate a first digital signature verification sequence according to the first payment message sequence and the first Hash key; and The first sending module is used to send the first digital signature verification sequence to the payment gateway, so that the payment gateway performs verification according to the first digital signature verification sequence and the second digital signature verification sequence, wherein the second digital signature verification sequence is sent by the payment device and generated by the payment device according to the second hash key and the received encrypted payment message, and the second hash key is obtained by operating the first hash key through a preset hash function.
11. A digital signature verification device, characterized in that: The digital signature verification device is applied to a payment device, and the verification device includes: A second receiving module is configured to receive a second hash key sent by the payment gateway, wherein the second hash key is obtained by computing the first hash key through a preset hash function; A second transformation module, configured to obtain a second payment message sequence according to a preset hash algorithm and the received encrypted payment message; a second generating module, configured to generate a second digital signature verification sequence according to the second payment message sequence and the second Hash key; and The second sending module is used to send the second digital signature verification sequence to the payment gateway so that the payment gateway performs verification based on the second digital signature verification sequence and the first digital signature verification sequence, wherein the first digital signature verification sequence is sent by the payment device and generated by the payment device based on the first hash key and the encrypted payment message.
12. A digital signature verification device, which is applied to a payment gateway, characterized in that: The digital signature verification device includes: a third sending module, configured to send the first Hash key to the payment device and send the second Hash key to the payment device, wherein the second Hash key is obtained by operating the first Hash key through a preset Hash function; a third receiving module, configured to receive a first digital signature verification sequence sent by the payment receiving device and a second digital signature verification sequence sent by the payment device, wherein the first digital signature verification sequence is generated by the payment receiving device based on the first Hash key and the encrypted payment message, and the second digital signature verification sequence is generated by the payment device based on the second Hash key and the received encrypted payment message; an operation module, configured to perform the preset hash function operation on the first digital signature verification sequence to obtain a first digital signature verification sequence after the operation; and The verification module is used to confirm that the verification is successful when the first digital signature verification sequence after the operation is identical to the received second digital signature verification sequence.
Citation Information
Patent Citations
Digital signature authentication method, system and device, and storage medium
CN109618341A
Settlement device, settlement method, and settlement program
JP2016139291A