CN104506311A - Method for achieving check-in function - Google Patents

Method for achieving check-in function Download PDF

Info

Publication number
CN104506311A
CN104506311A CN201510013396.8A CN201510013396A CN104506311A CN 104506311 A CN104506311 A CN 104506311A CN 201510013396 A CN201510013396 A CN 201510013396A CN 104506311 A CN104506311 A CN 104506311A
Authority
CN
China
Prior art keywords
data
length
payment terminal
information
process 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.)
Granted
Application number
CN201510013396.8A
Other languages
Chinese (zh)
Other versions
CN104506311B (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 CN201510013396.8A priority Critical patent/CN104506311B/en
Publication of CN104506311A publication Critical patent/CN104506311A/en
Application granted granted Critical
Publication of CN104506311B publication Critical patent/CN104506311B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a method for achieving a check-in function, and belongs to the field of information safety. The method comprises the following steps: obtaining a first flow code from a flow code list by a payment terminal; using it as the current flow code; judging the type of the current flow code; if it is a receiving data code, receiving information sent by an upper computer; analyzing the information sent by the upper computer; obtaining new flow code list, new working key; storing the new working key; using the new flow code list to update the original flow code list; and if it is a check-in code, using the new working key to update the original working key. The method is capable of achieving the check-in function of the payment terminal.

Description

A kind of method of the function that realizes registering
Technical field
The present invention relates to information security field, particularly a kind of method of the function that realizes registering.
Background technology
Along with the development of science and technology, the application of payment terminal product is more and more extensive, conventional payment terminal inner stores working key, payment terminal adopts working key to be encrypted needing the data of transmission, to decipher, realize the data communication between payment terminal and host computer, those skilled in the art find, in prior art, the instruction that payment terminal execution host computer issues performs corresponding transactional operation, cannot ensure that namely current payment terminal of carrying out communicating with host computer is correct payment terminal.
Summary of the invention
In order to solve the defect existed in prior art, the present invention proposes a kind of method of the function that realizes registering, and comprising:
Step S1: payment terminal obtains first flow process code from flow process code table, it can be used as current process code;
Step S2: described payment terminal judges the type of described current process code, if receive data code, then performs step S3; If register code, then perform step S5;
Step S3: described payment terminal judges whether to receive in Preset Time the information that host computer issues, and is perform step S4; Otherwise send time-out information to described host computer, perform step S6;
Step S4: described payment terminal is resolved the information that described host computer issues, obtains new flow process code table, new working key, preserves described new working key, upgrades original flow process code table, return step S1 with described new flow process code table;
Step S5: described payment terminal judges whether to there is new working key, is, upgrades original working key with described new working key, performs step S6; Otherwise report an error, perform step S6;
Step S6: described payment terminal judges in flow process code table, after current process code, whether there is next flow process code, be perform step S7; Otherwise terminate;
Step S7: described payment terminal obtains the next flow process code after described current process code, it can be used as current process code, returns step S2.
Beneficial effect of the present invention is: payment terminal obtains flow process code table, perform each flow process code in flow process code table one by one, and when performing reception data code, the information that host computer issues can be received, resolve from the information that host computer issues and obtain new flow process code table and new working key, using the new flow process code table that obtains as the flow process code table after upgrading, perform the flow process code table after upgrading, upgrade working key; By said method, realize the function of registering of payment terminal.
Accompanying drawing explanation
The method flow diagram of a kind of function that realizes registering that Fig. 1 to Fig. 3 provides for the present embodiment 1;
Fig. 4 and Fig. 5 is the refinement flow chart of step a12 in the present embodiment 1;
Fig. 6 and Fig. 7 is the refinement flow chart of step P16 in the present embodiment 1;
The method flow diagram of a kind of function that realizes registering that Fig. 8 to Figure 10 provides for the present embodiment 2.
Embodiment
The flow process code table related in the present invention can be kept at payment terminal in advance, also can be that the instruction issued by resolving host computer obtains.
Embodiment 1
The present embodiment is a kind of method of the function that realizes registering, and as shown in Figure 1 to Figure 3, specifically comprises:
Step a1: payment terminal initialize flow code index value;
In the present embodiment, flow process code index value is set to 0 by payment terminal.
Step a2: payment terminal obtains flow process code corresponding to flow process code index value from flow process code table;
Step a3: payment terminal is new technological process code index value more;
In the present embodiment, flow process code index value is added the result of 1 as the flow process code index value after renewal by payment terminal.
Step a4: payment terminal judges whether to get flow process code, is perform step a5; Otherwise terminate.
Step a5: payment terminal judges flow process type of code, if read security module sequence number code, then performs step a6; If read terminal hardware sequence number code, then perform step a7; If link setup code, then perform step a8; If transmission data code, then perform step a9; If reception data code, then perform step a11; If register code, then perform step a14; If display object code, then perform step a16;
Particularly, payment terminal convection current range code judges, if flow process code is 0x02, then security module sequence number code read by flow process code, performs step a6;
If flow process code is 0x15, then terminal hardware sequence number code read by flow process code, performs step a7;
If flow process code is 0x1F, then flow process code is link setup code, performs step a8;
If flow process code is 0x20, is then send data code, performs step a9;
If flow process code is 0x21, is then receive data code, performs step a11;
If flow process code is 0x11, be then code of registering, perform step a14;
If flow process code is 0x1E, is then display object code, performs step a16;
In the present embodiment, perform for payment terminal and receive data code, be illustrated.
Step a6: payment terminal obtains the security module sequence number of therein, copies to security module sequence number and exports in buffer area, return step a2;
Particularly, payment terminal reads security module sequence number from security module, if read, is then copied to by security module sequence number and exports in buffer area; If read less than, then in input-buffer district, write 0x00.
Step a7: payment terminal obtains the terminal hardware sequence number of therein, copies to terminal hardware sequence number and exports in buffer area, return step a2;
Particularly, payment terminal reads the terminal hardware sequence number of therein, if read, is then copied to and exports in buffer area, if read less than, then in input-buffer district, write 0x00.
In the present embodiment, terminal hardware sequence number length is 8 bytes, comprises supplier number, unit type, batch number and manufacturer terminal self-defined information.
Step a8: payment terminal organizes link setup request, and sends it to host computer, returns step a2;
Particularly, platform address and time-out time as link setup request, are sent to host computer, return step a2 by payment terminal;
Step a9: payment terminal judges to export in buffer area whether there are data, be perform step a10; Otherwise send to host computer and there are not data to be sent, return step a2;
Step a10: payment terminal obtains the data exported in buffer area, sends it to host computer, returns step a2;
Step a11: payment terminal judges whether to receive in Preset Time the information that host computer issues, and is perform step a12; Otherwise send time-out information to host computer, return step a2;
Step a12: payment terminal is resolved the information that host computer issues, obtains new flow process code table, new working key and information to be displayed, preserves new flow process code table, new working key and information to be displayed, performs step a13;
In the present embodiment, in the information that host computer issues, comprise flow process code table, new working key and information to be displayed.
Such as: the information that host computer issues is:
7e5000000094810090030300008b00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a62100000000000000001d00;
Resolve above-mentioned information, the new flow process code table obtained is:
Flow process quantity: 04
Register: 0111
Display result 011e
Send data: 0120
Receive data: 0121.
New working key is: 25C9794A1205FF244F5FA0378D2F8D59
9BED98891580C3B2
0E51FDF196141F227A57BD154012FD39;
Information to be displayed is: 0Xc7a9b5bdb3c9b9a621;
Step a13: new flow process code table as the flow process code table after renewal, is returned step a1 by payment terminal.
Step a14: payment terminal judges whether to there is new working key, is perform step a15; Otherwise report an error, return step a2;
Step a15: the new working key of payment terminal upgrades original working key, returns step a2;
In the present embodiment, working key is preserved in advance in payment terminal inside.
Step a16: payment terminal judges whether to there is information to be displayed, is, performs step a17; Otherwise send to host computer and there is not information to be displayed, return step a2;
Step a17: payment terminal display information to be displayed, returns step a2.
Particularly, payment terminal obtains display mode, display duration and information to be displayed, and shown according to the display mode got by information to be displayed, the time of display mates with the display duration got.
In the present embodiment, the refinement of step a12, as shown in Fig. 4 to Fig. 5, specifically comprises:
Step P1: payment terminal obtains the data on the first predeterminated position of the information that host computer issues, it can be used as data field length, the data that length is identical with the value of data field length are obtained, using the data that get as data field from after the data field length in the information that host computer issues;
In the present embodiment, the first predeterminated position is the 5th, the 6th byte.
Such as: the information that host computer issues is,
7e5000000094810090030300008b00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a62100000000000000001d00;
The value 0X0094 that the 5th, the 6th byte that payment terminal obtains the information that host computer issues is, it can be used as data field length, namely data field length is 148 bytes, the data that length is 148 bytes are obtained 7th byte of the information issued from host computer, using the data that get as data field, namely data field is:
810090030300008b00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a62100000000000000001d;
Step P2: payment terminal obtains the data in data field on the second predeterminated position, it can be used as communication message length, the length data identical with the value of communication message length are obtained, using the data that get as communication message from after the communication message length in data field;
In the present embodiment, the second predeterminated position is second, third byte.
Such as: the value that payment terminal obtains second, third byte of data field is 0X0090, and it can be used as communication message length, namely communication message length is 144 bytes; From the nybble of data field, obtain the data that length is 144 bytes, using the data that get as communication message, namely communication message is:
030300008b00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a6210000000000000000;
Step P3: the data in payment terminal obtaining communication message on the 3rd predeterminated position, it can be used as transaction data length, the length data identical with the value of transaction data length are obtained from after the transaction data length in communication message, by transaction data length and the data sequence splicing got, the splicing result obtained is as transaction data;
In the present embodiment, the 3rd predeterminated position is the 4th, the 5th byte;
Such as: the 4th, the 5th byte 0X008b of payment terminal obtaining communication message, it can be used as transaction data length, namely transaction data length is 139 bytes, from the 6th byte of communication message, obtain the data that length is 139 bytes, it can be used as transaction data, namely transaction data is:
00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a6210000000000000000;
Step P4: payment terminal obtains the data in transaction data on the 4th predeterminated position, it can be used as transaction message length, the length data identical with the value of transaction message length are obtained, using the data that get as transaction message from after the transaction message length in transaction data;
In the present embodiment, the 4th predeterminated position is first, second byte;
Such as: payment terminal obtains first, second byte 0X0089 of transaction data, it can be used as transaction message length, namely transaction message length is 137 bytes, from the 3rd byte of transaction data, obtain the data that length is 137 bytes, it can be used as transaction message, namely transaction message is:
8402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a6210000000000000000;
Step P5: payment terminal obtains the data in transaction message on the 5th predeterminated position, it can be used as message content length, the length data identical with the value of message content length are obtained, using the data that get as message content from after the message content length in transaction message;
In the present embodiment, the 5th predeterminated position is the 12, the 13 byte;
Such as: payment terminal obtain transaction message the 12, the 13 byte 0X007c, it can be used as message content length, namely message content length is 124 bytes, from the tenth nybble of transaction message, obtain the data that length is 124 bytes, it can be used as message content, namely message content is:
0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a6210000000000000000;
Step P6: payment terminal obtains the data in message content on the 6th predeterminated position, it can be used as the quantity of new flow process code, create new flow process code table, and the quantity of new flow process code is kept in new flow process code table, initialize flow code count value;
In the present embodiment, the 6th predeterminated position is the 3rd crossed joint.
Such as: payment terminal obtains the 3rd crossed joint 0X04 of message content, it can be used as the quantity of new flow process code, the quantity of namely new flow process code is 4, by the quantity of new flow process code stored in new flow process code table, flow process code count value is initially 0.
Step P7: obtain the length data identical with the first preset length after the flow process code quantity that payment terminal is new from message content, it can be used as current process code length, and current process code length is kept in new flow process code table;
In the present embodiment, the first preset length is 1 byte;
Such as: payment terminal obtains the 31 byte 0X01 of message content, it can be used as current process code length, and is kept at by current process code length in new flow process code table;
Step P8: payment terminal obtains the length data identical with the value of current process code length from after the current process code length in message content, using the data that get as current process code, obtain the type of current process code, the type of current process code and current process code is kept in new flow process code table, more new technological process code count value;
Such as: payment terminal obtains the data 0X11 that length is 1 byte from after the current process code length 0X01 in message content, using the data that get as current process code, namely the current process code got is 0X11, and current process code is kept in new flow process code table, and by the type of current process code 0X11, namely register, be saved in new flow process code table, flow process code count value is updated to 1;
Step P9: payment terminal judges that whether flow process code count value is identical with new flow process code quantity, is perform step P11; Otherwise perform step P10;
Such as: payment terminal judges that flow process code count value 1 is different from new flow process code quantity 4, then step P10 is performed;
Step P10: payment terminal obtains the length data identical with the first preset length from after current process code, it can be used as current process code length, and current process code length is kept in new flow process code table, perform step P8;
Such as: payment terminal obtains a byte 0X01 after current process code 0X11, it can be used as current process code length, and by it stored in new flow process code table, according to the method acquisition current process code.The new flow process code table finally obtained is:
Flow process quantity: 04
Register: 0111
Display result: 011e
Send data: 0120
Receive data: 0121.
Step P11: payment terminal removes flow process code count value, obtains the length data identical with the second preset length, it can be used as valid data length from after the current process code in message content, performs step P12;
In the present embodiment, the second preset length is 2 bytes.
Such as: payment terminal obtains the data 0X4c of two byte lengths after current process code 0X21 from message content, it can be used as valid data length, namely valid data length is 76 bytes;
Step P12: payment terminal starts to obtain the length data identical with the value of valid data length after valid data length, using the data that get as valid data territory;
Such as: payment terminal obtains the data of 76 byte lengths from after valid data length, it can be used as valid data territory, the valid data territory got is: 01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b 660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52 d91adb37cd000d32303001c7a9b5bdb3c9b9a621;
Step P13: payment terminal according to the type of the flow process code in described new flow process code table, the length of evaluation work key information;
In the present embodiment, payment terminal according to the type of the flow process code in new flow process code table, the length of evaluation work key information; Particularly, payment terminal valid data length deducts length corresponding to the attribute of each flow process code in new flow process code table, using the result of calculation that obtains as working key information length, wherein, the length that the attribute of each flow process code is corresponding gets according to flow process type of code.
Step P14: payment terminal judges whether the length of working key information is the first length, is perform step P15; Otherwise terminate.
In the present embodiment, preferably, the first length is 61 bytes; Judge that the length of working key information is that the first length is illustrated with payment terminal.
Step P15: payment terminal obtains the length data equal with the value of the length of described working key information from the first character joint in described valid data territory, it can be used as working key information, obtain the data on the 7th predeterminated position of working key information, it can be used as master key index value, obtain the master key preserved payment terminal inside according to master key index value;
In the present embodiment, the length of working key information is 61 bytes, comprises master key index value that length is 1 byte, data encryption key ciphertext that MAC computation key ciphertext that PIN encryption key ciphertext that length is 20 bytes, length are 20 bytes and length are 20 bytes.
Such as: the working key information that payment terminal gets from valid data territory is:
01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a621;
Payment terminal obtains the data 0X01 in the first byte of working key information, it can be used as master key index value, and obtain the master key preserved payment terminal inside according to master key index value, namely master key is: e733519604455576c7b3d3c42aecf953;
Step P16: the payment terminal data that length is identical with the 3rd preset length from after master key index value, using the data that get as working key ciphertext, master key and default decipherment algorithm is adopted to be decrypted working key ciphertext, obtain working key expressly, working key is expressly preserved as new working key;
In the present embodiment, the 3rd preset length is 60 bytes.
Particularly, as shown in Figure 6 and Figure 7, comprising:
Step P ' 1: payment terminal obtains the data in the second to the 21 byte in working key information, it can be used as PIN encryption key ciphertext;
Wherein, PIN encryption key ciphertext comprises: the first check code of length to be the Part I of the PIN encryption key ciphertext of 16 bytes and length be 4 bytes;
Such as: the PIN encryption key ciphertext that payment terminal gets is:
d1c727eb601be733519604455576c7b3d3c42aec;
Step P ' 2: payment terminal obtains the data in the first to the 16 byte of PIN encryption key ciphertext, it can be used as the Part I of PIN encryption key ciphertext;
Such as: the Part I of the PIN encryption key ciphertext that payment terminal gets is:
d1c727eb601be733519604455576c7b3;
Step P ' 3: payment terminal master key adopts the decipherment algorithm preset decipher the Part I of PIN encryption key ciphertext, using the decrypted result that obtains as PIN encryption key plaintext;
Such as: the PIN encryption key that payment terminal obtains is expressly:
25C9794A1205FF244F5FA0378D2F8D59;
Step P ' 4: payment terminal expressly adopts the first cryptographic algorithm preset with PIN encryption key, to the first data encryption preset, obtains the first ciphertext from the encrypted result obtained;
Particularly, payment terminal expressly adopts the first cryptographic algorithm preset with PIN encryption key, to the first data encryption preset, obtains encrypted result, obtains the data in first to fourth byte of encrypted result, it can be used as the first ciphertext;
Preferably, the first data preset are the 0x00 of 16 byte lengths, and the first default cryptographic algorithm is 3DES algorithm.
Step P ' 5: payment terminal obtains the first check code from PIN encryption key ciphertext, judges that whether the first ciphertext is identical with the first check code, is, perform step P ' 6; Otherwise terminate.
Particularly, payment terminal obtains the data in last four bytes in PIN encryption key ciphertext, it can be used as the first check code, judges that whether the first ciphertext is identical with the first check code, be, perform step P ' 6; Otherwise terminate.
Such as: the first check code that payment terminal gets is: d3c42aec is identical with the first ciphertext;
Step P ' 6: payment terminal obtains the data in the 22 to the 41 byte in working key information, it can be used as MAC computation key ciphertext, performs step P ' 7;
Wherein, MAC computation key ciphertext comprises: the second check code of length to be the Part I of the MAC computation key ciphertext of 16 bytes and length be 4 bytes;
Such as: the MAC computation key ciphertext that payment terminal gets is:
f95356874f460b660000000110010fe0edf35015;
Step P ' 7: payment terminal obtains the data in the first to the 16 byte of MAC computation key ciphertext, it can be used as the Part I of MAC computation key ciphertext;
Such as: the Part I that payment terminal gets MAC computation key ciphertext is:
f95356874f460b660000000110010fe0;
Step P ' 8: payment terminal master key adopts the decipherment algorithm preset to decipher the Part I of MAC computation key ciphertext, obtains first to the data on Eight characters joint, it can be used as MAC computation key expressly from decrypted result;
Such as: the MAC computation key that payment terminal obtains is expressly:
9BED98891580C3B2;
Step P ' 9: payment terminal expressly adopts the second cryptographic algorithm preset with MAC computation key, to the second data encryption preset, obtains the second ciphertext from the encrypted result obtained;
Particularly, payment terminal expressly adopts the second cryptographic algorithm preset with MAC computation key, to the second data encryption preset, obtains encrypted result, obtains the data in first to fourth byte of encrypted result, it can be used as the second ciphertext;
Preferably, the second data preset are the 0x00 of 8 byte lengths, and the second default cryptographic algorithm is DES algorithm.
Step P ' 10: payment terminal obtains the second check code from MAC computation key ciphertext, judges that whether the second ciphertext is identical with the second check code, is, perform step P ' 11; Otherwise terminate;
Particularly, payment terminal obtains the data in last four bytes in MAC computation key ciphertext, it can be used as the second check code, judges that whether the second ciphertext is identical with the second check code, be, perform step P ' 11; Otherwise terminate.
Such as: the second check code that payment terminal gets is: edf35015 is identical with the second ciphertext;
Step P ' 11: payment terminal obtains the data in the 42 to the 61 byte in working key information, it can be used as data encryption key ciphertext, performs step P ' 12;
Wherein, data encryption key ciphertext comprises: the 3rd check code of length to be the Part I of the data encryption key ciphertext of 16 bytes and length be 4 bytes.
Such as: the data encryption key ciphertext that payment terminal gets is:
58917a32a39f1e77dc6cb841410b52d91adb37cd;
Step P ' 12: payment terminal obtains the data in the first to the 16 byte of data encryption key ciphertext, it can be used as the Part I of data encryption key ciphertext;
Such as: the Part I of the data encryption key ciphertext that payment terminal gets is:
58917a32a39f1e77dc6cb841410b52d9;
Step P ' 13: payment terminal master key adopts the decipherment algorithm preset decipher the Part I of data encryption key ciphertext, using the decrypted result that obtains as data encryption key plaintext;
Such as: the data encryption key that payment terminal obtains is expressly:
0E51FDF196141F227A57BD154012FD39;
Step P ' 14: payment terminal data encryption key expressly adopts the first cryptographic algorithm preset to the first data encryption preset, and obtains the 3rd ciphertext from the encrypted result obtained;
Particularly, payment terminal data encryption key expressly adopts the first cryptographic algorithm preset to the first data encryption preset, and obtains encrypted result, obtains the data in first to fourth byte of encrypted result, it can be used as the 3rd ciphertext;
Step P ' 15: payment terminal obtains the 3rd check code from data encryption key ciphertext, judges that whether the 3rd ciphertext is identical with the 3rd check code, is, performs step P ' 16; Otherwise terminate;
Particularly, payment terminal obtains the data in last four bytes in data encryption key ciphertext, it can be used as the 3rd check code, judges that whether the 3rd ciphertext is identical with the 3rd check code, is, performs step P ' 16; Otherwise terminate.
Such as: the 3rd check code that payment terminal gets is: 1adb37cd is identical with the 3rd ciphertext;
Step P ' 16: PIN encryption key plaintext, MAC computation key plaintext, data encryption key are expressly preserved as new working key by payment terminal, perform step P17;
Such as: new working key is:
25C9794A1205FF244F5FA0378D2F8D59
9BED98891580C3B2
0E51FDF196141F227A57BD154012FD39;
Step P17: payment terminal obtains the length data identical with the second preset length from after working key information, by the data Chief Information Officer angle value as a result got;
Such as: the object information length value that payment terminal gets is: 0X000d;
Step P18: payment terminal obtains the length data identical with the value of object information length value from after object information length value, by the data information as a result got;
Such as: the object information that payment terminal gets is:
32303001c7a9b5bdb3c9b9a621;
Step P19: payment terminal calculates response message length according to object information length value, the length data identical with the value of response message length are obtained from the 8th predeterminated position of object information, using the data that get as information to be displayed, preserve information to be displayed, perform step a13;
In the present embodiment, the 8th predeterminated position is the 5th byte;
Particularly, payment terminal obtains the data in the first byte of object information, it can be used as display mode, obtain the data in the second to the 3rd byte of object information, it can be used as answer back code, obtain the data on the nybble of object information, it can be used as display duration, according to object information length computation response message length, the length data identical with response message length are obtained from the 5th byte of object information, it can be used as information to be displayed, preserve display mode, answer back code, display duration, information to be displayed;
Such as: the display mode that payment terminal gets is: 0X32; The display duration got is: 0X01; The answer back code got is: 0X3030; The information to be displayed got is: 0Xc7a9b5bdb3c9b9a621.
Embodiment 2
The present embodiment is a kind of method of the function that realizes registering, as shown in Figures 8 to 10, specifically comprises:
Step m1: payment terminal obtains first flow process code from flow process code table, it can be used as current process code;
Step m2: payment terminal judges whether to get current process code, is perform step m3; Otherwise terminate.
Step m3: payment terminal judges current process type of code, if read security module sequence number code, then performs step m4; If read terminal hardware sequence number code, then perform step m5; If link setup code, then perform step m6; If transmission data code, then perform step m7; If reception data code, then perform step m9; If register code, then perform step m12; If display object code, then perform step m14;
Particularly, payment terminal judges current process code, if current process code is 0x02, is then read security module sequence number code, performs step m4;
If current process code is 0x15, be then read terminal hardware sequence number code, perform step m5;
If current process code is 0x1F, be then link setup code, perform step m6;
If current process code is 0x20, is then send data code, performs step m7;
If current process code is 0x21, is then receive data code, performs step m9;
If current process code is 0x11, be then code of registering, perform step m12;
If current process code is 0x1E, is then display object code, performs step m14;
In the present embodiment, perform for payment terminal and receive data code, be illustrated.
Step m4: payment terminal obtains the security module sequence number of therein, copies to security module sequence number and exports in buffer area, perform step m16;
Particularly, payment terminal reads security module sequence number from security module, if read, is then copied to by security module sequence number and exports in buffer area; If read less than, then in input-buffer district, write 0x00.
Step m5: payment terminal obtains the terminal hardware sequence number of therein, copies to terminal hardware sequence number and exports in buffer area, perform step m16;
Particularly, payment terminal reads the terminal hardware sequence number of therein, if read, is then copied to and exports in buffer area, if read less than, then in input-buffer district, write 0x00.
In the present embodiment, terminal hardware sequence number length is 8 bytes, comprises supplier number, unit type, batch number and manufacturer terminal self-defined information.
Step m6: payment terminal organizes link setup request, and sends it to host computer, performs step m16;
Particularly, platform address and time-out time as link setup request, are sent to host computer by payment terminal, perform step m16;
Step m7: payment terminal judges to export in buffer area whether there are data, be perform step m8; Otherwise send to host computer and there are not data to be sent, perform step m16;
Step m8: payment terminal obtains the data exported in buffer area, sends it to host computer, performs step m16;
Step m9: payment terminal judges whether to receive in Preset Time the information that host computer issues, and is perform step m10; Otherwise send time-out information to host computer, perform step m16;
Step m10: payment terminal is resolved the information that host computer issues, obtains new flow process code table, new working key and information to be displayed, preserves new flow process code table, new working key and information to be displayed, performs step m11;
In the present embodiment, in the information that host computer issues, comprise flow process code table, new working key and information to be displayed.
The concrete operations of this step are identical with the operation of step P1 to step P19 in embodiment 1, repeat no more herein.
Such as: the information that host computer issues is:
7e5000000094810090030300008b00898402010100000000050001007c0200000000000000020101000000000520140216155530000000313532040111011e01200121004c01d1c727eb601be733519604455576c7b3d3c42aecf95356874f460b660000000110010fe0edf3501558917a32a39f1e77dc6cb841410b52d91adb37cd000d32303001c7a9b5bdb3c9b9a62100000000000000001d00;
Resolve above-mentioned information, the new flow process code table obtained is:
Flow process quantity: 04
Register: 0111
Display result 011e
Send data: 0120
Receive data: 0121.
New working key is: 25C9794A1205FF244F5FA0378D2F8D59
9BED98891580C3B2
0E51FDF196141F227A57BD154012FD39;
Information to be displayed is: 0Xc7a9b5bdb3c9b9a621;
Step m11: new flow process code table as the flow process code table after renewal, is returned step m1 by payment terminal.
Step m12: payment terminal judges whether to there is new working key, is perform step m13; Otherwise report an error, perform step m16;
Step m13: the new working key of payment terminal upgrades original working key, performs step m16;
In the present embodiment, working key is preserved in advance in payment terminal inside.
Step m14: payment terminal judges whether to there is information to be displayed, is, performs step m15; Otherwise send to host computer and there is not information to be displayed, perform step m16;
Step m15: payment terminal display information to be displayed, performs step m16.
Particularly, payment terminal obtains display mode, display duration and information to be displayed, and shown according to the display mode got by information to be displayed, the time of display mates with the display duration got.
Step m16: payment terminal judges in flow process code table, after current process code, whether there is next flow process code, be perform step m17; Otherwise terminate;
Step m17 payment terminal obtains the next flow process code after current process code, it can be used as current process code, returns step m2.
Above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (18)

1. realization is registered a method for function, it is characterized in that, comprising:
Step S1: payment terminal obtains first flow process code from flow process code table, it can be used as current process code;
Step S2: described payment terminal judges the type of described current process code, if receive data code, then performs step S3; If register code, then perform step S5;
Step S3: described payment terminal judges whether to receive in Preset Time the information that host computer issues, and is perform step S4; Otherwise send time-out information to described host computer, perform step S6;
Step S4: described payment terminal is resolved the information that described host computer issues, obtains new flow process code table, new working key, preserves described new working key, upgrades original flow process code table, return step S1 with described new flow process code table;
Step S5: described payment terminal judges whether to there is new working key, is, upgrades original working key with described new working key, performs step S6; Otherwise report an error, perform step S6;
Step S6: described payment terminal judges in flow process code table, after current process code, whether there is next flow process code, be perform step S7; Otherwise terminate;
Step S7: described payment terminal obtains the next flow process code after described current process code, it can be used as current process code, returns step S2.
2. the method for claim 1, is characterized in that, described payment terminal judges the type of described flow process code, also comprises: read security module sequence number code, reads terminal hardware sequence number code, sends data code;
If described in read security module sequence number code, then described payment terminal obtains the security module sequence number of therein, and is copied to by described security module sequence number and export in buffer area, performs step S6;
If described in read terminal hardware sequence number code, then described payment terminal obtains the terminal hardware sequence number of therein, and is copied to by described terminal hardware sequence number and export in buffer area, performs step S6;
If described transmission data code, then described payment terminal judges to export in buffer area whether there are data, be obtain the data in described output buffer area, send it to described host computer, performs step S6; Otherwise send to described host computer and there are not data to be sent, perform step S6.
3. the method for claim 1, is characterized in that, described payment terminal judges the type of described flow process code, also comprises: link setup code;
If link setup code, then described payment terminal organizes link setup request, and described link setup request is sent to described host computer, performs step S6.
4. the method for claim 1, is characterized in that, described step S4, specifically comprises:
Described payment terminal is resolved the information that described host computer issues, obtain new flow process code table, new working key and information to be displayed, preserve described new flow process code table, described new working key and described information to be displayed, upgrade original flow process code table with described new flow process code table, return step S1;
Described payment terminal judges the type of described flow process code, also comprises: display object code;
If described display object code, then described payment terminal judges whether to there is information to be displayed, is, shows described information to be displayed, performs step S6; Otherwise send to described host computer and there is not information to be displayed, perform step S6.
5. method as claimed in claim 4, it is characterized in that, described payment terminal is resolved the information that described host computer issues, and obtains new flow process code table, specifically comprises:
Described payment terminal obtains the data on the first predeterminated position from the information that described host computer issues, and it can be used as data field length;
Obtain the length data identical with the value of described data field length after described data field length from the information that described host computer issues, it can be used as data field;
From described data field, obtain the data on the second predeterminated position, it can be used as communication message length;
The length data identical with the value of described communication message length are obtained, using the data that get as communication message from after the described communication message length in described data field;
From described communication message, obtain the data on the 3rd predeterminated position, it can be used as transaction data length;
From after the described transaction data length in described communication message, obtain the length data identical with the value of described transaction data length, described transaction data length and the data sequence that gets are spliced, using the splicing result that obtains as transaction data;
From described transaction data, obtain the data on the 4th predeterminated position, it can be used as transaction message length;
The length data identical with the value of described transaction message length are obtained, using the data that get as transaction message from after the described transaction message length in described transaction data;
From described transaction message, obtain the data on the 5th predeterminated position, it can be used as message content length;
The length data identical with the value of described message content length are obtained, using the data that get as message content from after the described message content length in described transaction message;
From described message content, obtain the data on the 6th predeterminated position, it can be used as new flow process code quantity;
Create new flow process code table, described new flow process code quantity is kept in described new flow process code table, the data that length is identical with the first preset length are obtained from after flow process code quantity described in described message content, it can be used as current process code length, and described current process code length is kept in described new flow process code table;
The length data equal with the value of described current process code length are obtained from after the described current process code length in described message content, it can be used as current process code, obtain the type of described current process code, the type of described current process code and described current process code is kept in described new flow process code table, until flow process codes all in described message content and corresponding flow process code length are kept in new flow process code table.
6. method as claimed in claim 5, it is characterized in that, described payment terminal is resolved the information that described host computer issues, and obtains new working key, specifically comprises:
Step m1: described payment terminal is from described message content, the length data equal with the second preset length are obtained from after described current process code, it can be used as valid data length, the data that length is equal with the value of described valid data length are obtained from after described valid data length, it can be used as valid data territory, according to the type of the flow process code in described new flow process code table, the length of evaluation work key information, the length data equal with the value of the length of described working key information are obtained from the first character joint in described valid data territory, it can be used as working key information,
Step m2: described payment terminal obtains the data on the 7th predeterminated position from described working key information, it can be used as master key index value, master key is obtained according to described master key index value, the data that length is identical with the 3rd preset length are obtained from after described working key information, it can be used as working key ciphertext, described master key and default decipherment algorithm is adopted to be decrypted described working key ciphertext, obtain working key expressly, described working key is expressly preserved as new working key.
7. method as claimed in claim 6, it is characterized in that, described payment terminal is resolved the information that described host computer issues, and obtains information to be displayed, specifically comprises:
Described payment terminal obtains the data that length equals the second preset length from after described working key information, by the data Chief Information Officer angle value as a result got;
The data that length is identical with the value of described object information length value are obtained, by the data information as a result got from after described object information length value;
Response message length is calculated according to described object information length value, the data that length is identical with the value of described response message length are obtained from the 8th predeterminated position of described object information, using the data that get as information to be displayed, preserve described information to be displayed.
8. method as claimed in claim 6, it is characterized in that, described payment terminal is according to the type of the flow process code in described new flow process code table, and the length of evaluation work key information, specifically comprises:
The described valid data length of described payment terminal deducts the length of the attribute that each flow process code is corresponding in described new flow process code table, using the result of calculation that the obtains length as working key information.
9. method as claimed in claim 6, it is characterized in that, described payment terminal, according to the type of the flow process code in described new flow process code table, after the length of evaluation work key information, also comprises:
Described payment terminal judges whether the value of the length of described working key information is the first length, from described valid data territory, obtain the length data equal with the value of the length of described working key information, it can be used as working key information, perform step m2; Otherwise terminate.
10. method as claimed in claim 6, it is characterized in that, described step m2, specifically comprises:
Step n1: described payment terminal obtains the data in the first byte of described working key information, it can be used as master key index value, the master key of therein preservation is obtained according to described master key index value, obtain the data in the second to the 21 byte in described working key information, it can be used as PIN encryption key ciphertext;
Step n2: described payment terminal obtains the data in the first to the 16 byte of described PIN encryption key ciphertext, it can be used as the Part I of PIN encryption key ciphertext, the decipherment algorithm preset is adopted decipher the Part I of described PIN encryption key ciphertext with described master key, using the decrypted result that obtains as PIN encryption key plaintext;
Step n3: described payment terminal expressly adopts the first cryptographic algorithm preset with described PIN encryption key, to the first data encryption preset, the first ciphertext is obtained from the encrypted result obtained, the first check code is obtained from described PIN encryption key ciphertext, judging that whether described first ciphertext is identical with described first check code, is perform step n4; Otherwise terminate;
Step n4: described payment terminal obtains the data in the 22 to the 41 byte in described working key information, it can be used as MAC computation key ciphertext, obtain the data in the first to the 16 byte of described MAC computation key ciphertext, it can be used as the Part I of MAC computation key ciphertext, described default decipherment algorithm is adopted to decipher the Part I of described MAC computation key ciphertext with described master key, first is obtained to the data on Eight characters joint from decrypted result, it can be used as MAC computation key expressly, perform step n5;
Step n5: described payment terminal expressly adopts the second cryptographic algorithm preset with described MAC computation key, to the second data encryption preset, the second ciphertext is obtained from the encrypted result obtained, the second check code is obtained from described MAC computation key ciphertext, judging that whether described second ciphertext is identical with described second check code, is perform step n6; Otherwise terminate;
Step n6: described payment terminal obtains the data in the 42 to the 61 byte in described working key information, it can be used as data encryption key ciphertext, obtain the data in the first to the 16 byte of described data encryption key ciphertext, it can be used as the Part I of data encryption key ciphertext, described default decipherment algorithm is adopted decipher the Part I of described data encryption key ciphertext with described master key, using the decrypted result that obtains as data encryption key plaintext;
Step n7: the described data encryption key of described payment terminal expressly adopts described the first default cryptographic algorithm to described the first default data encryption, the 3rd ciphertext is obtained from the encrypted result obtained, the 3rd check code is obtained from described data encryption key ciphertext, judging that whether described 3rd ciphertext is identical with described 3rd check code, is then described PIN encryption key plaintext, described MAC computation key plaintext, described data encryption key are expressly preserved as new working key; Otherwise terminate.
11. methods as claimed in claim 10, it is characterized in that, described payment terminal obtains the first ciphertext from the encrypted result obtained, and specifically comprises:
Described payment terminal obtains the data in first to fourth byte of described encrypted result, it can be used as the first ciphertext.
12. methods as claimed in claim 10, is characterized in that, described payment terminal obtains the first check code from described PIN encryption key ciphertext, specifically comprises:
Described payment terminal obtains the data in last four bytes in described PIN encryption key ciphertext, it can be used as the first check code.
13. methods as claimed in claim 10, it is characterized in that, described payment terminal obtains the second ciphertext from the encrypted result obtained, and specifically comprises:
Described payment terminal obtains the data in first to fourth byte of described encrypted result, it can be used as the second ciphertext.
14. methods as claimed in claim 10, is characterized in that, described payment terminal obtains the second check code from described MAC computation key ciphertext, specifically comprises:
Described payment terminal obtains the data in last four bytes in described MAC computation key ciphertext, it can be used as the second check code.
15. methods as claimed in claim 10, described payment terminal obtains the 3rd ciphertext from the encrypted result obtained, and specifically comprises:
Described payment terminal obtains the data in first to fourth byte of described encrypted result, it can be used as the 3rd ciphertext.
16. methods as claimed in claim 10, is characterized in that, described payment terminal obtains the 3rd check code from described data encryption key ciphertext, specifically comprises:
Described payment terminal obtains the data in last four bytes in described data encryption key ciphertext, it can be used as the 3rd check code.
17. methods as claimed in claim 10, it is characterized in that, described payment terminal calculates response message length according to described object information length value, the data of the value of length and described response message length are obtained from the 8th predeterminated position of described object information, using the data that get as information to be displayed, preserve described information to be displayed, specifically comprise:
Described payment terminal obtains the data in the first byte of described object information, it can be used as display mode, obtain the data in the first default byte of described object information, it can be used as display duration, according to described object information length computation response message length, from second of described object information presets byte, obtain the length data identical with described response message length, it can be used as information to be displayed, preserve display mode, display duration, information to be displayed.
18. methods as claimed in claim 17, it is characterized in that, other codes described, also comprise: display object code;
If during described display object code, then described payment terminal judges whether to there is information to be displayed, is, obtains display mode, display duration and information to be displayed, according to described display mode and display duration, shows described information to be displayed, returns step S2; Otherwise send to described host computer and there is not information to be displayed, return step S2.
CN201510013396.8A 2015-01-12 2015-01-12 A kind of method for realizing function of registering Active CN104506311B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510013396.8A CN104506311B (en) 2015-01-12 2015-01-12 A kind of method for realizing function of registering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510013396.8A CN104506311B (en) 2015-01-12 2015-01-12 A kind of method for realizing function of registering

Publications (2)

Publication Number Publication Date
CN104506311A true CN104506311A (en) 2015-04-08
CN104506311B CN104506311B (en) 2017-09-22

Family

ID=52948027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510013396.8A Active CN104506311B (en) 2015-01-12 2015-01-12 A kind of method for realizing function of registering

Country Status (1)

Country Link
CN (1) CN104506311B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730183A (en) * 2019-10-22 2020-01-24 浙江中控技术股份有限公司 Encryption communication method and device of security control system
CN111934883A (en) * 2020-07-16 2020-11-13 中国民航信息网络股份有限公司 Credit card number tokenization method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964793A (en) * 2010-10-08 2011-02-02 上海银联电子支付服务有限公司 Method and system for transmitting data between terminal and server and sign-in and payment method
CN102761557A (en) * 2012-07-31 2012-10-31 飞天诚信科技股份有限公司 Terminal device authentication method and device
CN103903367A (en) * 2012-12-28 2014-07-02 北京握奇数据系统有限公司 Method and system for loading-in-air of financial IC card embedded into mobile terminal
CN104077688A (en) * 2014-06-09 2014-10-01 中国建设银行股份有限公司 Internet payment method based on IC card and relevant device
CN104091259A (en) * 2014-07-04 2014-10-08 飞天诚信科技股份有限公司 Payment terminal capable of analyzing flow path codes and working method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964793A (en) * 2010-10-08 2011-02-02 上海银联电子支付服务有限公司 Method and system for transmitting data between terminal and server and sign-in and payment method
CN102761557A (en) * 2012-07-31 2012-10-31 飞天诚信科技股份有限公司 Terminal device authentication method and device
CN103903367A (en) * 2012-12-28 2014-07-02 北京握奇数据系统有限公司 Method and system for loading-in-air of financial IC card embedded into mobile terminal
CN104077688A (en) * 2014-06-09 2014-10-01 中国建设银行股份有限公司 Internet payment method based on IC card and relevant device
CN104091259A (en) * 2014-07-04 2014-10-08 飞天诚信科技股份有限公司 Payment terminal capable of analyzing flow path codes and working method thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730183A (en) * 2019-10-22 2020-01-24 浙江中控技术股份有限公司 Encryption communication method and device of security control system
CN111934883A (en) * 2020-07-16 2020-11-13 中国民航信息网络股份有限公司 Credit card number tokenization method and system
CN111934883B (en) * 2020-07-16 2024-01-26 中国民航信息网络股份有限公司 Credit card number tokenization method and system

Also Published As

Publication number Publication date
CN104506311B (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN107920112B (en) Configuration file pushing method supporting gray mode, central server and storage medium
CN103473088B (en) A kind of single-chip microcomputer online upgrading method and system
CN102711108B (en) Method and system for managing the authentication information of mobile terminal
CN110875850A (en) Firmware upgrading method and system, readable storage medium and terminal equipment
CN113140079B (en) Intelligent cabinet opening method, data processing method and device and intelligent cabinet application system
CN110022558A (en) The encryption and decryption method and electronic device and storage medium of a kind of upgrade package
CN107844305A (en) The method for upgrading software and embedded device of embedded device
CN104519105A (en) Method and device for acquiring applications matched with terminals
CN110096869A (en) BIOS loads signing certificate method, system, equipment and computer media
CN106020868B (en) A kind of smart card firmware update and system
CN110825756B (en) Data synchronization method, device, storage medium and equipment
CN112671609A (en) Asset census and safety detection method and device and terminal equipment
CN113992514A (en) Method for rapidly realizing data acquisition instrument protocol by zero code and data acquisition instrument terminal
CN110071914B (en) Communication method, frame structure construction method, device, MCU, system and medium
CN104506311A (en) Method for achieving check-in function
CN110659899A (en) Offline payment method, device and equipment
CN112788576B (en) Equipment offline processing method and system, storage medium and electronic device
EP4030373A1 (en) Object comparison method, and device
CN101197959B (en) Terminal control method, system and equipment
CN111385613B (en) Television system repairing method, storage medium and application server
CN110442059A (en) Controlled equipment expanding method and device and control equipment
CN111191216A (en) OFD signature client with JAVA interface and method and system for signature and signature verification thereof
CN108664796B (en) So file protection method and device
CN112363975B (en) Interaction method and interaction system for configuration software and FPGA
CN110968841A (en) Activation method, device and system of programmable logic controller

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
OL01 Intention to license declared
OL01 Intention to license declared