Background technology
(BANK Card) is more and more universal as the means of payment for bank card, common bank card paying system comprises point of sales terminal (Point Of Sale, POS), POS receives single system (POSP), code keypad (PIN PAD) and hardware encipher machine (Hardware and Security Module, HSM).Wherein POS terminal can be accepted bank card information, has communication function, and the instruction of accepting teller completes financial transaction information and the equipment of exchange for information about; POS receives single system POS terminal is managed concentratedly, comprises parameter downloads, and key is downloaded, and accepts, processes or forward the transaction request of POS terminal, and to POS terminal loopback transaction results information, is the system of centralized management and transaction processing; Code keypad (PIN PAD) is that the relevant key of various financial transactions is carried out to safe storage protection, and the safety equipment that PIN are encrypted to protection; Hardware encipher machine (HSM) is to the peripheral hardware equipment that is encrypted of transmission data, for correctness and the storage key of encryption and decryption, checking message and the document source of PIN.Personal identification code (Personal Identification Number, PIN), personal identification number, is the data message of identifying holder's identity legitimacy in on-line transaction, in cyber-net system, any link does not allow to occur in mode expressly; Terminal master key (Terminal Master Key, TMK), during POS terminal works, the master key that working key is encrypted, encrypting storing is in system database; POS terminal is widely used in bank card and pays occasion, such as manufacturer's shopping, hotel's lodging etc., is a kind of indispensable modernization means of payment, has incorporated the various occasions of people's life.Bank card; debit card particularly; generally all by holder, be provided with PIN; in carrying out payment process; POS terminal is except above sending the data such as magnetic track information of bank card; also want holder to input the checking holder's of PINGong issuing bank identity legitimacy, guarantee bank card safety of payment, protection holder's property safety.In order to prevent that PIN from revealing or being cracked; requirement is from terminal to issuing bank in whole information interactive process; whole process is carried out safety encipher protection to PIN; do not allow any link in computer network system; PIN occurs in mode expressly, so the POS terminal of the PIN of acceptance input at present all requires to be equipped with key management system.
The key code system of POS terminal is divided into secondary: terminal master key (TMK) and working key (WK).Wherein TMK is encrypted protection to WK.Every POS terminal has unique TMK, must have safeguard protection, and assurance can only also participate in calculating by write device, can not read; TMK is a very crucial root key, if TMK is intercepted, working key is just cracked than being easier to, by serious threat bank card safety of payment.So can secure download TMK to POS terminal, become the key of whole POS terminal security.Conclude existing TMK download scenarios below as follows:
1, the female POS scheme of key: user receives single system hardware encipher machine and the same traffic encryption key of the female POS input of key at POS.POS terminal is received single system initiating terminal master key download request by the female POS of key to POS, POS receives single system and drives hardware encipher machine to generate at random terminal master key, and by traffic encryption key encrypted transmission to the female POS of key, the female POS of key is with being transferred to POS terminal after traffic encryption key deciphering again, POS terminal obtains terminal master key expressly, be saved in POS terminal password keyboard, thereby realize POS terminal and POS, receive the synchronous of terminal master key between single system.
2, IC-card decrypt scheme: user receives single system hardware encipher machine and injects the same traffic encryption key in IC-card at POS.User inserts POS terminal by IC-card, POS terminal is received single system initiating terminal master key download request to POS, POS receives single system and drives hardware encipher machine to generate at random terminal master key, and by traffic encryption key encrypted transmission to POS terminal, traffic encryption key deciphering terminal master key ciphertext in IC-card for POS terminal, obtain terminal master key expressly, be saved in POS terminal password keyboard, thereby realize POS terminal and POS, receive the synchronous of terminal master key between single system.
Above-mentioned two schemes has following shortcoming: terminal master key expressly appears at outside safety equipment, for taking precautions against Key Exposure risk, the safe machine room that the download of terminal master key must be controlled at administrative center carries out, by artificial, concentrate download terminal master key, thereby bring " maintenance centre's machine room workload is large; After equipment dispatches from the factory, will transport to administrative center's safe machine room download key and just can be deployed to trade company, transportation cost rises; In order to concentrate lower dress key, need a large amount of staff and working time, maintenance cost is large, maintenance period is long " etc. problem.
Summary of the invention
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is, a kind of method of quick locating terminal master key failed download is provided, and comprises step:
S1, in POS terminal, record gathers rise time and the first proof test value of transmission security key TK in transmission security key TK process;
S2, when remote download terminal master key TMK when failure, obtain importing time and the second proof test value that server imports transmission security key TK in transmission security key TK process, then enter step S3;
S3, described the first proof test value and the second proof test value are compared, judge that whether comparison result is consistent, if so, enter step S4, if not, enter step S5;
K is consistent with server transmission security key TK for S4, judgement POS terminal transmission cipher key T, determines and has downloading process mistake or communication failure;
S5, judgement POS terminal transmission cipher key T K and server transmission security key TK are inconsistent, determine and have importing process mistake.
Another technical solution used in the present invention is: the system that a kind of quick locating terminal master key failed download is provided, comprise: the first logging modle, for gather rise time and the first proof test value of transmission security key TK in transmission security key TK process at POS terminal record; The second logging modle, for obtaining importing time and the second proof test value of server importing transmission security key TK process transmission security key TK when remote download terminal master key TMK is failed; Contrast module, for described the first proof test value and the second proof test value are compared, judges that whether comparison result is consistent; The first diagnostic module, for when contrast module judgement comparing result is consistent, judges that POS terminal transmission cipher key T K is consistent with server transmission security key TK, determines and has downloading process mistake or communication failure; Second opinion module, for when contrast module judgement comparing result is inconsistent, judges that POS terminal transmission cipher key T K is consistent with server transmission security key TK, determines and has importing process mistake.
The invention has the beneficial effects as follows: can locate fast wrong reason, the present invention provides importing time and the TK proof test value of the secret key TK of transmission to contrast by KMS service end when the generation daily record of the TK data that provide on the terminal device that transmits secret key TK and failed download were provided, log packet is containing data such as the rise time of the secret key TK of many group transmission in multi collect, proof test values (KCV), by the TK proof test value on contrast terminal device and TK proof test value and the temporal information of KMS server end, thereby determine whether to lead to errors because proof test value is inconsistent; And because proof test value is inconsistent, just can locate fast the wrong reason of the different links such as TK data acquisition, transmission and importing.
Embodiment
By describing technology contents of the present invention, structural attitude in detail, being realized object and effect, below in conjunction with embodiment and coordinate accompanying drawing to be explained in detail.
For solving the technical matters existing in background technology, the present invention adopts a kind of new master key download scenarios, by POS terminal, produce at random TK(Transmission Key, transmission security key), TK after producing is stored in the code keypad of POS terminal, and TK is sent to KMS(Key Management System by transmission mode required under various application scenarioss, key management system, for office terminal master key TMK).
When POS terminal to apply download terminal master key TMK, KMS system is used TK to encrypt terminal master key TMK, and the terminal master key ciphertext after encrypting is sent to POS terminal, POS terminal is decrypted master key ciphertext with TK after receiving, obtain terminal master key TMK, and terminal master key TMK is kept in code keypad.
So, by TK, encrypt terminal master key TMK, make TMK can carry out remote transmission, facilitate the secure download of TMK.
Under some scene, adopt operating terminal to gather the TK that POS terminal produces, and be responsible for TK to be transferred to MTMS system (Material Tracking Management System by operating terminal, Tracing Material system, mainly in plant produced, use), by MTMS systematic unity management TK, and TK is sent to corresponding KMS system, described course of conveying YouCA center (Certificate Authority, certificate granting center, adopt Public Key Infrastructure public key infrastructure technology, network ID authentication service is provided specially, be responsible for signing and issuing and managing digital certificate, and third party's trust authority with authoritative and fairness) differentiate operating terminal, the identity of MTMS system and KMS system.Adopt operating terminal to gather TK and can facilitate the acquisition operations (can realize a key collection etc.) of TK and the rights management that TK gathers; Employing MTMS system can be conveniently to TK unified management, and during convenient after-sales service later, data search and the download of POS terminal, can realize by manufacture order bulk transfer TK by MTMS system, facilitates the transfer management of TK, prevents that TK from misinformating to wrong object; Introduce CA center and can prevent that pseudo-terminal and pseudo-KMS system from stealing TK.
Because this class downloading mode that produces at random TK by POS terminal and the TK after producing is stored in to the code keypad of POS terminal and TK is sent to KMS system by transmission mode required under various application scenarioss needs terminal to support the function of remote download TMK, a lot of links are introduced in middle meeting, when remote download TMK failure, be difficult to locate fast the wrong link occurring and the reason of generation.
Below just the present invention is overcome to the problems referred to above technical scheme be elaborated.
Refer to Fig. 1, be the structured flowchart of a kind of system 100 of quick locating terminal master key failed download in one embodiment of the present invention, it comprises the first logging modle 10, the second logging modle 20, contrast module 30, the first diagnostic module 40 and second opinion module 50.
Described the first logging modle 10 is for gathering rise time and the first proof test value of transmission security key TK in transmission security key TK process at POS terminal record.
Described the second logging modle 20 imports importing time and the second proof test value of transmission security key TK process transmission security key TK for obtain server when remote download terminal master key TMK is failed.Wherein, described server comprises KMS system.
Described contrast module 30, for described the first proof test value and the second proof test value are compared, judges that whether comparison result is consistent.
Described the first diagnostic module 40, for when contrast module judgement comparing result is consistent, judges that POS terminal transmission cipher key T K is consistent with server transmission security key TK, determines and has downloading process mistake or communication failure.
Described second opinion module 50, for when contrast module judgement comparing result is inconsistent, judges that POS terminal transmission cipher key T K and server transmission security key TK are inconsistent, determines and has importing process mistake.
In the present embodiment, described the first diagnostic module 40 also has the diagnosis mistake of downloading process or the function of communication failure, and the module that realizes this function mainly comprises network detection module, the 3rd diagnostic module, the first judge module and the 4th diagnostic module.
Described network detection module is for detection of whether connection failure of communication network.
Described the 3rd diagnostic module, for when described network detection module Sampling network connection failure, is judged and is had communication failure.
Described the first judge module, for when described network detection module Sampling network successful connection, judges that whether POS terminal transmission cipher key T K is corresponding with sequence number.
Described the 4th diagnostic module, is judged and is had downloading process mistake not at once for judge POS terminal transmission cipher key T K and sequence number when the first judge module.
In the present embodiment, the complete rear notice debugging module executable operations of described second opinion module 50, described debugging module specifically comprises the second judge module and the 5th diagnostic module.
Described the second judge module is used for judging whether the rise time is later than the importing time.
Described the 5th diagnostic module is for being later than importing during the time when described the second judge module judgement rise time, the transmission security key TK that judges POS terminal does not import to server end, then according to gathering daily record, find the transmission security key TK not importing, described collection daily record records the mapping relations of rise time and transmission security key TK.
In the present embodiment, described proof test value is the KCV of transmission security key TK, and KCV is that Key Check Value is the abbreviation of keycheck value, and KCV is the keycheck value obtaining by certain algorithm.
Refer to Fig. 2, Fig. 2 is the main flowchart of the method for a kind of quick locating terminal master key failed download in an embodiment of the invention, and the method comprising the steps of:
Step S1, in POS terminal, record gathers rise time and the first proof test value of transmission security key TK in transmission security key TK process;
Step S2, when remote download terminal master key TMK when failure, obtain importing time and the second proof test value that server imports transmission security key TK in transmission security key TK process, then enter step S3;
Step S3, described the first proof test value and the second proof test value are compared, judge that whether comparison result is consistent, if so, enter step S4, if not, enter step S5;
K is consistent with server transmission security key TK for step S4, judgement POS terminal transmission cipher key T, determines and has downloading process mistake or communication failure;
Step S5, judgement POS terminal transmission cipher key T K and server transmission security key TK are inconsistent, determine and have importing process mistake.
Wherein, after described step S4, comprise downloading process mistake or communication failure finding step, specifically comprise:
S41, detect whether connection failure of communication network, if so, enter step S42, if not, enter step S43;
There is communication failure in S42, judgement;
S43, judge that whether POS terminal transmission cipher key T K is corresponding with sequence number, if not, enter step S44;
There is downloading process mistake in S44, judgement.
Wherein, after described step S5, comprise importing process mistake finding step, specifically comprise:
S51, judge whether the rise time be later than the importing time, if so, enter step S52;
The transmission security key TK of S52, judgement POS terminal does not import to server end, then according to gathering daily record, finds the transmission security key TK not importing, and described collection daily record records the mapping relations of rise time and transmission security key TK.
The invention has the beneficial effects as follows: can locate fast wrong reason, the present invention provides importing time and the TK proof test value of the secret key TK of transmission to contrast by KMS service end when the generation daily record of the TK data that provide on the terminal device that transmits secret key TK and failed download were provided, log packet is containing data such as the rise time of the secret key TK of many group transmission in multi collect, proof test values (KCV), by the TK proof test value on contrast terminal device and TK proof test value and the temporal information of KMS server end, thereby determine whether to lead to errors because proof test value is inconsistent; And because proof test value is inconsistent, just can locate fast the wrong reason of the different links such as TK data acquisition, transmission and importing.
The foregoing is only embodiments of the invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes instructions of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.