Summary of the invention
Present invention solves the technical problem that the problem of being easily unauthorized copying for encrypting IC card, provides a kind of IC card encryption side
Method, device, terminal and storage medium.
In order to solve the above technical problem, the present invention provides technical solution are as follows:
A kind of IC card encryption method, device, terminal and storage medium, comprising: obtain the identification information in IC card;It will acquire
The identification information of IC card is matched with the identification information of storage;If matching is unsuccessful, if sending a warning message successful match,
Generate new identification information;By in new update of identification information to IC card, and the identification information updated storage.
It is not the encryption information directly read in card when user card punching, but first transfers the identification information in card, identifies
Information matches can successfully be decrypted;And after passing through the verifying of identification information by the card that regular channel obtains, system
A new identification information can be regenerated.
To an identification information is added in IC card, it can effectively prevent card and be replicated, even if being replicated, as long as former card is used
After family uses once, copy card be can not be used again;Or after copy card use, original card be can not be used again, therefore, card
Quantity be still controllable.
Preferably, after the identification information for the IC card that will acquire is matched with the identification information of storage further include: if matching
Success, obtains the chip information of IC card;Authorized chip information is transferred, the chip information for the IC card that will acquire is the same as authorized
Chip information matched;If successful match, the information being verified is issued;If match cognization is sent a warning message, mention
Show that the IC card is unauthorized.Chip information is obtained again after obtaining identification information, if chip information mismatches, can not also be added
It is close;The IC card that a part of chip information, which can be effectively prevented, to be re-write is made into copy card.
Preferably, the identification information storage is in the unencryption sector of IC card.The 0th piece of 0 sector of IC card is general
Can not be written into, and other block some be storage encryption information, some is not stored information, identification information
It is stored in the sector of unencryption.
Preferably, the identification information storage is in any one or more blocks of the not stored Encryption Algorithm of IC card.Mark
The content of information should not be too many, the memory capacity of occupancy be also not easy it is too big, be merely stored in a block can more quickly complete it is whole
A process;The level of encryption that identification information can effectively be improved is stored in multiple pieces.
Preferably, the IC includes 64 blocks altogether, and number is respectively 0 ~ 63, and wherein m block is used to store encryption information,
The encryption information is stored in 1 ~ 63 wherein in m block;Wherein n block unencryption, the identification information storage is in n block
In one of them;Before the identification information of the IC card that will acquire is matched with the identification information of storage, further includes:
The number i of the block of storage identification information is obtained, the number stored with before is compared;If number is consistent, the IC card that will acquire
Identification information with storage identification information matched;If number is inconsistent, send a warning message.Before first time is verified,
Not only be stored with identification information, the number of the block where identification information can also be stored in systems, therefore, can by
Number with block carries out pre-authentication, effective exclusive segment unauthorized card, or effectively to exclude certain copy modes more low
Bad card.
Preferably, after the new identification information of the generation, further includes: by a block j of identification information storage to IC card
In, store the number j of the block.Updated mark can be stored into another block, be can be further improved so anti-multiple
The effect of system.
Preferably, the block i and block j belongs to n unencryption block, the i ≠ j.Identification information before and after swiping the card is deposited
Storage can effectively improve anti-copying effect in different blocks.
A kind of IC card encryption device, including data obtaining module, matching module, information generating module, information updating module,
Memory module;The function of the data obtaining module are as follows: obtain the identification information in IC card;The function of the matching module
It can are as follows: the identification information for the IC card that will acquire is matched with the identification information of storage;If matching is unsuccessful, letter is given a warning
Breath;If successful match, the instruction for generating new identification information is issued;The function of the information generating module are as follows: generate new
Identification information;The function of the information updating module are as follows: by new update of identification information to IC card, and update storage
Identification information;The data obtaining module is connected with matching module, and the matching module is connected with information generating module,
The information generating module is connected with information updating module, and the memory module connects with matching module and information updating module
It connects.For realizing the encryption method of IC card, which can quickly realize the reading of identification information, match and re-write.
A kind of IC card ciphering terminal, including one or more processors;And storage device, for storing one or more
Program;When one or more programs are executed by the one or more processors, so that the one or more
Processor realizes the IC card encryption method.For realizing the terminal of IC card encryption method.
A kind of storage medium of IC card encryption, for storing one or more programs, for realizing in such as claim 1 ~ 7
Described in any item methods.The storage medium for storing the IC card encryption method, can be applied to other equipment.
Compared with prior art, the device have the advantages that are as follows: to adding an identification information, Ke Yiyou in IC card
Effect prevents card to be replicated, even if being replicated, as long as copy card can not be used again after former card user uses once;Or
After copy card use, original card be can not be used again, and therefore, the quantity of card is still controllable.
Specific embodiment
Following implementation column is to further explanation of the invention, is not limitation of the present invention.
In some embodiments of the present application, a kind of IC card encryption method, as shown in Figure 1, comprising: obtain in IC card
Identification information;The identification information for the IC card that will acquire is matched with the identification information of storage;If matching is unsuccessful, police is issued
If accusing information successful match, new identification information is generated;By in new update of identification information to IC card, and the mark updated storage
Know information.
It is not the encryption information directly read in card when user card punching, but first transfers the identification information in card, identifies
Information matches can successfully be decrypted;And after passing through the verifying of identification information by the card that regular channel obtains, system
A new identification information can be regenerated.
To an identification information is added in IC card, it can effectively prevent card and be replicated, even if being replicated, as long as former card is used
After family uses once, copy card be can not be used again;Or after copy card use, original card be can not be used again, therefore, card
Quantity be still controllable.
In other embodiments of the application, as shown in Fig. 2, mark of the identification information for the IC card that will acquire with storage
After information is matched further include: if successful match, obtain the chip information of IC card;Authorized chip information is transferred, it will
The chip information of the IC card of acquisition is matched with authorized chip information;If successful match, the letter being verified is issued
Breath;If match cognization is sent a warning message, prompt the IC card unauthorized.
Chip information is obtained again after obtaining identification information, if chip information mismatches, can not also be encrypted;It can be effective
The IC card for preventing a part of chip information from can not re-write is made into copy card.
In other embodiments of the application, the identification information storage is in the unencryption sector of IC card.
The 0th piece of 0 sector of IC card can not be generally written into, and other block some be storage encryption information,
Some is not stored information, and identification information storage is in the sector of unencryption.
In other embodiments of the application, any of the identification information storage in the not stored Encryption Algorithm of IC card
In a or multiple piece.
The content of identification information should not be too many, and the memory capacity of occupancy is also not easy too greatly, and being merely stored in a block can be more
Quickly complete whole flow process;The level of encryption that identification information can effectively be improved is stored in multiple pieces.
In other embodiments of the application, the IC includes 64 blocks altogether, and number is respectively 0 ~ 63, and wherein m
For block for storing encryption information, the encryption information is stored in 1 ~ 63 wherein in m block;Wherein n block unencryption, it is described
One of them of identification information storage in n block;Identification information of the identification information of the IC card that will acquire with storage
Before being matched, further includes: obtain the number i of the block of storage identification information, the number stored with before is compared;If compiling
Number consistent, the identification information for the IC card that will acquire is matched with the identification information of storage;If number is inconsistent, give a warning
Information.
Further, as shown in figure 3, the identification information of the IC card that will acquire is the same as the identification information progress stored
Before matching, further includes: obtain the number i of the block of storage identification information, the number stored with before is compared;If number one
It causes, the identification information for the IC card that will acquire is matched with the identification information of storage;If number is inconsistent, send a warning message.
Before first time is verified, it is not only stored with identification information, can also be stored with where identification information in systems
Therefore the number of block can carry out pre-authentication by the number of match block, effective exclusive segment unauthorized card, or effectively
Ground excludes the more inferior card of certain copy modes.
In other embodiments of the application, after the new identification information of the generation, further includes: by identification information
It stores in a block j of IC card, stores the number j of the block.
Updated mark can be stored into another block, can be further improved the effect of anti-copying in this way.
The block i and block j belongs to n unencryption block, the i ≠ j.
Identification information storage before and after swiping the card can effectively improve anti-copying effect in different blocks.
In other embodiments of the application, as shown in figure 4, the number i of block where obtaining the identification information in IC card;
The number stored with before is compared;If number is inconsistent, send a warning message;If number is consistent, the mark in IC card is obtained
Know information, the identification information for the IC card that will acquire is matched with the identification information of storage;If matching is unsuccessful, letter is given a warning
Breath;If successful match, new identification information is generated;By in a block j of identification information storage to IC card, the number of the block is stored
J, the i ≠ j;Obtain the chip information of IC card;Authorized chip information is transferred, the chip information for the IC card that will acquire is same
Authorized chip information is matched;If successful match, the information being verified is issued;If match cognization gives a warning letter
Breath, prompts the IC card unauthorized.
In some embodiments of the present application, a kind of IC card encryption device, as shown in figure 5, include data obtaining module,
With module, information generating module, information updating module, memory module;The function of the data obtaining module are as follows: obtain IC
Identification information in card;The function of the matching module are as follows: identification information of the identification information for the IC card that will acquire with storage
It is matched;If matching is unsuccessful, send a warning message;If successful match, the instruction for generating new identification information is issued;Institute
The function for the information generating module stated are as follows: generate new identification information;The function of the information updating module are as follows: will be new
In update of identification information to IC card, and the identification information updated storage;The data obtaining module is connected with matching module,
The matching module is connected with information generating module, and the information generating module is connected with information updating module, described
Memory module is connected with matching module with information updating module.
For realizing the encryption method of IC card, the device can quickly realize identification information reading, matching with again
Write-in.
In other embodiments of the application, the IC card encryption device further include: authorization message matching module, institute
The function for the authorization message matching module stated are as follows: transfer authorized chip information, the same quilt of the chip information for the IC card that will acquire
The chip information of authorization is matched;If successful match, the information being verified is issued;If match cognization gives a warning letter
Breath, prompts the IC card unauthorized;
The authorization message matching module is connected with matching module.
Chip information is obtained again after obtaining identification information, if chip information mismatches, can not also be encrypted;It can be effective
The IC card for preventing a part of chip information from can not re-write is made into copy card.
In other embodiments of the application, the encryption device further includes that number information obtains module and number letter
Matching module is ceased, the number information obtains the function of module are as follows: deposit together in the identification information of the IC card that will acquire
Before the identification information of storage is matched, the number i of the block of storage identification information is obtained
The function of the number information matching module are as follows: the number that the number information that will acquire is stored with before is compared;
If number is consistent, the identification information for the IC card that will acquire is matched with the identification information of storage;If number is inconsistent, issue
Warning message.
The IC includes 64 blocks altogether, and number is respectively 0 ~ 63, and wherein m block is described for storing encryption information
Encryption information is stored in 1 ~ 63 wherein in m block;Wherein n block unencryption, its in n block of the identification information storage
In one;Before first time is verified, it is not only stored with identification information, the block that can also be stored in systems where identification information
Number therefore can carry out pre-authentication by the number of match block, effective exclusive segment unauthorized card, or effectively
Exclude the more inferior card of certain copy modes.
In other embodiments of the application, the encryption device further includes identification information distribution module, described
The function of identification information distribution module are as follows: after the new identification information of the generation, by one of identification information storage to IC card
In block j, the number j of the block is stored.
Updated mark can be stored into another block, can be further improved the effect of anti-copying in this way.
In other embodiments of the application, after identification information distribution module distributes new identification information: the block i
Belong to n unencryption block, the i ≠ j with block j.
Identification information storage before and after swiping the card can effectively improve anti-copying effect in different blocks.
In other embodiments of the application, as shown in fig. 6, the number information obtains module with number information
It is connected with module, number information matching module is connected with data obtaining module, and data obtaining module is connected with matching module, matching
Module is connected with information generating module, and the information generating module is connected with identification information distribution module, the mark letter
It ceases distribution module to connect with information updating module, the information updating module is connected with authorization message matching module, described
Information updating module is connected with memory module, and the memory module obtains module, matching module and authorization letter with number information
Cease matching module connection.
Connection encryption device according to figure 6, workflow are as follows: the volume of block where obtaining the identification information in IC card
Number i;The number stored with before is compared;If number is inconsistent, send a warning message;If number is consistent, obtain in IC card
Identification information, the identification information of the IC card that will acquire matched with the identification information of storage;If matching is unsuccessful, police is issued
Accuse information;If successful match, new identification information is generated;By in a block j of identification information storage to IC card, the block is stored
Number j, the i ≠ j;Obtain the chip information of IC card;Authorized chip information is transferred, the chip letter for the IC card that will acquire
Breath is matched with authorized chip information;If successful match, the information being verified is issued;If match cognization, police is issued
Information is accused, prompts the IC card unauthorized.
A kind of IC card ciphering terminal, including one or more processors;And storage device, for storing one or more
Program;When one or more programs are executed by the one or more processors, so that the one or more
Processor realizes IC card optimization method as described above.
For realizing the terminal of IC card encryption method.
A kind of IC card encryption storage medium, for storing one or more programs, for realizing method as described above.
The storage medium for storing the IC card encryption method, can be applied to other equipment.
Above-listed detailed description is illustrating for possible embodiments of the present invention, and above embodiments are not to limit this
The scope of the patents of invention, all equivalence enforcements or change without departing from carried out by the present invention, is intended to be limited solely by the scope of the patents of this case.