CN107194692A - A kind of method and terminal for obtaining two magnetic track informations of dynamic - Google Patents

A kind of method and terminal for obtaining two magnetic track informations of dynamic Download PDF

Info

Publication number
CN107194692A
CN107194692A CN201710388686.XA CN201710388686A CN107194692A CN 107194692 A CN107194692 A CN 107194692A CN 201710388686 A CN201710388686 A CN 201710388686A CN 107194692 A CN107194692 A CN 107194692A
Authority
CN
China
Prior art keywords
information
filled
terminal
magnetic track
numerical value
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.)
Granted
Application number
CN201710388686.XA
Other languages
Chinese (zh)
Other versions
CN107194692B (en
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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201710388686.XA priority Critical patent/CN107194692B/en
Publication of CN107194692A publication Critical patent/CN107194692A/en
Application granted granted Critical
Publication of CN107194692B publication Critical patent/CN107194692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
    • G06Q20/352Contactless payments by cards
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/206Point-of-sale [POS] network systems comprising security or operator identification provisions, e.g. password entry
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/409Device specific authentication in transaction processing
    • G06Q20/4097Device specific authentication in transaction processing using mutual authentication between devices and transaction partners
    • G06Q20/40975Device specific authentication in transaction processing using mutual authentication between devices and transaction partners using encryption therefor

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a kind of method and terminal for obtaining two magnetic track informations of dynamic, belong to field of information security technology.Method disclosed by the invention gets the first information, the second information, the 3rd information and two magnetic track informations including terminal from card image;Terminal calculates numerical value to be filled according to second information and the 3rd information;The terminal generates random number, and the response data that card is returned is obtained by sending the calculating dynamic authentication code instruction comprising the random number to card;Terminal is filled according to the first information, second information, the response data, the random number and the numerical value to be filled to two magnetic track information, regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.Two magnetic track informations of dynamic obtained using the inventive method and terminal can reduce the risk being tampered during two magnetic track information is uploaded to acquirer by terminal, and then strengthen transaction security.

Description

A kind of method and terminal for obtaining two magnetic track informations of dynamic
Technical field
The invention belongs to field of information security technology, more particularly to a kind of method and terminal for obtaining two magnetic track informations of dynamic.
Background technology
In the transaction of conventional magnetic stripe card, it is only necessary to which two magnetic track informations and trading password can complete transaction, therefore two magnetic tracks Information plays vital effect in terms of transaction security is protected.
Current intellective IC card with terminal when carrying out non-contact transaction, terminal simulation magnetic stripe card come carry out it is non-connect transaction, As long as two magnetic track informations obtained from intellective IC card are reported acquirer by terminal, you can complete transaction, therefore two magnetic tracks Information is most important in transaction, and it is that the present invention will that transaction security how is improved by strengthening the security of two magnetic track informations The technical problem of solution.
The content of the invention
In order to reach the purpose of enhancing transaction security by strengthening the security of two magnetic track informations, the invention provides A kind of method and terminal for obtaining two magnetic track informations of dynamic.
Technical scheme is as follows:A kind of method for obtaining two magnetic track informations of dynamic, including:
Step S1:Terminal obtains card image from card, and the first information, the second letter are obtained from the card image Breath, the 3rd information and two magnetic track informations;
Step S2:The terminal calculates numerical value to be filled according to second information and the 3rd information;The end End generation random number, calculates dynamic authentication code instruction according to random number composition, the calculating dynamic authentication is sent to card Code instruction and the instruction response for receiving card return, response data is obtained from the instruction response;
Step S3:Terminal is according to the first information, second information, the response data, the random number and described Numerical value to be filled is filled to two magnetic track information, regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
Above-mentioned steps S1 is specifically included,
Step 101:The terminal obtains card image from the card;
Step 102:The terminal obtains the first information according to the first default label value from the card image, according to the Two default label values obtain the second information from the card image, are obtained according to the 3rd default label value from the card image The 3rd information is taken, two magnetic track informations are obtained from the card image according to the 4th default label value.
Above-mentioned steps 101 are specifically included,
Step 101-1:The terminal sends read record instruction to the card, and receives the read record instruction of card return Response;
Step 101-2:The terminal judges whether the conditional code byte of the read record instruction response is to represent to perform into The numerical value of work(, is then to perform step 101-3, and otherwise the terminal obtains dynamic two magnetic track informations failure, terminates;
Step 101-3:Card image is obtained in the data field that the terminal instructs response from the read record.
Also include before above-mentioned steps 102:The terminal judges whether the card image is complete, is, performs step 102, otherwise the terminal acquisition dynamic two magnetic track informations failure, terminates;
The terminal judges whether the card image is complete specifically, the card letter that the terminal judgement is got Whether comprising the first default label value, the second default label value, the 3rd default label value and the 4th default label value in breath, and respectively The individual default label value TLV form complete to that should have, is that then the card image is complete, otherwise the card image is imperfect.
It is preferred that, above-mentioned terminal calculates numerical value to be filled and specifically wrapped according to second information and the 3rd information Include, the terminal calculate obtaining numerical value to be filled according to preset formula to second information and the 3rd information, institute State terminal and judge whether the numerical value to be filled meets preparatory condition, be that then the terminal generates the random number, it is otherwise described Terminal obtains dynamic two magnetic track informations failure, terminates;
Wherein, the preset formula is n=A-B, and wherein n is numerical value to be filled, and A is the number of bit 1 in the second information Value, B is to carry out the numerical value that assignment is obtained using the 3rd information.
The terminal judges whether the numerical value to be filled meets preparatory condition specifically, waiting to fill out described in terminal judgement Whether value of making up the number is more than 0 and less than 8, is to meet preparatory condition, is otherwise unsatisfactory for preparatory condition.
It is preferred that, the above-mentioned acquisition response data from the instruction response includes:The terminal is according to the 5th default label Value obtains the first response data from the instruction response, and second is obtained from the instruction response according to the 6th default label value Response data.
It is preferred that, two magnetic track information includes primary account number region, due date region, service codes region and self-defined number According to region.
It is preferred that, above-mentioned response data includes the first response data and the second response data, and above-mentioned steps S3 is specially:Institute It is the position indicated by 1 data that terminal, which is stated, according to bit in the first information, and the first response data is filled into two magnetic tracks letter The self-defining data region of breath, the position indicated according to bit in the second information described in 1 data, by the second response data The self-defining data region of two magnetic track informations is filled into the random number, the numerical value to be filled is filled into two magnetic track informations Low level rise the first byte location, and using two magnetic track informations obtained after filling be used as dynamic two magnetic track informations.
The low level that the numerical value to be filled is filled into two magnetic track informations plays the first byte location and is specially:The end End judges whether the rear nibble that the low level of two magnetic track informations plays the first byte is preset value, is to fill out the numerical value to be filled The low level for being charged to two magnetic track informations plays the first half byte location of the first byte, and the numerical value to be filled otherwise is filled into rear half-word Save position.
Present invention also offers a kind of terminal, including:
First acquisition module, for obtaining card image from card, and obtain from the card image first information, Second information, the 3rd information and two magnetic track informations;
Computing module, based on second information and the 3rd information got according to first acquisition module Calculate numerical value to be filled;
Generation module, dynamic authentication code instruction is calculated for generating random number, and according to random number composition;It is additionally operable to The instruction response for calculating dynamic authentication code instruction and receiving card return is sent to card;
Second acquisition module, the instruction for being received from the generation module obtains response data in responding;
Module is filled, for the first information obtained according to first acquisition module and second information, institute State the response data, the random number of generation module generation, the computing module meter of the second acquisition module acquisition The numerical value to be filled calculated is filled to two magnetic track information obtains two magnetic track informations of dynamic.
It is preferred that, above-mentioned first acquisition module includes first acquisition unit and second acquisition unit;
The first acquisition unit, specifically for obtaining card image from the card;
The second acquisition unit, specifically for obtaining the first letter from the card image according to the first default label value Breath, obtains the second information according to the second default label value from the card image, label value is preset from the card according to the 3rd The 3rd information is obtained in piece information, two magnetic track informations are obtained from the card image according to the 4th default label value.
It is preferred that, the first acquisition unit includes transmitting-receiving subelement, judgment sub-unit and obtains subelement;
The transmitting-receiving subelement, for sending read record instruction to card, and receives the read record instruction response of card return;
The judgment sub-unit, the state for judging the read record instruction response that the transmitting-receiving subelement is received Whether code word section is the numerical value for representing to run succeeded;
The acquisition subelement, for when the judged result of the judgment sub-unit is is, from read record instruction Card image is obtained in the data field of response;
Accordingly, the terminal also includes the module that reports an error, for when the judged result of the judgment sub-unit is no, carrying Show acquisition dynamic two magnetic track informations failure.
It is preferred that, above-mentioned terminal also includes judge module, the judge module, for judging that first acquisition module is obtained Whether the card image got is complete, specifically for judging in the card image that first acquisition module is got Whether comprising the first default label value, the second default label value, the 3rd default label value and the 4th default label value, and each is pre- It is that then the card image is complete, otherwise the card image is imperfect if the label value TLV form complete to that should have.
It is preferred that, above-mentioned terminal also includes reporting an error module, the module that reports an error be used for point out obtain dynamically two magnetic track informations Failure;The computing module, specifically for being calculated according to preset formula to second information and the 3rd information To numerical value to be filled, and judge whether the numerical value to be filled meets preparatory condition, be to trigger the generation module, otherwise touch Report an error module described in hair;
The preset formula is n=A-B, and wherein n is numerical value to be filled, and A is the quantitative value of bit 1 in the second information, B It is to carry out the numerical value that assignment is obtained using the 3rd information.
It is preferred that, above-mentioned second acquisition module, specifically for being received according to the 5th default label value from the generation module To instruction response in obtain the first response data, obtain second from the instruction response according to the 6th default label value Response data.
It is preferred that, above-mentioned filling module includes the first fills unit, the second fills unit and the 3rd fills unit;
First fills unit, for being the position indicated by 1 data according to bit in the first information, will be responded The first response data included in data is filled into the self-defining data region of two magnetic track informations;
Second fills unit, for the position indicated according to bit in the second information described in 1 data, by sound The second response data included in data and the random number is answered to be filled into the self-defining data region of two magnetic track informations;
3rd fills unit, the first byte position is played for the numerical value to be filled to be filled into the low level of two magnetic track informations Put, and regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
3rd fills unit, specifically for judge two magnetic track informations low level rise the first byte rear nibble whether It is preset value, is, the low level that the numerical value to be filled is filled into two magnetic track informations plays the first half byte location of the first byte, Otherwise the numerical value to be filled is filled into later half byte location.
The beneficial effects of the present invention are:The terminal of the present invention in two magnetic track informations by filling data (such as:From card The card identifying code and transaction counter of middle acquisition, and terminal oneself generation random number) obtain dynamic two magnetic track informations, and will The magnetic track information of dynamic two reports acquirer, and acquirer is merchandised to completion after dynamic two magnetic track informations verification, from And the risk for avoiding two magnetic track informations from being tampered, and then strengthen transaction security.
Brief description of the drawings
Fig. 1 is a kind of method flow diagram for acquisition two magnetic track informations of dynamic that the embodiment of the present invention 1 is provided;
Fig. 2 is a kind of method flow diagram for acquisition two magnetic track informations of dynamic that the embodiment of the present invention 2 is provided;
Fig. 3 is a kind of composition frame chart for terminal that the embodiment of the present invention 3 is provided.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.The terminal being related in the present invention can be the financial terminals such as POS.
Embodiment 1
The embodiment of the present invention 1 provides a kind of method for obtaining two magnetic track informations of dynamic, as shown in figure 1, comprising the following steps:
Step S1:Terminal obtains card image from card, and the first information, the second letter are obtained from the card image Breath, the 3rd information and two magnetic track informations;
Specifically, terminal gets the first information, the second information, the by sending read record instruction to card from card Three information and two magnetic track informations.
It is preferred that, terminal sends read record to card and instructed, and receives the instruction response of card return, successively according to first Default label value, the second default label value, the 3rd default label value and the 4th default label value are obtained from the instruction response To the first information, the second information, the 3rd information and two magnetic track informations.
Step S2:Terminal calculates numerical value to be filled according to second information and the 3rd information;
Specifically, the quantity of bit 1 in the second information is designated as A by terminal, the 3rd information is designated as B, according to default public affairs Formula n=A-B is calculated and is obtained numerical value to be filled, and wherein n is numerical value to be filled.
Step S3:Terminal generates random number, calculates dynamic authentication code instruction according to random number composition, is sent to card The instruction response for calculating dynamic authentication code instruction and receiving card return;
It is preferred that, terminal generates the random number that a length is 4 bytes, and the random number is filled into calculating dynamic authentication In the data field of code instruction, the calculating dynamic authentication code instruction after filling is sent to card, and receive the instruction of card return Response.
Step S4:Terminal obtains the first response data and the second response data from the instruction response;
It is preferred that, terminal obtains the first response data according to the 5th default label value from the instruction response, according to the Six default label values obtain the second response data from the instruction response.
Step S5:Terminal is according to the first information, the second information, the first response data, the second response data, the random number Two magnetic track information is filled with the numerical value to be filled, two magnetic track informations obtained after filling are regard as two magnetic of dynamic Road information.
Specifically, two magnetic track informations include primary account number (PAN) region, due date (ED) region, service codes (SC) region With self-defining data (DD) region.
It is preferred that, terminal is the position indicated by 1 data according to bit in the first information and the second information, will be described First response data, second response data, the random number and the numerical value to be filled are filled into oneself of two magnetic track informations Data area is defined, and regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
Embodiment 2
The embodiment of the present invention 2 provides a kind of method for obtaining two magnetic track informations of dynamic, as shown in Fig. 2 comprising the following steps:
Step 101:Terminal obtains card image from card;
This step is specifically included,
Step 101-1:Terminal sends read record instruction to card, and receives the read record instruction response of card return;
Step 101-2:Terminal judges whether the conditional code byte of the read record instruction response is 90 00, is to perform Step 101-3, otherwise terminal, which is terminated, merchandises, and obtains dynamic two magnetic track informations failure, terminates.
Step 101-3:Card image is obtained in the data field that terminal instructs response from the read record.
Specifically, terminal obtains the data numeric field data of the instruction response according to TLV forms (wherein Tag=70), and will The data numeric field data of acquisition is used as the card image read.
For example, the read record instruction that terminal is sent to card is the 0C 00 of 00 B2 01;
The instruction response that terminal receives card return is as follows:
70 7F 9F 6C 02 00 01 56 3E 42 35 34 31 33 31 32
33 34 35 36 37 38 34 38 30 30 5E 53 55 50 50 4C
49 45 44 2F 4E 4F 54 5E 30 39 30 36 31 30 31 33
33 30 30 30 33 33 33 30 30 30 32 32 32 32 32 30
30 30 31 31 31 31 30 9F 64 01 03 9F 62 06 00 00
00 38 00 00 9F 63 06 00 00 00 00 E0 E0 9F 65 02
00 0E 9F 66 02 0E 70 9F 6B 13 54 13 12 34 56 78
48 00 D0 90 61 01 90 00 99 00 00 00 0F 9F 67 01
03 90 00。
Wherein, the conditional code byte is 90 00, and the card image of acquisition is the 3E of 9F 6C 02 00 01 56 42 35 34 31 33 31 32 33 34 35 36 37 38 34 38 30 30 5E 53 55 50 50 4C 49 45 44 2F 4E 4F 54 5E 30 39 30 36 31 30 31 33 33 30 30 30 33 33 33 30 30 30 32 32 32 32 32 30 30 30 31 31 31 31 30 9F 64 01 03 9F 62 06 00 00 00 38 00 00 9F 63 06 00 00 00 00 E0 E0 9F 65 02 00 0E 9F 66 02 0E 70 9F 6B 13 54 13 12 34 56 78 48 00 D0 90 61 01 90 00 99 00 00 00 0F 9F 67 01 03。
Step 102:Terminal judges whether the card image got is complete, is then to perform step 103, otherwise performs Step 111;
Specifically, terminal judges whether preset in the card image got comprising the first default label value, second Label value, the 3rd default label value and the 4th default label value, and each default label value TLV form complete to that should have, be Then the card image is complete, and otherwise the card image is imperfect.
Specifically, the first default label value is 9F65, the second default label value is 9F66, and the 3rd default label value is 9F67, the 4th default label value is 9F6B.
Step 103:Terminal obtains the first information according to the first default label value from the card image, pre- according to second If label value obtains the second information from the card image, the is obtained from the card image according to the 3rd default label value Three information, two magnetic track informations are obtained according to the 4th default label value from the card image;
For example, the first information (the position of card identifying code got according to the first default label value 9F65 from card image Figure information) it is 00 0E, the second information (numerical value to be filled got according to the second default label value 9F 66 from card image With the message bit pattern of transaction counter) it is 0E 70, the got according to the 3rd default label value 9F 67 from card image Three information are (such as:The digit information of transaction counter) it is 03, got according to the 4th default label value 9F6B from card image Two magnetic track informations (Track 2Data) be 54 13 12 34 56 78 48 00 D0 90 61 01 90 00 99 00 00 00 0F。
Step 104:Terminal calculates according to preset formula, the second information and the 3rd information and obtains numerical value to be filled;
Specifically, the preset formula is n=A-B, wherein n is numerical value to be filled, and A is bit 1 in the second information Quantitative value, B is to carry out the numerical value that assignment is obtained using the 3rd information.
For example, the second information is 0E 70, then A=6, the 3rd information is 03, then B=3, then n=A-B=3.
Step 105:Terminal judges whether the numerical value to be filled meets preparatory condition, is then to perform step 106, otherwise holds Row step 111;
Specifically, judging whether the numerical value to be filled is more than 0 and less than 8, it is to meet preparatory condition, performs step 106, preparatory condition is otherwise unsatisfactory for, step 111 is performed.
For example, obtained numerical value to be filled is calculated in the present embodiment is equal to 3, preparatory condition is met.
Step 106:Terminal generates the random number of 4 bytes, and dynamic authentication code instruction is calculated according to random number composition, to Card sends the instruction response for calculating dynamic authentication code instruction and receiving card return;
The present embodiment, it is described to be specially according to random number composition calculating dynamic authentication code instruction:Terminal is by 4 bytes of generation Random number be filled into calculate dynamic authentication code instruction data field in, it is described calculate dynamic authentication code instruction data format be 80 2A 8E 80 04 Data 00。
For example, the random number of 4 bytes of terminal generation is 00 00 08 99;
The calculating dynamic authentication code instruction that terminal is sent to card is:80 2A 8E 80 04 00 00 08 99 00.
Step 107:Terminal judges whether the data format of the instruction response is correct, is then to perform step 108, otherwise holds Row step 111;
This step is specifically included:
Step 107-1:Terminal judges whether the conditional code byte of the instruction response is 90 00, is to perform step 107-2, otherwise the data format of the instruction response is incorrect, performs step 111;
Step 107-2:Terminal judges whether first, second byte of the data field of the instruction response is 77 0F, is then Step 107-3 is performed, otherwise the data format of the instruction response is incorrect, performs step 111;
For example, the instruction response that the card that terminal is received is returned is the 9F 60 of 77 0F 9F, 61 02 B8 92 02 FB C7 9F 36 02 00 5E 90 00。
Step 107-3:Terminal judges whether preset label value and the 6th comprising the 5th in the data field of the instruction response Default label value, is that the data format of the then instruction response is correct, performs step 108, otherwise the data of the instruction response Form is incorrect, performs step 111.
Specifically, the described 5th default label value is 9F 61, the described 6th default label value is 9F 36.
Step 108:Terminal obtains the first response data according to the 5th default label value from the instruction response, according to the Six default label values obtain the second response data from the instruction response;
In the present embodiment, first response data is specially card identifying code, and second response data is specially transaction Count value.
For example, the instruction response is the 5E of 77 0F 9F, 61 02 B8,92 9F, 60 02 FB C7 9F 36 02 00 90 00, it is B8 92 according to the 5th default label value 9F 61 the first response datas obtained, according to the 6th default label value 9F 36 the second response datas obtained are 00 5E.
Step 109:Terminal is bit in the position indicated by 1 data and the second information according to bit in the first information Position is the position indicated by 1 data, and the random number of the first response data, the second response data and 4 byte is filled into In two magnetic track informations, the low level that the numerical value to be filled is filled into two magnetic track informations plays the first byte location;
Specifically, terminal is the position indicated by 1 data according to bit in the first information, the first response data is filled out The self-defining data region of two magnetic track informations is charged to, the position indicated according to bit in the second information described in 1 data will The random number of second response data and 4 byte is filled into the self-defining data region of two magnetic track informations.
The low level that the numerical value to be filled is filled into two magnetic track informations plays first character section position and is specially:Terminal Whether the rear nibble for judging the first byte of low level of two magnetic track informations is F, is that the numerical value to be filled is filled into two The low level of magnetic track information plays the first half byte location of the first byte, and the numerical value to be filled otherwise is filled into the rear nibble Position.
For example, two magnetic track informations (Track 2Data) before filling are 54 13 12 34 56 78 48 00 D0 90 61 01 90 00 99 00 00 00 0F;
The first information is 00 0E, and it is 1110 to be converted to binary number, then bit is signified for 1 data in the first information The position shown is specially the second byte of low level in two magnetic track informations and the rear nibble of the 3rd byte;
First response data is B8 92, and correspondence decimal number is 47250;
Second information is 0E 70, and it is 111001110000 to be converted to binary number;Then bit is 1 in the second information Position indicated by data is specially the preceding nibble for the 3rd byte that low level rises, nybble, the 6th word in two magnetic track informations The rear nibble of section and the 7th byte;
Second response data is 00 5E, and correspondence decimal number is 94;The random number of 4 bytes is 00 00 08 99;
The numerical value to be filled is equal to 3;
Two magnetic track informations obtained after filling are as follows:
54 13 12 34 56 78 48 00 D0 90 61 01 90 94 99 89 92 503F。
Step 110:Terminal as two magnetic track informations of dynamic of acquisition, terminates two magnetic track informations obtained after filling;
For example, two magnetic track informations of dynamic obtained in the present embodiment by being filled to two magnetic track informations after operation are 54 13 12 34 56 78 48 00 D0 90 61 01 90 94 99 89 92 50 3F。
Step 111:Terminal obtains dynamic two magnetic track informations failure, terminates.
Embodiment 3
A kind of terminal that the present embodiment is provided, as shown in figure 3, including:
First acquisition module 301, for obtaining card image from card, and acquisition first is believed from the card image Breath, the second information, the 3rd information and two magnetic track informations;
It is preferred that, the first information is specially the message bit pattern of card identifying code, and the second information is specially numerical value to be filled and friendship The message bit pattern of easy count value, the 3rd information is specially the digit information of transaction counter.
Computing module 302, for second information that is got according to first acquisition module 301 and described 3rd information calculates numerical value to be filled;
Generation module 303, dynamic authentication code instruction is calculated for generating random number, and according to random number composition;Also Responded for sending the instruction for calculating dynamic authentication code instruction and receiving card return to card;
Second acquisition module 304, the instruction for being received from the generation module 303 obtains response data in responding;
Module 305 is filled, for the first information and second letter obtained according to first acquisition module 301 The random number, described that the response data that breath, second acquisition module 304 are obtained, the generation module 303 are generated The numerical value to be filled that computing module 302 is calculated is filled to two magnetic track information obtains two magnetic track informations of dynamic.
In the present embodiment, first acquisition module 301 includes first acquisition unit and second acquisition unit;
The first acquisition unit, specifically for obtaining card image from the card;
The second acquisition unit, specifically for obtaining the first letter from the card image according to the first default label value Breath, obtains the second information according to the second default label value from the card image, label value is preset from the card according to the 3rd The 3rd information is obtained in piece information, two magnetic track informations are obtained from the card image according to the 4th default label value.
Further, the first acquisition unit includes transmitting-receiving subelement, judgment sub-unit and obtains subelement;
The transmitting-receiving subelement, for sending read record instruction to card, and receives the read record instruction response of card return;
The judgment sub-unit, the state for judging the read record instruction response that the transmitting-receiving subelement is received Whether code word section is the numerical value for representing to run succeeded;
The acquisition subelement, for when the judged result of the judgment sub-unit is is, from read record instruction Card image is obtained in the data field of response;
The terminal also includes the module that reports an error, for when the judged result of the judgment sub-unit is no, pointing out to obtain Dynamic two magnetic track informations failure.
Further, the terminal can also include judge module, the judge module, for judging that described first obtains Whether the card image that module 301 is got is complete, specifically for judging the institute that first acquisition module 301 is got Whether state in card image comprising the first default label value, the second default label value, the 3rd default label value and the 4th pre- bidding Label value, and each default label value TLV form complete to that should have, are that then the card image is complete, otherwise the card letter Breath is imperfect.
The computing module 302, specifically for being carried out according to preset formula to second information and the 3rd information Calculating obtains numerical value to be filled, and judges whether the numerical value to be filled meets preparatory condition, is to trigger the generation module 303, otherwise report an error module described in triggering;The terminal also includes reporting an error module, the module that reports an error be used for point out obtain dynamically Two magnetic track informations fail;
The preset formula is n=A-B, and wherein n is numerical value to be filled, and A is the quantitative value of bit 1 in the second information, B It is to carry out the numerical value that assignment is obtained using the 3rd information.
It is preferred that, judge whether the numerical value to be filled meets preparatory condition specifically, judging that the numerical value to be filled is It is no to be more than 0 and less than 8, it is to trigger the generation module, otherwise report an error module described in triggering.
It is preferred that, two magnetic track informations described in the present embodiment include primary account number region, due date region, service codes region With self-defining data region.
In the present embodiment, second acquisition module 304, specifically for presetting label value from the generation mould according to the 5th The first response data is obtained in the instruction response that block 303 is received, is responded according to the 6th default label value from the instruction The second response data of middle acquisition.
In the present embodiment, the filling module 305 includes the first fills unit, the second fills unit and the 3rd fills unit;
First fills unit, for being the position indicated by 1 data according to bit in the first information, will be responded The first response data included in data is filled into the self-defining data region of two magnetic track informations;It is preferred that, first response Data are specially card identifying code, and second response data is specially transaction counter.
Second fills unit, for the position indicated according to bit in the second information described in 1 data, by sound The second response data included in data and the random number is answered to be filled into the self-defining data region of two magnetic track informations;
3rd fills unit, the first byte position is played for the numerical value to be filled to be filled into the low level of two magnetic track informations Put, and regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
3rd fills unit, can also be specifically for judging that the low level of two magnetic track informations plays the rear half-word of the first byte Whether section is preset value, is, the low level that the numerical value to be filled is filled into two magnetic track informations plays the preceding nibble of the first byte Position, is otherwise filled into later half byte location by the numerical value to be filled.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, the change or replacement that can be readily occurred in, all should It is included within the scope of the present invention.Therefore, protection scope of the present invention should be defined by scope of the claims.

Claims (20)

1. a kind of method for obtaining two magnetic track informations of dynamic, it is characterised in that including:
Step S1:Terminal obtains card image from card, and the first information, the second information, the are obtained from the card image Three information and two magnetic track informations;
Step S2:The terminal calculates numerical value to be filled according to second information and the 3rd information;The terminal life Into random number, dynamic authentication code instruction is calculated according to random number composition, sending the calculating dynamic authentication codes to card refers to The instruction response of card return is made and received, response data is obtained from the instruction response;
Step S3:Terminal is according to the first information, second information, the response data, the random number and described treats Filling numerical value is filled to two magnetic track information, regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
2. according to the method described in claim 1, it is characterised in that the step S1 is specifically included:
Step 101:The terminal obtains card image from the card;
Step 102:The terminal obtains the first information according to the first default label value from the card image, pre- according to second If label value obtains the second information from the card image, the is obtained from the card image according to the 3rd default label value Three information, two magnetic track informations are obtained according to the 4th default label value from the card image.
3. method according to claim 2, it is characterised in that the step 101 is specifically included:
Step 101-1:The terminal sends read record instruction to the card, and receives the read record instruction sound of card return Should;
Step 101-2:The terminal judges whether the conditional code byte of the read record instruction response represents to run succeeded Numerical value, is then to perform step 101-3, and otherwise the terminal obtains dynamic two magnetic track informations failure, terminates;
Step 101-3:Card image is obtained in the data field that the terminal instructs response from the read record.
4. method according to claim 2, it is characterised in that also include before the step 102:The terminal judges institute Whether complete state card image, be then to perform step 102, otherwise the terminal obtains dynamic two magnetic track informations failure, terminates;
The terminal judges whether the card image is complete specifically, in the card image that the terminal judgement is got Whether comprising the first default label value, the second default label value, the 3rd default label value and the 4th default label value, and each is pre- It is that then the card image is complete, otherwise the card image is imperfect if the label value TLV form complete to that should have.
5. according to the method described in claim 1, it is characterised in that the terminal is according to second information and the 3rd letter Breath calculates numerical value to be filled and specifically included:The terminal is entered according to preset formula to second information and the 3rd information Row calculating obtains numerical value to be filled, and the terminal judges whether the numerical value to be filled meets preparatory condition, is the then terminal The random number is generated, otherwise the terminal obtains dynamic two magnetic track informations failure, terminates;
Wherein, the preset formula is n=A-B, and wherein n is numerical value to be filled, and A is the quantitative value of bit 1 in the second information, B is to carry out the numerical value that assignment is obtained using the 3rd information.
6. method according to claim 5, it is characterised in that the terminal judges whether the numerical value to be filled meets pre- If condition is specially:The terminal judges whether the numerical value to be filled is more than 0 and less than 8, is to meet preparatory condition, otherwise It is unsatisfactory for preparatory condition.
7. according to the method described in claim 1, it is characterised in that described to obtain response data packet from the instruction response Include:The terminal obtains the first response data according to the 5th default label value from the instruction response, according to the 6th pre- bidding Label value obtains the second response data from the instruction response.
8. according to the method described in claim 1, it is characterised in that two magnetic track information includes primary account number region, Expiration Date Term area, service codes region and self-defining data region.
9. according to the method described in claim 1, it is characterised in that the response data includes the first response data and the second sound Data are answered, the step S3 is specially:The terminal is the position indicated by 1 data according to bit in the first information, will First response data is filled into the self-defining data region of two magnetic track informations, according to bit in the second information for 1 data institute The position of instruction is stated, the second response data and the random number are filled into the self-defining data region of two magnetic track informations, by institute State numerical value to be filled and be filled into the first byte location of low level of two magnetic track informations, and two magnetic track informations obtained after filling are made For two magnetic track informations of dynamic.
10. method according to claim 9, it is characterised in that described that the numerical value to be filled is filled into two magnetic tracks letter The low level of breath plays the first byte location:The terminal judges that the low level of two magnetic track informations plays the rear nibble of the first byte Whether it is preset value, is, the low level that the numerical value to be filled is filled into two magnetic track informations plays the preceding nibble position of the first byte Put, the numerical value to be filled is otherwise filled into later half byte location.
11. a kind of terminal, it is characterised in that including:
First acquisition module, for obtaining card image, and the acquisition first information, second from the card image from card Information, the 3rd information and two magnetic track informations;
Computing module, second information and the 3rd information for being got according to first acquisition module are calculated Numerical value to be filled;
Generation module, dynamic authentication code instruction is calculated for generating random number, and according to random number composition;It is additionally operable to card Piece sends the instruction response for calculating dynamic authentication code instruction and receiving card return;
Second acquisition module, the instruction for being received from the generation module obtains response data in responding;
Module is filled, for the first information obtained according to first acquisition module and second information, described the The response data of two acquisition modules acquisition, the random number of generation module generation, the computing module are calculated The numerical value to be filled two magnetic track information is filled obtain dynamic two magnetic track informations.
12. terminal according to claim 11, it is characterised in that first acquisition module include first acquisition unit and Second acquisition unit;
The first acquisition unit, specifically for obtaining card image from the card;
The second acquisition unit, specifically for obtaining the first information from the card image according to the first default label value, Second information is obtained from the card image according to the second default label value, believed according to the 3rd default label value from the card The 3rd information is obtained in breath, two magnetic track informations are obtained from the card image according to the 4th default label value.
13. terminal according to claim 12, it is characterised in that the first acquisition unit includes transmitting-receiving subelement, sentenced Disconnected subelement and acquisition subelement;
The transmitting-receiving subelement, for sending read record instruction to card, and receives the read record instruction response of card return;
The judgment sub-unit, the state code word for judging the read record instruction response that the transmitting-receiving subelement is received Whether section is the numerical value for representing to run succeeded;
The acquisition subelement, for when the judged result of the judgment sub-unit is is, instructing and responding from the read record Data field in obtain card image;
The terminal also includes the module that reports an error, for when the judged result of the judgment sub-unit is no, pointing out to obtain dynamic Two magnetic track informations fail.
14. terminal according to claim 12, it is characterised in that the terminal also includes judge module, the judgement mould Block, for judging whether the card image that first acquisition module is got is complete, specifically for judging described first Whether preset in the card image that acquisition module is got comprising the first default label value, the second default label value, the 3rd Label value and the 4th default label value, and each default label value TLV form complete to that should have, are that then the card image is complete Whole, otherwise the card image is imperfect.
15. terminal according to claim 11, it is characterised in that the terminal also includes report an error module, the mould that reports an error Block is used to point out to obtain dynamic two magnetic track informations failure;
The computing module, specifically for being calculated according to preset formula second information and the 3rd information Numerical value to be filled, and judge whether the numerical value to be filled meets preparatory condition, it is to trigger the generation module, otherwise triggers The module that reports an error;
The preset formula is n=A-B, and wherein n is numerical value to be filled, and A is the quantitative value of bit 1 in the second information, and B is to make The numerical value that assignment is obtained is carried out with the 3rd information.
16. terminal according to claim 15, it is characterised in that the computing module, specifically for according to preset formula Second information and the 3rd information calculate obtaining numerical value to be filled, and judge whether the numerical value to be filled is big It is to trigger the generation module, otherwise report an error module described in triggering in 0 and less than 8.
17. terminal according to claim 11, it is characterised in that second acquisition module, specifically for according to the 5th The first response data is obtained in the instruction response that default label value is received from the generation module, according to the 6th pre- bidding Label value obtains the second response data from the instruction response.
18. terminal according to claim 11, it is characterised in that two magnetic track information includes primary account number region, expired Date region, service codes region and self-defining data region.
19. terminal according to claim 11, it is characterised in that the filling module includes the first fills unit, second Fills unit and the 3rd fills unit;
First fills unit, for being the position indicated by 1 data according to bit in the first information, by response data In the first response data for including be filled into the self-defining data regions of two magnetic track informations;
Second fills unit, for the position indicated according to bit in the second information described in 1 data, by number of responses The second response data and the random number that are included in are filled into the self-defining data region of two magnetic track informations;
3rd fills unit, the first byte location is played for the numerical value to be filled to be filled into the low level of two magnetic track informations, and It regard two magnetic track informations obtained after filling as two magnetic track informations of dynamic.
20. terminal according to claim 19, it is characterised in that the 3rd fills unit, specifically for judging two magnetic Whether the rear nibble that the low level of road information plays the first byte is preset value, is that the numerical value to be filled is filled into two magnetic tracks The low level of information plays the first half byte location of the first byte, and the numerical value to be filled otherwise is filled into later half byte location.
CN201710388686.XA 2017-05-27 2017-05-27 Method and terminal for acquiring dynamic two-track information Active CN107194692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710388686.XA CN107194692B (en) 2017-05-27 2017-05-27 Method and terminal for acquiring dynamic two-track information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710388686.XA CN107194692B (en) 2017-05-27 2017-05-27 Method and terminal for acquiring dynamic two-track information

Publications (2)

Publication Number Publication Date
CN107194692A true CN107194692A (en) 2017-09-22
CN107194692B CN107194692B (en) 2020-10-13

Family

ID=59874594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710388686.XA Active CN107194692B (en) 2017-05-27 2017-05-27 Method and terminal for acquiring dynamic two-track information

Country Status (1)

Country Link
CN (1) CN107194692B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796443A (en) * 2019-10-28 2020-02-14 飞天诚信科技股份有限公司 Method and terminal for constructing magnetic track data

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1650301A (en) * 2002-03-19 2005-08-03 运通卡国际股份有限公司 Method and system for conducting a transaction using a proximity device
CN101019126A (en) * 2004-07-15 2007-08-15 万事达卡国际股份有限公司 Method and system using a bitmap for passing contactless payment card transaction variables in standardized data formats
US20080217396A1 (en) * 2007-03-06 2008-09-11 Securecard Technologies, Inc. Device and method for conducting secure economic transactions
CN101523417A (en) * 2005-03-26 2009-09-02 普莱瓦西斯公司 Electronic financial transaction cards and methods
CN101632086A (en) * 2007-02-20 2010-01-20 科里普托马迪克公司 Authentication device and method
CN104969244A (en) * 2012-11-20 2015-10-07 新韩信用卡株式会社 Mobile payment system and mobile payment method using dynamic track 2 information
CN106339874A (en) * 2016-08-11 2017-01-18 飞天诚信科技股份有限公司 Online transaction method, visual financial IC card, client and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1650301A (en) * 2002-03-19 2005-08-03 运通卡国际股份有限公司 Method and system for conducting a transaction using a proximity device
CN101019126A (en) * 2004-07-15 2007-08-15 万事达卡国际股份有限公司 Method and system using a bitmap for passing contactless payment card transaction variables in standardized data formats
CN101523417A (en) * 2005-03-26 2009-09-02 普莱瓦西斯公司 Electronic financial transaction cards and methods
CN101632086A (en) * 2007-02-20 2010-01-20 科里普托马迪克公司 Authentication device and method
US20080217396A1 (en) * 2007-03-06 2008-09-11 Securecard Technologies, Inc. Device and method for conducting secure economic transactions
CN104969244A (en) * 2012-11-20 2015-10-07 新韩信用卡株式会社 Mobile payment system and mobile payment method using dynamic track 2 information
CN106339874A (en) * 2016-08-11 2017-01-18 飞天诚信科技股份有限公司 Online transaction method, visual financial IC card, client and server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796443A (en) * 2019-10-28 2020-02-14 飞天诚信科技股份有限公司 Method and terminal for constructing magnetic track data
CN110796443B (en) * 2019-10-28 2023-09-19 飞天诚信科技股份有限公司 Method and terminal for constructing track data

Also Published As

Publication number Publication date
CN107194692B (en) 2020-10-13

Similar Documents

Publication Publication Date Title
Dai et al. Contracting for on-time delivery in the US influenza vaccine supply chain
CN106557929A (en) Logistics information processing method and processing device
CN108734028A (en) Data managing method, block chain node based on block chain and storage medium
JP2012027558A (en) Two-dimensional code and individual authentication system using two-dimensional code
CN107392583A (en) A kind of two-dimension code pattern data creation method and device
CN107665459A (en) A kind of wrist-watch rent method and system
CN102377570A (en) Method and device for generating dynamic passwords
CN107194692A (en) A kind of method and terminal for obtaining two magnetic track informations of dynamic
CN106846131A (en) It is a kind of based on mobile terminal towards customed product electric business competitive bidding implementation method
CN106096928A (en) A kind of payment detection method, device, server and payment detecting system
CN106920168A (en) Futures point valency exchange information processing method and device
CN107730009A (en) A kind of wrist-watch on-line maintenance method and system
CN108334927A (en) A kind of NFC receives single label and its method of payment
CN104700300A (en) Information flow based two-way trade system and method
CN105046838B (en) A kind of simulation field operation system and method for trustship lease individual equipment
CN110084971A (en) The operating method and self-service terminal of self-service terminal
CN104698887B (en) The recording method and device and querying method and device of seal use information
CN107392548A (en) Commodity tracing management system based on commodity code
CN112669126A (en) Internet social contact and direct business electronic commerce APP platform
CN114331460A (en) Method, device, equipment and storage medium for confirming fund transaction based on block chain
CN112465519A (en) Server component fool-proof management and control method, system, terminal and storage medium
CN108510395A (en) Fund with throwing management method, device and computer readable storage medium
CN110533537A (en) A kind of financial product processing method based on block chain
CN112288505A (en) Hotel house type automatic price following method based on OTA platform
CN110796443A (en) Method and terminal for constructing magnetic track data

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
GR01 Patent grant
GR01 Patent grant