CN113159865A - Card coupon verification method based on two-dimensional code - Google Patents

Card coupon verification method based on two-dimensional code Download PDF

Info

Publication number
CN113159865A
CN113159865A CN202110519618.9A CN202110519618A CN113159865A CN 113159865 A CN113159865 A CN 113159865A CN 202110519618 A CN202110519618 A CN 202110519618A CN 113159865 A CN113159865 A CN 113159865A
Authority
CN
China
Prior art keywords
card
ticket
verification
dimensional code
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110519618.9A
Other languages
Chinese (zh)
Inventor
余鹏
李耀
彭磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Zhongbang Bank Co Ltd
Original Assignee
Wuhan Zhongbang Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Zhongbang Bank Co Ltd filed Critical Wuhan Zhongbang Bank Co Ltd
Priority to CN202110519618.9A priority Critical patent/CN113159865A/en
Publication of CN113159865A publication Critical patent/CN113159865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Credit Cards Or The Like (AREA)

Abstract

The invention relates to the technical field of information, and provides a card coupon selling checking method based on a two-dimensional code. The purpose of the description is to solve the problem that the offline ticket is offline to complete the offline two-dimensional code verification and cancellation scene. The main scheme comprises that the ticket basic service module and the verification and cancellation module agree on the same mapping and encryption algorithm and the same verification and cancellation request splicing rule; the application end opens the card and ticket module and sends a request for inquiring the card and ticket data of the relevant user to the server end under the condition of a network; the server side receives the request of the application side, inquires the unique card code of the card under the relevant user in the database, encrypts the unique card code and returns an RSA secret string to the application side according to a convention algorithm; the application terminal decrypts the obtained RSA string and then symmetrically encrypts the RSA string to generate a coupon two-dimensional code; and the server-side verification module receives the two-dimensional code of the card roll through scanning, verifies whether the card and ticket identification really exists, verifies whether the card and ticket state is in the correct state to be verified and sold, and verifies whether the card and ticket meets the rules of verification and sale.

Description

Card coupon verification method based on two-dimensional code
Technical Field
The invention relates to the technical field of information, and provides a card coupon selling checking method based on a two-dimensional code.
Background
At present, most of card tickets butted by companies are butted directly by adopting interfaces to finish the use and selling process of the card tickets. The unique ticket code of the card ticket directly transferred in the process of checking and selling marks the card ticket as used (checking and selling state) after the checking and selling system takes the ticket code.
The technical defects are as follows: coupon codes transmitted by the interface are easily acquired from the outside in network transmission, so that the coupon codes are used under the condition of being counterfeited, and a scene with high safety requirement cannot be used; the core-selling mode has high requirement on the real-time performance of the network and cannot be used under the offline condition; moreover, special offline core-selling scenes and the like cannot be met.
Disclosure of Invention
The purpose of the description is to solve the problem that the offline ticket is offline to complete the offline two-dimensional code verification and cancellation scene.
In order to achieve the purpose, the invention adopts the following technical means:
a card ticket checking and selling method based on a two-dimensional code comprises a checking and selling module at a service end, a card ticket basic service module and a card ticket module at an application end,
the card coupon basic service module and the verification and cancellation module agree on the same mapping and encryption algorithm and the same verification and cancellation request splicing rule;
the application end opens a card and coupon module and sends a request for inquiring the card and coupon data of the relevant user to the server end under the condition of a network;
the service end inquires the unique card code under the relevant user in the database after receiving the request of the application end, if the card serial number does not exist, the operation is finished, if the card information exists, the card ticket basic service module side generates a card volume mark, a Luhn algorithm is used for generating an end check digit by using the unique card code parameter, and a mark OTP is generated based on TOTP. Ensuring that the resulting mark meets specifications.
Finally, according to multiple encryption rules, encrypting the ticket mark, the tail check bit, the mark OTP, the user ID, the equipment ID, the validity period and other data, and returning RSA secret string to the application end according to an agreed algorithm;
the application terminal decrypts the obtained RSA string to obtain card coupon mark + mark OTP + user ID + equipment ID + validity period;
after the application end verifies the RSA signature information, verifying the user ID, the equipment ID and the validity period in sequence; if the corresponding condition is not met, the re-acquisition is needed;
generating a two-dimensional code OTP based on a TOTP mode, and controlling the valid period of code scanning of the two-dimensional code by a server;
adding a two-dimensional code OTP and geographical position information to the RSA string decryption parameter of the server, and then symmetrically encrypting to generate a ticket two-dimensional code;
the server-side verification module receives two-dimension code parameters extracted by scanning the card volume two-dimension code;
the server decrypts and verifies the analyzed two-dimensional code parameters according to an agreed encryption algorithm to obtain ticket identifiers, a verification and cancellation mode, two-dimensional code OTP (one time password) marking parameters and marking OTP information;
verifying and marking OTP data by utilizing the RSA public and private key information obtained by analysis;
verifying whether the last check bit of the ticket identifier meets the rule or not by using a Luhn algorithm;
checking whether the two-dimensional code 0TP marking parameter is expired;
checking whether a user corresponding to the cards is valid, checking the user for the checking and canceling times and the card and ticket acquisition time information, and if the checking and canceling times of the users for the cards on the same day is greater than a configuration upper limit, judging the users to be abnormal and interrupting the checking and canceling operation on the users;
and verifying whether the card ticket identification really exists, whether the card ticket state is in a correct state to be checked and sold, and whether the card ticket meets a check and sale use rule.
In the above technical solution, the card tag is an alternative value of a card verification and cancellation number (PAN), and is proposed to be composed of 13-19 digits, and the value must meet the basic verification rule of a general primary account number, including LUHN algorithm verification. The card coupon mark is used for replacing the card coupon number in the card coupon cancel-out transaction, and the validity period of the card coupon code is replaced by the validity period of the card coupon mark, so that the transaction processing is not influenced, and the transaction safety is enhanced.
In the above technical solution, TOTP ═ Truncate (HMAC-SHA-1(K, (T-T0)/X))
K shares a secret key; t time; the time step at which T0 starts counting; x time step, HMAC-SHA-1 means that SHA-1 is used as HMAC; the Truncate is a function of how to intercept the encrypted string and take which fields of the encrypted string form a number.
For the HMAC-SHA-1 mode encryption, Truncate is realized as follows:
the length of the encrypted HMAC-SHA-1 is obtained into a 20-byte secret string;
taking the last byte of the 20-byte cipher string, and taking the lower 4 bits of the byte as subscript offset for intercepting the cipher string;
starting according to the subscript offset, obtaining 4 bytes, and forming an integer according to a big-end mode;
and intercepting the last 6 bits or 8 bits of the integer and converting the intercepted bits into character strings to return.
And (3) obtaining a check bit by using a Luhn algorithm (also called a modulo 10 algorithm) and taking the card coupon number as a parameter:
starting from the check bits, going from right to left, the even bits are multiplied by 2, and then the ones and the tens of the two-digit number are added:
adding the obtained numbers together;
the digital sum is modulo 10 and subtracted by 10 to obtain the check bit.
Because the invention adopts the technical scheme, the invention has the following beneficial effects:
the card stock checking mode based on the marking technology is fully guaranteed in safety. Information leakage can not be carried out in network transmission, and user information is fully guaranteed no matter the card ticket information is checked, the method utilizes a two-dimensional code carrier, and multi-environment factors such as geographic position, OTP Token, equipment Id and the like are subjected to multi-check, so that the card ticket can be guaranteed to be checked and sold in a high-safety mode under the offline condition.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
To facilitate a better understanding of the inventive concept for those skilled in the art, the following detailed description is made:
the invention can be directly butted with a card and ticket database in the prior art to obtain the unique ticket code of the card and ticket, and the method of the invention is used for encrypting and generating the two-dimensional code and verifying and canceling, thereby being capable of well avoiding the unique ticket code of the card and ticket from being hijacked to cause the card and ticket to be verified and cancelled by black industry.
A system for checking and selling off-line two-dimensional code tickets comprises a checking and selling module at a service end, a ticket basic service module and a ticket module at an application end,
the card coupon basic service module and the verification and cancellation module agree on the same mapping and encryption algorithm and the same verification and cancellation request splicing rule;
the application end opens a card and coupon module and sends a request for inquiring the card and coupon data of the relevant user to the server end under the condition of a network;
the service end inquires the unique card code under the relevant user in the database after receiving the request of the application end, if the card serial number does not exist, the operation is finished, if the card information exists, the card ticket basic service module side generates a card volume mark, a Luhn algorithm is used for generating an end check digit by using the unique card code parameter, and a mark OTP is generated based on TOTP. Ensuring that the resulting mark meets specifications.
Finally, according to multiple encryption rules, encrypting the ticket mark, the tail check bit, the mark OTP, the user ID, the equipment ID, the validity period and other data, and returning RSA secret string to the application end according to an agreed algorithm;
the application terminal decrypts the obtained RSA string to obtain card coupon mark + mark OTP + user ID + equipment ID + validity period;
after the application end verifies the RSA signature information, verifying the user ID, the equipment ID and the validity period in sequence; if the corresponding condition is not met, the re-acquisition is needed;
generating a two-dimensional code OTP based on a TOTP mode, and controlling the valid period of code scanning of the two-dimensional code by a server;
adding a two-dimensional code OTP and geographical position information to the RSA string decryption parameter of the server, and then symmetrically encrypting to generate a ticket two-dimensional code;
the server-side verification module receives two-dimension code parameters extracted by scanning the card volume two-dimension code;
the server side decrypts and verifies the analyzed two-dimension code parameters according to an agreed encryption algorithm to obtain ticket identifiers, a verification and cancellation mode, two-dimension code 0TP marking parameters and marking OTP information;
utilizing the analyzed RSA public and private key information to verify and mark 0TP data;
verifying whether the last check bit of the ticket identifier meets the rule or not by using a Luhn algorithm;
verifying whether the OTP marking parameter of the two-dimensional code is overdue;
checking whether a user corresponding to the cards is valid, checking the user for the checking and canceling times and the card and ticket acquisition time information, and if the checking and canceling times of the users for the cards on the same day is greater than a configuration upper limit, judging the users to be abnormal and interrupting the checking and canceling operation on the users;
and verifying whether the card ticket identification really exists, whether the card ticket state is in a correct state to be checked and sold, and whether the card ticket meets a check and sale use rule.
In the above technical solution, the card tag is an alternative value of a card verification and cancellation number (PAN), and is proposed to be composed of 13-19 digits, and the value must meet the basic verification rule of a general primary account number, including LUHN algorithm verification. The card coupon mark is used for replacing the card coupon number in the card coupon cancel-out transaction, and the validity period of the card coupon code is replaced by the validity period of the card coupon mark, so that the transaction processing is not influenced, and the transaction safety is enhanced.
In the above technical solution, TOTP ═ Truncate (HMAC-SHA-1(K, (T-T0)/X))
K shares a secret key; t time; the time step at which T0 starts counting; x time step, HMAC-SHA-1 means that SHA-1 is used as HMAC; the Truncate is a function of how to intercept the encrypted string and take which fields of the encrypted string form a number.
For the HMAC-SHA-1 mode encryption, Truncate is realized as follows:
the length of the encrypted HMAC-SHA-1 is obtained into a 20-byte secret string;
taking the last byte of the 20-byte cipher string, and taking the lower 4 bits of the byte as subscript offset for intercepting the cipher string;
starting according to the subscript offset, obtaining 4 bytes, and forming an integer according to a big-end mode;
and intercepting the last 6 bits or 8 bits of the integer and converting the intercepted bits into character strings to return.
And (3) obtaining a check bit by using a Luhn algorithm (also called a modulo 10 algorithm) and taking the card coupon number as a parameter:
starting from the check bit, from right to left, multiplying the even number by 2, and then adding the ones and the tens of the two-digit numbers;
adding the obtained numbers together;
the digital sum is modulo 10 and subtracted by 10 to obtain the check bit.

Claims (4)

1. A two-dimensional code-based coupon verification method is characterized by comprising the following steps: comprises a verification module at a service end, a card and ticket basic service module and a card and ticket module at an application end,
the card ticket basic service module and the verification and cancellation module agree on the same mapping and encryption algorithm and the same verification and cancellation request splicing rule;
the application end opens the card and ticket module and sends a request for inquiring the card and ticket data of the relevant user to the server end under the condition of a network;
after receiving the request of the application end, the server side inquires the card unique ticket code under the relevant user in the database, if the card roll number does not exist, the operation is finished, if the card roll information exists, the card basic service module side generates a card roll mark, an end check bit is generated by using the card unique ticket code parameter through a Luhn algorithm, and the mark OTP is generated based on the TOTP;
finally, data such as a card ticket mark, a tail check digit, a mark OTP, a user ID, a device ID, a valid period and the like are encrypted according to a multiple encryption rule, and RSA secret string is returned to the application end according to a convention algorithm;
the application terminal decrypts the obtained RSA string to obtain a card and ticket mark, a mark OTP, a user ID, a device ID and a validity period;
after the application end verifies the RSA signature information, verifying the user ID, the equipment ID and the validity period in sequence; if the corresponding condition is not met, the re-acquisition is needed;
generating a two-dimensional code OTP based on a TOTP mode, and controlling the valid period of code scanning of the two-dimensional code by a server;
adding a two-dimensional code OTP and geographical position information to the RSA string decryption parameter of the server, and then symmetrically encrypting to generate a ticket two-dimensional code;
the server-side verification module receives two-dimension code parameters extracted by scanning the card volume two-dimension code;
the server decrypts and verifies the analyzed two-dimension code parameters according to an agreed encryption algorithm to obtain a card identifier, a verification and cancellation mode, two-dimension code OTP (one time password) marking parameters and marking OTP information;
verifying and marking OTP data by utilizing the RSA public and private key information obtained by analysis;
verifying whether the last check bit of the ticket identifier meets the rule or not by using a Luhn algorithm;
verifying whether the OTP marking parameter of the two-dimensional code is overdue;
checking whether a user corresponding to the cards is valid, checking the user for the checking and canceling times and the card and ticket acquisition time information, and if the checking and canceling times of the users for the cards on the same day is greater than a configuration upper limit, judging the users to be abnormal and interrupting the checking and canceling operation on the users;
and verifying whether the card identification really exists, whether the card state is in a correct state to be verified and cancelled, and whether the card meets the rules used by verification and cancellation.
2. The two-dimensional code-based ticket verification method according to claim 1,
the card ticket mark is a substitute value of a card ticket checking and canceling number, is composed of 13-19 digits, and the value must accord with a basic verification rule of a common primary account number, wherein the value comprises LUHN algorithm verification, the card ticket mark is used for replacing the card ticket number in the card ticket checking and canceling transaction, the validity period of the card ticket code is replaced by the validity period of the card ticket mark, the transaction processing is not influenced, and the transaction safety is enhanced.
3. The two-dimensional code-based ticket verification method according to claim 1,
OTP=TOTP=Truncate(HMAC-SHA-1(K,(T-TO)/X))
k shares a secret key; t time; the time step for starting TO count; x time step, HMAC-SHA-1 means that SHA-1 is used as HMAC; the Truncate is a function of how to intercept the encrypted string and take which fields of the encrypted string form a number.
For the HMAC-SHA-1 mode encryption, Truncate is realized as follows:
the length of the encrypted HMAC-SHA-1 is obtained into a 20-byte secret string;
taking the last byte of the 20-byte cipher string, and taking the lower 4 bits of the byte as subscript offset for intercepting the cipher string;
starting according to the subscript offset, obtaining 4 bytes, and forming an integer according to a big-end mode;
and intercepting the last 6 bits or 8 bits of the integer and converting the intercepted bits into character strings to return.
4. The two-dimensional code-based coupon verification method according to claim 1, wherein the last check digit is obtained by using a coupon number as a parameter by utilizing a Luhn algorithm, starting from the check digit, from right to left, multiplying an even number by 2, and then adding a unit digit and a ten digit of a two-digit number; adding the obtained numbers together; the digital sum is modulo 10 and subtracted by 10 to obtain the check bit.
CN202110519618.9A 2021-05-12 2021-05-12 Card coupon verification method based on two-dimensional code Pending CN113159865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110519618.9A CN113159865A (en) 2021-05-12 2021-05-12 Card coupon verification method based on two-dimensional code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110519618.9A CN113159865A (en) 2021-05-12 2021-05-12 Card coupon verification method based on two-dimensional code

Publications (1)

Publication Number Publication Date
CN113159865A true CN113159865A (en) 2021-07-23

Family

ID=76874790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110519618.9A Pending CN113159865A (en) 2021-05-12 2021-05-12 Card coupon verification method based on two-dimensional code

Country Status (1)

Country Link
CN (1) CN113159865A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079140A (en) * 2007-04-30 2007-11-28 信码互通(北京)科技有限公司 Two-dimension bar code based commercial discount credence management control system and control method
CN106067126A (en) * 2016-06-07 2016-11-02 腾讯科技(深圳)有限公司 Card certificate checks and writes off method, Apparatus and system
CN107818463A (en) * 2017-09-25 2018-03-20 九派天下支付有限公司 A kind of offline electronic payment method and system based on TOTP algorithms
CN108737394A (en) * 2018-05-08 2018-11-02 腾讯科技(深圳)有限公司 Off-line verification system, barcode scanning equipment and server
CN109993524A (en) * 2019-03-29 2019-07-09 深圳前海微众银行股份有限公司 Card certificate management method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079140A (en) * 2007-04-30 2007-11-28 信码互通(北京)科技有限公司 Two-dimension bar code based commercial discount credence management control system and control method
CN106067126A (en) * 2016-06-07 2016-11-02 腾讯科技(深圳)有限公司 Card certificate checks and writes off method, Apparatus and system
CN107818463A (en) * 2017-09-25 2018-03-20 九派天下支付有限公司 A kind of offline electronic payment method and system based on TOTP algorithms
CN108737394A (en) * 2018-05-08 2018-11-02 腾讯科技(深圳)有限公司 Off-line verification system, barcode scanning equipment and server
CN109993524A (en) * 2019-03-29 2019-07-09 深圳前海微众银行股份有限公司 Card certificate management method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN101340437B (en) Time source regulating method and system
JP4603252B2 (en) Security framework and protocol for universal general transactions
US8626666B2 (en) Confirming physical custody of objects
CN109766979B (en) Two-dimensional code generation method, verification method and device
CN1831865B (en) Electronic bank safety authorization system and method based on CPK
CN103679436A (en) Electronic contract security system and method based on biological information identification
US20050044385A1 (en) Systems and methods for secure authentication of electronic transactions
JP2005010826A (en) Authentication terminal device, biometrics information authentication system and biometrics information acquisition system
CA2299294A1 (en) Secure transaction system
CN103107996A (en) On-line download method and system of digital certificate and digital certificate issuing platform
US7559466B2 (en) Item authentication
US20160132871A1 (en) Secure redemption code generation for gift cards and promotions
CN110210270A (en) Two-dimensional barcode information safety encryption and system and image in 2 D code analytic method and system
KR20150029664A (en) Payment gateway system using security code based on time stamp, and the operating method thereof
WO2000000882A2 (en) Apparatus and method for end-to-end authentication using biometric data
US20050076213A1 (en) Self-enrollment and authentication method
CN113159865A (en) Card coupon verification method based on two-dimensional code
CN111541708B (en) Identity authentication method based on power distribution
AU2009202963B2 (en) Token for use in online electronic transactions
AnilKumar Secure I-voting system using QR code and biometric authentication.
KR20020086030A (en) User Authentication Method and System on Public Key Certificate including Personal Identification Information
CN113743933B (en) E-commerce platform transaction information encryption transmission method and system based on block chain
KR20180093547A (en) Electronic signature method using signer identification
CN100514905C (en) Method and devices for performing security control in electronic message exchanges
CN115801333A (en) Method for applying root legal identity business account

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210723