A verifiable QR code payment method based on geographic location

By using the signature private key to sign the geographical location and time in QR code payment, and verifying the signature and location information, the problem of theft and deception attacks in QR code payment is solved, and the security and convenience of payment are improved.

CN112561517BActive Publication Date: 2024-09-17NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011456138.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-10
Publication Date
2024-09-17
Estimated Expiration
2040-12-10

AI Technical Summary

Technical Problem

Existing QR code payment methods lack geographical location authentication, are vulnerable to theft and GPS spoofing attacks, and cannot effectively prevent malicious merchants from tampering, making the payment process unsafe.

Method used

During the payment process, consumers and merchants each generate a signature private key, sign the geographical location and time through the signature private key, and generate a QR code containing the signature. The payment service provider verifies the signature and location information to ensure the security of the payment process. sex.

Benefits of technology

It effectively prevents payment code theft and GPS spoofing attacks, improves the security of QR code payment, and ensures the flexibility and reliability of the payment process without the need for additional trusted hardware and secondary user confirmation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112561517B
    Figure CN112561517B
Patent Text Reader

Abstract

The present invention discloses a authenticable QR code payment method based on geographic location, which can generate a payment QR code containing the location information of the current payment, and use an identity-based signature to ensure the credibility of the QR code, so as to prevent the QR code from being stolen. When a user uses the QR code to pay, the mobile terminal first uses a private key to perform an identity-based signature on a triple consisting of a consumer account, a current payment time, and a current payment location, and generates a QR code based on the triple. The merchant decodes and verifies the signature, and the merchant can send the payment information to the payment service provider only when and only when the time and location of generating the QR code and the time and location of consumption are close to each other in terms of measurement. The payment service provider verifies the signature, time, and location respectively, and the transaction can only be successful if a certain threshold is met. Each payment QR code is related to a specific location and time when it is generated, so it can resist the malicious behavior of attackers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a verifiable QR code payment method based on geographic location, belonging to the technical field of information security. Background Art

[0002] With the development of urban Internet of Things, mobile payment has become the mainstream payment method, with 960 million users worldwide. The most common one is QR code payment. In order to ensure the security of QR code payment, the industry currently uses time-based one-time tokens. The payment token has only a certain life span, which can prevent replay attacks. However, the convenient payment method hides unsafe factors. Since the QR code is just a way of expressing data, attackers can launch attacks to sniff and intercept the payment QR code. The attacker can use any code scanning tool to decode the numbers contained in it, and then use any QR code generator to restore the numbers to a QR code that can be decoded by the POS machine. Therefore, the QR code itself does not have an encryption function, but only visually hides the user's payment random number. Once obtained by the attacker, it means that he has someone's electronic wallet for payment, and it cannot be revoked within a limited time. Considering the probability of success and concealment of the attack, attackers are often more willing to use the intercepted payment code for merchants far away from the victim. Under this model of off-site payment attack strategy, the attacker may not only be a malicious third party, but also a malicious merchant. If the merchant is malicious, then after obtaining the payee's payment code, the merchant will declare that the payment has failed, and then pass the payment code to his accomplice attacker to use the payment code. Therefore, an improved method is urgently needed to ensure the security and reliability of QR code payment in this case. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a verifiable QR code payment method based on geographic location, in which each payment QR code is related to a specific location and time when generated, ensuring flexibility and security in the payment process.

[0004] The present invention adopts the following technical solutions to solve the above technical problems:

[0005] A verifiable QR code payment method based on geographic location, comprising the following steps:

[0006] Step 1: The consumer generates a unique consumer identity number AID when registering, and generates a consumer signature private key sk based on the consumer identity number AID p , and upload the consumer identification number AID to the payment service provider;

[0007] Step 2: The merchant generates a unique merchant identity number SID when registering, and generates a merchant signature private key sk based on the merchant identity number SID s, and the merchant's identity number SID, merchant's geographic location loc save Upload to payment service provider;

[0008] Step 3: The payment service provider collects the consumer ID number AID, the merchant ID number SID and the merchant's geographic location loc save Save it;

[0009] Step 4: The consumer obtains the current location loc when paying p and payment time p , based on the consumer signature private key sk generated in step 1 p The consumer's identity number AID and current geographic location loc p 、Current payment time Time p The triple {AID,loc p ,Time p} to sign and obtain the consumer signature σ p , and {AID,loc p ,Time p ,σ p}Encode into a QR code;

[0010] Step 5: The merchant scans and decodes the QR code through the POS machine, and verifies the consumer's signature through the decoded AID p , when the signature verification is passed and the consumer's geographic location at the time of payment is loc p The geographic location of the merchant scanning the code s 、Consumer payment time p Scan the QR code with the merchant s If all conditions are met, proceed to the next step, otherwise an error symbol is output and the transaction is terminated;

[0011] Step 6: The merchant enters the consumption amount m and signs the merchant's private key sk generated in step 2 s {AID, SID, m, Time p ,Time s ,loc p ,loc s} to sign and get the merchant's signature σ s , and {AID, SID, m, Time p ,Time s ,loc p ,loc s ,σ p ,σ s}Send to payment service provider;

[0012] Step 7: The payment service provider verifies σ based on the AID in step 1p , verify σ according to the SID in step 2 s , if and only if both verifications are successful, verify the consumer's geographic location at the time of payment loc p The geographic location of the merchant scanning the code s 、Consumer payment time p Scan the QR code with the merchant s 、Business location loc save The geographic location of the merchant scanning the code s Whether all conditions are met, if all conditions are met, the payment is successful, otherwise the payment fails.

[0013] As a preferred solution of the present invention, the consumer signature private key sk in step 1 p The calculation method is as follows:

[0014]

[0015] Among them, e is a large prime number and AID is the consumer identification number.

[0016] As a preferred solution of the present invention, the merchant signature private key sk in step 2 s The calculation method is as follows:

[0017]

[0018] Among them, e is a large prime number, and SID is the merchant identification number.

[0019] As a preferred solution of the present invention, the consumer signature σ in step 4 p The calculation method is as follows:

[0020] t=r e

[0021]

[0022] Among them, t is a parameter, r is a random number, e is a large prime number, sk p is the consumer's signature private key, f is a one-way function, AID is the consumer's identity number, loc p The geographical location of the consumer when paying. p Pay time for consumers.

[0023] As a preferred solution of the present invention, in step 5, the merchant verifies whether the following three conditions are met:

[0024]

[0025] |loc p -locs |<d

[0026] |Time s -Time p |<T

[0027] Among them, σ p is the consumer's signature, e is a large prime number, sk p is the consumer's signature private key, r is a random number, f is a one-way function, t is a parameter, AID is the consumer's identity number, d is the location threshold, and T is the time threshold.

[0028] As a preferred solution of the present invention, the merchant signature σ in step 6 s The calculation method is as follows:

[0029] t′=r′ e

[0030]

[0031] Among them, t' is a parameter, r' is a random number, e is a large prime number, sk s is the merchant's signature private key, f is a one-way function, AID is the consumer's ID number, SID is the merchant's ID number, m is the consumption amount, loc p The geographical location of the consumer when paying, loc s The geographic location of the merchant scanned, Time p Paying time for consumers, Time s Scan code time for merchants.

[0032] As a preferred solution of the present invention, in step 7, the payment service provider verifies whether the following five conditions are met:

[0033]

[0034]

[0035] |loc p -loc s |<d

[0036] |Time s -Time p |<T

[0037] |loc save -loc s |<D

[0038] Among them, σ p Signature for the consumer, σ s Sign for the merchant, sk p Signature private key for consumers, sks is the merchant's signature private key, r and r' are both random numbers, e is a large prime number, f is a one-way function, t and t' are both parameters, AID is the consumer's ID, SID is the merchant's ID, m is the consumption amount, loc p The geographical location of the consumer when paying, loc s The geographic location of the merchant scanned, Time p Paying time for consumers, Time s Scan code time for merchants.

[0039] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0040] 1. The present invention can prevent payment code theft attacks, GPS spoofing attacks, and malicious merchants from tampering with QR codes, thereby improving the security performance of mobile QR code payments.

[0041] 2. The present invention does not require the installation of additional trusted hardware and does not require secondary confirmation by the user, thus ensuring the convenience of mobile QR code payment.

[0042] 3. The present invention has high security, and the identity-based signature can authenticate the payment information without the need for a trusted third party. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a payment QR code generation flow chart of the present invention.

[0044] Figure 2 It is a flow chart of the merchant code scanning method of the present invention.

[0045] Figure 3 It is a flow chart of the payment server transaction method determination of the present invention.

[0046] Figure 4 It is a schematic diagram of simulating consumer registration in the embodiment.

[0047] Figure 5 It is a schematic diagram of simulating a consumer to generate a payment QR code in an embodiment.

[0048] Figure 6 This is a schematic diagram of simulating a merchant POS machine for payment in an embodiment.

[0049] Figure 7 It is a schematic diagram of simulating a payment failure of a consumer in an embodiment.

[0050] Figure 8 This is a schematic diagram of simulating successful payment by a consumer in an embodiment. DETAILED DESCRIPTION

[0051] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0052] A geo-location-based authenticable QR code payment method that can generate a payment QR code containing the current payment location information, and use an identity-based signature to ensure the credibility of the QR code to prevent the QR code from being stolen. When a user uses a QR code to pay, the mobile terminal first uses a private key to perform an identity-based signature on a triple consisting of the payer's account, current payment time, and current payment location, and generates a QR code based on the triple. The merchant decodes and verifies the signature, and can only send the payment information to the payment service provider if and only if the time and location of generating the QR code and the time and location of consumption are close to each other in terms of measurement. The payment service provider verifies the signature, time, and location respectively, and the transaction can only be successful if a certain threshold is met.

[0053] Step 1: The consumer generates a unique identity number AID (mobile phone number or ID number) when registering, and generates a user signature private key sk based on the unique identity number p ;

[0054] Step 2: The merchant generates a unique identity number SID when registering, and generates the merchant signature private key sk based on the unique identity number s , submit the merchant ID, merchant location loc save to payment service providers;

[0055] Step 3: The payment service provider saves the AID of step 1, the SID and loc of step 2 save ;

[0056] Step 4: The consumer obtains the current location information loc when paying p and payment time p , according to the private key pair {AID,loc p ,Time p} to sign σ p , and {AID,loc p ,Time p ,σ p}Encode into a QR code;

[0057] Step 5: The merchant uses the POS machine to scan and decode the QR code to obtain the current time s , verify the signature by decoding the AID, and compare the payment location loc of the consumer in step 4 p and payment time p With the current location of the business locs and the current time s Whether the threshold range d and T are met;

[0058] Step 6: If the conditions are met, the merchant enters the consumption amount m and calculates the amount according to sk in step 2. s {AID, SID, m, Time p ,Time s ,loc p ,loc s} to sign and get σ s , and {AID, SID, m, Time p ,Time s ,loc p ,loc s ,σ p ,σ s}Send to payment service provider;

[0059] Step 7: The payment service provider verifies σ based on the AID in step 1 p , verify σ according to the SID in step (2) s , if and only if both verifications are passed, compare the payment location, i.e., loc in step 4 p and loc in step 5 s Is it less than the threshold d? The payment time is the Time in step 4. p and the time of step 5 s Is it less than the threshold T? The merchant location is the loc in step 2. save and loc in step 5 s Is it less than the threshold D? If successful, the payment is completed; if the verification fails, the payment fails.

[0060] In step 1, initialize the system parameters e and f, where e is a large prime number and f is a one-way function. Consumers can calculate the private key sk based on their unique identity number AID when registering. p , the calculation method is as follows: The AID is uploaded to the payment service provider.

[0061] In step 2, when the merchant registers, the system generates a private key sk based on the merchant's unique identity number SID s , the calculation method is as follows: The system submits the merchant ID and the merchant's geographic location loc save To payment service providers.

[0062] In step 3, the payment service provider will receive the AID, SID and loc generated by the consumer and merchant when they register. save Store on your own server.

[0063] In step 4, the consumer selects a random number r and p ,Time p} to sign σ p , calculated as follows:

[0064] t=r e

[0065]

[0066] And {AID,loc p ,Time p ,σ p}encoded into a QR code.

[0067] In step 5, after the merchant's POS machine decodes the code, it checks whether the following three conditions are met:

[0068]

[0069] |loc p -loc s |<d

[0070] |Time s -Time p |<T

[0071] If any of the above three equations is not true, an error symbol will be output and the transaction will be terminated.

[0072] In step 6, the merchant selects a random number r′ and calculates:

[0073] t′=r′ e

[0074]

[0075] And {AID,SID,m,Time p ,Time s ,loc p ,loc s ,σ p ,σ s}Sent to the payment service provider.

[0076] In step 7, the payment server checks whether the following five conditions are met:

[0077]

[0078]

[0079] |loc p -loc s|<d

[0080] |Time s -Time p |<T

[0081] |loc save -loc s |<D

[0082] If one of the above formulas is not true, an error symbol is output and the transaction is terminated; otherwise, the payment is considered successful.

[0083] In the QR code payment scenario, the participants can be divided into: consumers, merchants, and payment service providers. The steps for consumers to generate payment QR codes on their mobile devices are as follows: Figure 1 As shown:

[0084] Step 1: Generate the consumer signature private key based on the consumer's identity code when registering;

[0085] Step 2: Call GPS to obtain the location information of the current payment location;

[0086] Step 3: Use the consumer signature private key to perform identity-based signing on the consumer ID number, consumer location information, and consumer consumption time;

[0087] Step 4: Encode the consumer ID number, consumer location information, consumer consumption time, and consumer signature into a QR code.

[0088] The steps of the merchant scanning process are as follows Figure 2 As shown:

[0089] Step 1: The system generates a merchant signature private key based on the merchant's ID number when registering, and retrieves the current merchant location information and payment time. The cashier enters the consumption amount;

[0090] Step 2: The POS machine parses the consumer’s payment QR code;

[0091] Step 3: Obtain the consumer ID number, consumer location information, consumer consumption time, and consumer signature;

[0092] Step 4: Use the consumer ID number to verify the consumer's signature. If the verification is successful, proceed to step 5. If the verification fails, an error message is returned to terminate the transaction.

[0093] Step 5: Compare the merchant's current location with the consumer's location. If they are within the preset range threshold, proceed to step 6. Otherwise, return an error message to terminate the transaction.

[0094] Step 6: Compare the merchant's payment time and the consumer's consumption time. If they are within the preset range threshold, proceed to step 7. Otherwise, return an error message to terminate the transaction.

[0095] Step 7: Use the merchant's private key to perform identity-based signatures on the consumer ID, merchant ID, consumption amount, consumer location, merchant current location, consumer consumption time, and merchant payment time;

[0096] Step 8: Send the consumer ID number, merchant ID number, consumption amount, consumer location, merchant current location, consumer consumption time, merchant payment time, consumer signature, and merchant signature to the payment service platform.

[0097] The payment service platform verifies the transaction steps as follows: Figure 3 As shown:

[0098] Step 1: Accept the consumer ID number, merchant ID number, consumption amount, consumer location, merchant current location, consumer consumption time, merchant payment time, consumer signature, and merchant signature provided by the merchant;

[0099] Step 2: Use the consumer ID number to verify the consumer's signature. If the verification is successful, proceed to step 3. If the verification fails, an error message is returned to terminate the transaction.

[0100] Step 3: Use the merchant ID to verify the merchant's signature. If the verification is successful, proceed to step 4. If the verification fails, an error message is returned to terminate the transaction.

[0101] Step 4: Compare the merchant's current location with the consumer's location. If they are within the preset threshold, proceed to step 5. Otherwise, return an error message to terminate the transaction.

[0102] Step 5: Compare the merchant's payment time and the consumer's consumption time. If they are within the preset threshold range, proceed to step 6. Otherwise, return an error message to terminate the transaction.

[0103] Step 6: Obtain the original location information submitted by the merchant when registering based on the merchant ID number;

[0104] Step 7: Compare the merchant's current location with the original location. If they are within the preset threshold range, the transaction is successful. Otherwise, an error message is returned and the transaction is terminated.

[0105] like Figure 4 As shown, consumers enter their mobile phone number or ID number as a unique identification number when registering and submit their account information to complete the registration process.

[0106] like Figure 5 As shown, a payment QR code is generated based on consumer information.

[0107] like Figure 6As shown, the merchant payment collection process is simulated by inputting the merchant ID and consumption amount to simulate the POS payment collection function. The thresholds of the merchant's current location and the consumer's consumption location as well as the thresholds of the merchant registration and the merchant's current location can be modified according to the specific situation to prevent GPS positioning errors.

[0108] like Figure 7 As shown, when a consumer's payment QR code is stolen by an attacker in an attempt to make a purchase in another store, the system determines that the location information exceeds the threshold and the payment fails.

[0109] like Figure 8 As shown, the transaction can be completed only if and only if the conditions of location information, time information and identity information are met.

[0110] The above embodiments are only for illustrating the technical idea of ​​the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.

Claims

1. A verifiable QR code payment method based on geographic location, characterized in that: The steps include: Step 1: The consumer generates a unique consumer identity number AID when registering, and generates a consumer signature private key sk based on the consumer identity number AID p , and upload the consumer identification number AID to the payment service provider; The consumer signature private key sk p The calculation method is as follows: Among them, e is a large prime number, AID is the consumer identification number; Step 2: The merchant generates a unique merchant identity number SID when registering, and generates a merchant signature private key sk based on the merchant identity number SID s , and the merchant's identity number SID, merchant's geographic location loc save Upload to payment service provider; The merchant signature private key sk s The calculation method is as follows: Among them, SID is the merchant identification number; Step 3: The payment service provider collects the consumer ID number AID, the merchant ID number SID and the merchant's geographic location loc save Save it; Step 4: The consumer obtains the current location loc when paying p and payment time p , based on the consumer signature private key sk generated in step 1 p The consumer's identity number AID and current geographic location loc p 、Current payment time Time p The triple {AID,loc p ,Time p } to sign and obtain the consumer signature σ p , and {AID,loc p ,Time p ,σ p }Encode into a QR code; The consumer signature σ p The calculation method is as follows: t=r e Among them, t is the parameter, r is the random number, f is the one-way function, loc p The geographical location of the consumer when paying. p Paying consumers for their time; Step 5: The merchant scans and decodes the QR code through the POS machine, and verifies the consumer's signature through the decoded AID p , when the signature verification is passed and the consumer's geographic location at the time of payment is loc p The geographic location of the merchant scanning the code s 、Consumer payment time p Scan the QR code with the merchant s If all conditions are met, proceed to the next step, otherwise an error symbol is output and the transaction is terminated; In step 5, the merchant verifies whether the following three conditions are met: place p -place s <d Time s -Time p <T Where, d is the position threshold, T is the time threshold; Step 6: The merchant enters the consumption amount m and signs the merchant's private key sk generated in step 2 s {AID, SID, m, Time p ,Time s ,loc p ,loc s } to sign and get the merchant's signature σ s , and {AID, SID, m, Time p ,Time s ,loc p ,loc s ,σ p ,σ s }Send to payment service provider; The merchant's signature σ s The calculation method is as follows: t′=r′ e Among them, t' is a parameter, r' is a random number, m is the consumption amount, loc s The geographic location of the merchant scanned, Time s Scan code time for merchants; Step 7: The payment service provider verifies σ based on the AID in step 1 p , verify σ according to the SID in step 2 s , if and only if both verifications are successful, verify the consumer's geographic location at the time of payment loc p The geographic location of the merchant scanning the code s 、Consumer payment time p Scan the QR code with the merchant s 、Business location loc save The geographic location of the merchant scanning the code s Whether all conditions are met. If so, the payment is successful, otherwise the payment fails; In step 7, the payment service provider verifies whether the following five conditions are met: place p -place s <d Time s -Time p <T loc-loc<Dsaves.