IC card anti-copy encryption method, terminal and storage medium

By using the dual encryption method of AES and DES algorithms on IC cards and the combination of one card and one password, the problem of insufficient encryption method for IC cards is solved, effectively preventing abnormal authorization cards, and improving the IC cards Security and management convenience.

CN119026186APending Publication Date: 2024-11-26CHENYANG SICHUANG JINZUN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310580715.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The storage space encryption method of existing IC cards is limited, resulting in the widespread existence of abnormal authorized IC cards (copy cards), which brings hidden dangers to card security and increases management difficulty.

Method used

Using the dual encryption method of AES and DES algorithms, the password blocks and data blocks of the IC card are encrypted, and the ciphertext is generated and written to the IC card is written. Combined with the encryption method of one card, one password, data decryption and the initial key are used to Compare, judge the validity of the card and update the data.

Benefits of technology

It effectively eliminates the use of abnormally authorized IC cards, improves the security and management convenience of IC cards, and prevents the emergence of a large number of copy cards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026186A_ABST
    Figure CN119026186A_ABST
Patent Text Reader

Abstract

The invention discloses an IC card anti-copy encryption method. The method mainly at least comprises the following steps: S10, reading IC card data by a card writer, and pre-generating an initial key which is used as an initial key for encryption of an AES algorithm and a DES algorithm; s20, the card writer re-writes the IC card data, encrypts the data by using the read IC card data and the initial secret key, and writes the data into the password blocks and the data blocks of the continuous sectors of the IC card; s30, the card swiping device identifies the IC card, the card swiping device decrypts a password block and a data block of a continuous sector of the IC card, and if the card is judged to be an authorized card, updating information is rewritten into the IC card and stored in a storage chip of the card swiping device; and the unauthorized card is directly locked and transmits a signal to the hardware control circuit to give out buzzing prompt tone. According to the invention, on the basis of one card and one password, the DES + AES algorithm is added to the plain code data of the data block for encryption, so that the use of an abnormally authorized IC card is really avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of information security management, in particular to the technical field of IC card anti-copying encryption method. Background Art

[0002] With the gradual improvement of people's living standards and the continuous advancement of science and technology, IC card devices are widely used in production and life. Due to the limited encryption method of the storage space of the IC card itself, a large number of non-normal authorized IC cards (copy cards) appear. These non-normal authorized IC cards (copy cards) are used on IC card devices at the same time as the normal authorized IC cards, which brings great hidden dangers to the security of card users, brings inconvenience to the authorized party in managing the card users, and also loses the meaning of using the IC card device.

[0003] IC card (Integrated Circuit Card), a common IC card has 16 sectors, each sector is divided into 4 blocks, each block has 16 bytes; the prior art uses the following three methods for IC card device verification:

[0004] The first method does not write any data, but only identifies the UID number of the 0th sector and 0th block of the IC card; if the UID number exists in the system, it can pass the verification;

[0005] This verification method is very easy to crack. You only need to use a CUID card to copy the UID number in the system, or use the NFC function of a mobile phone to directly simulate the UID number in the system.

[0006] The second method is to write plain text data in the sector number block. All IC cards in the system use a unified password and write the password in the password block of the IC card. When verifying, first verify the UID number of the IC card 0 sector 0 block, then decrypt the password and verify the plain text data.

[0007] This verification method can be used to decipher the password using common IC card decryption tools. Once the password of one IC card is cracked and the data in the card is analyzed, all IC cards can be cracked.

[0008] The third method is to write plaintext data in the sector block. In the system, the IC card uses one card and one password. The password is written in the password block of the IC card. When verifying, the UID number of the IC card 0 sector 0 block is first verified, and then decrypted through a special algorithm to verify the plaintext data;

[0009] This verification method can be used to decrypt the password using common IC card decryption tools. The advantage is that the password of each IC card is different, so all cards will not be decrypted. The disadvantage is that ① if the algorithm of one card and one password is decrypted, all cards will be decrypted. The disadvantage is that even if the algorithm of one card and one password is not decrypted, only the password of one card is decrypted, and the data can be analyzed through this card for mass copying.

[0010] As time goes by and technology continues to develop, tools for deciphering IC cards emerge in an endless stream. The storage and encryption of IC cards themselves have certain limitations. Using methods that only encrypt IC cards can no longer solve the problem of IC card copying. Summary of the invention

[0011] In order to solve the above problems, that is, to solve the problems raised by the above background technology, the present invention proposes an IC card anti-copying encryption method, which includes at least the following steps: S10, the card writer reads the IC card data and pregenerates an initial key, which is used as the initial key for encryption by the AES algorithm and the DES algorithm; S20, the card writer rewrites the IC card data, uses the read IC card data and the initial secret key to encrypt, and writes data to the password blocks and data blocks of the continuous sectors of the IC card; S30, the card swiping device identifies the IC card, and the card swiping device decrypts the password blocks and data blocks of the continuous sectors of the IC card. If it is determined to be an authorized card, the update information is rewritten into the IC card and stored in the storage chip of the card swiping device; unauthorized cards are directly locked, and the signal is transmitted to the hardware control circuit, and a buzzer prompt sound is emitted.

[0012] The present invention is further configured as follows: in S10, the generation of the initial key includes: the card writer randomly generates a set of 7-byte 56-bit character strings, the card writing software selects an arbitrary value from 1 to 60000 as the project number, the character string randomly generated by the card writer is mixed with the project number, and then the key is obtained by a table lookup replacement method.

[0013] The present invention is further configured as follows: the S20 includes S21, writing data to the IC card password block; S22, writing data to the IC card data block;

[0014] The S21 includes: the password block of sector 0 retains the initial password of the IC card when it leaves the factory; the password blocks of the remaining sectors use a one-card-one-password encryption method to encrypt the password blocks of three consecutive sectors of the IC card;

[0015] The S22 includes: writing plain data, i.e., the UID number of the IC card, into the data block of sector 0; using the initial key as the key of the DES algorithm, the plain data is encrypted for the first time using the DES encryption algorithm to generate ciphertext 1; using the initial key as the key of the AES algorithm, the ciphertext 1 is encrypted for the second time using the AES encryption algorithm to generate ciphertext 2; and finally, writing the contents of ciphertext 2 into the data blocks of three consecutive sectors of the IC card using the card issuer.

[0016] The present invention is further configured as follows: the S30 includes: S31, decrypting the block in the sector, S32, judging whether the data is successfully decrypted, S33, calling the data recorded in the storage chip for comparison, judging whether the data is valid, S34, writing new data according to the current new information and storing it in the storage chip, S35, updating the ciphertext of the IC card data block;

[0017] S31 includes: decryption of password blocks, decryption of password blocks in three consecutive sectors of the IC card, and reading of data block contents; decryption of data blocks, using AES algorithm and DES algorithm to encrypt and decrypt data blocks;

[0018] S32 includes: after decryption, judging the data, treating the data that cannot be decrypted as invalid data, judging the card as invalid; or generating valid data 1 from the data that meets the decryption logic;

[0019] S33 includes: data comparison, calling the data of the last card swipe of the IC card recorded in the storage chip, and comparing it with the "valid data 1", if the data matches and conforms to the operation logic, it is judged that the data is valid; if the data does not match or conform to the operation logic, it is judged that the data is invalid and the IC card is a duplicate card;

[0020] S34 includes: writing new data according to the current new information, generating valid data 2, and storing it in the storage chip as comparison data for the next card swipe;

[0021] S35 includes: performing DES algorithm and AES algorithm to encrypt the valid data 2 twice, writing it into the IC card data block, and waiting for the next card swipe verification.

[0022] The present invention is further configured as follows: the IC card UID number is information related to the card issuance type, valid time, number of times, authorized elevators and floors.

[0023] The present invention further provides an IC card anti-copying encryption terminal, including one or more processors; and a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the IC card anti-copying encryption method as described above.

[0024] The present invention further provides an IC card anti-copying encryption storage medium for storing one or more programs for implementing the IC card anti-copying encryption method as described above.

[0025] The present invention has the following beneficial effects: the present invention mainly adds DES+AES algorithm encryption to the plain text data of the data block on the basis of one card one password, thereby truly preventing the use of abnormal authorized IC cards (copy cards). BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of the process of the present invention.

[0027] Figure 2 It is a schematic diagram of the process of writing data into the data block of the IC card of the present invention.

[0028] Figure 3 It is a schematic diagram of the process of the card swiping device of the present invention identifying an IC card.

[0029] Figure 4 A schematic diagram of an implementation method of writing IC card password block data according to the present invention.

[0030] Figure 5 A schematic diagram of an implementation method of writing data into an IC card according to the present invention. DETAILED DESCRIPTION

[0031] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0032] The present invention proposes an IC card anti-copy encryption method, which at least comprises the following steps: S10, a card writer reads IC card data and pregenerates an initial key used as an initial key for encryption by AES algorithm and DES algorithm;

[0033] S20, the card writer rewrites the IC card data, uses the read IC card data and the initial secret key to encrypt, and writes data into the password block and data block of the continuous sector of the IC card;

[0034] S30, the card swiping device identifies the IC card, decrypts the password block and data block of the continuous sector of the IC card, and if it is determined to be an authorized card, the update information is rewritten into the IC card and stored in the memory chip of the card swiping device; an unauthorized card is directly locked, and the signal is transmitted to the hardware control circuit, which emits a buzzer prompt sound.

[0035] In S10, the generation of the initial key includes: the card writer randomly generates a set of 7-byte 56-bit strings, the card writing software selects an arbitrary value from 1 to 60000 as the project number, the string randomly generated by the card writer is mixed with the project number, and then the key is obtained by table lookup replacement method.

[0036] The S20 includes S21, writing data into the IC card password block; S22, writing data into the IC card data block;

[0037] The S21 includes: the password block of sector 0 retains the initial password of the IC card when it leaves the factory; the password blocks of the remaining sectors use a one-card-one-password encryption method to encrypt the password blocks of three consecutive sectors of the IC card; the initial password of the IC card when it leaves the factory is "FFFFFFFFFFFFFF078069FFFFFFFFFFFF", and the three consecutive sectors are encrypted using the card issuer, using a one-card-one-password encryption method, and the password of each card is different, as shown in the attached Figure 4 Shown are two encrypted IC cards.

[0038] The S22 includes: writing plain data, i.e., the UID number of the IC card, into the data block of sector 0; using the initial key as the key of the DES algorithm, the plain data is encrypted for the first time using the DES encryption algorithm to generate ciphertext 1; using the initial key as the key of the AES algorithm, the ciphertext 1 is encrypted for the second time using the AES encryption algorithm to generate ciphertext 2; and finally writing the content of ciphertext 2 into the data blocks of three consecutive sectors of the IC card using the card issuer;

[0039] The S30 includes: S31, decrypting the block in the sector, S32, judging whether the data is successfully decrypted, S33, calling the data recorded in the storage chip for comparison, and judging whether the data is valid, S34, writing new data according to the current new information and storing it in the storage chip, S35, updating the ciphertext of the IC card data block;

[0040] S31 includes: decryption of password blocks, decryption of password blocks in three consecutive sectors of the IC card, and reading of data block contents; decryption of data blocks, using AES algorithm and DES algorithm to encrypt and decrypt data blocks;

[0041] S32 includes: after decryption, judging the data, treating the data that cannot be decrypted as invalid data, judging the card as invalid; or generating valid data 1 from the data that meets the decryption logic;

[0042] S33 includes: data comparison, calling the last card swipe data of the IC card recorded in the storage chip, comparing it with "valid data 1", comparing the IC card UID number, card issuance type, valid time, number of times, authorized elevator, floor, etc., if the data matches and conforms to the operation logic, it is judged that the data is valid; if the data does not match or does not conform to the operation logic, it is judged that the data is invalid and the IC card is a duplicate card;

[0043] S34 includes: writing new data according to the current new information, generating valid data 2 according to the valid time, number of times, authorized elevator, floor and other information, and storing it in the storage chip as comparison data for the next card swipe;

[0044] S35 includes: performing DES algorithm and AES algorithm to encrypt the valid data 2, writing it into the IC card data block, and waiting for the next card swipe verification;

[0045] The IC card UID number contains information related to the card issuance type, validity period, number of times, authorized elevators and floors.

[0046] An IC card anti-copy encryption terminal includes one or more processors; and a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the IC card anti-copy encryption method as described above.

[0047] An IC card anti-copy encryption storage medium is used to store one or more programs for implementing the IC card anti-copy encryption method as described above.

[0048] Example of using IC card to write encrypted data: Figure 5 As shown, a common IC card has 16 sectors, each sector has 4 blocks, each block has 16 bytes; among them, sector 0 block 0 "8D75B2A9E3080400021416E840E1EB1D" is the IC card manufacturing information, among which "8D75B2A9" is the UID number, which cannot be modified under normal circumstances. The IC card used to make a copy card is a special IC card, and this block can be modified; among which sector 0 block 3 is the initial password of the IC card when it leaves the factory, which is "FFFFFFFFFFFFFF078069FFFFFFFFFFFF"; taking this IC card as an example, sector 1 sector 2 sector 3 is encrypted, among which block 7, block 11, and block 15 are the password blocks of the sector, and the password is written in one card and one password, and the password of each card is different; the remaining data blocks are written with ciphertext encrypted by the DES algorithm + AES algorithm.

[0049] Although the present invention has been described with reference to preferred embodiments, various modifications may be made thereto and parts thereof may be replaced by equivalents without departing from the scope of the present invention. In particular, the various technical features mentioned in the various embodiments may be combined in any manner as long as there is no structural conflict. The present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

[0050] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements.

[0051] For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0052] The term "comprise" or any other similar term is intended to cover a non-exclusive inclusion, such that a process, article, or apparatus / device that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, article, or apparatus / device.

[0053] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. An IC card anti-copy encryption method, characterized in that: The method comprises at least the following steps: S10, the card writer reads the IC card data and pregenerates an initial key used as the initial key for encryption by the AES algorithm and the DES algorithm; S20, the card writer rewrites the IC card data, uses the read IC card data and the initial secret key to encrypt, and writes data into the password block and data block of the continuous sector of the IC card; S30, the card swiping device identifies the IC card, decrypts the password block and data block of the continuous sector of the IC card, and if it is determined to be an authorized card, the update information is rewritten into the IC card and stored in the memory chip of the card swiping device; an unauthorized card is directly locked, and the signal is transmitted to the hardware control circuit, which emits a buzzer prompt sound.

2. An IC card anti-copy encryption method as claimed in claim 1, characterized in that: In S10, the generation of the initial key includes: the card writer randomly generates a set of 7-byte 56-bit strings, the card writing software selects an arbitrary value from 1 to 60000 as the project number, the string randomly generated by the card writer is mixed with the project number, and then the key is obtained by table lookup replacement method.

3. An IC card anti-copy encryption method as claimed in claim 1, characterized in that: The S20 includes S21, writing IC card password block data; S22, writing data into the IC card data block; The S21 includes: the password block of sector 0 retains the initial password of the IC card when it leaves the factory; the password blocks of the remaining sectors use a one-card-one-password encryption method to encrypt the password blocks of three consecutive sectors of the IC card; The S22 includes: writing plain data, i.e., the UID number of the IC card, into the data block of sector 0; using the initial key as the key of the DES algorithm, the plain data is encrypted for the first time using the DES encryption algorithm to generate ciphertext 1; using the initial key as the key of the AES algorithm, the ciphertext 1 is encrypted for the second time using the AES encryption algorithm to generate ciphertext 2; and finally, writing the contents of ciphertext 2 into the data blocks of three consecutive sectors of the IC card using the card issuer.

4. An IC card anti-copy encryption method as claimed in claim 1, characterized in that: The S30 includes: S31, decrypting the block in the sector, S32, judging whether the data is successfully decrypted, S33, calling the data recorded in the storage chip for comparison, and judging whether the data is valid, S34, writing new data according to the current new information and storing it in the storage chip, S35, updating the ciphertext of the IC card data block; S31 includes: decryption of password blocks, decryption of password blocks in three consecutive sectors of the IC card, and reading of data block contents; decryption of data blocks, using AES algorithm and DES algorithm to encrypt and decrypt data blocks; S32 includes: after decryption, judging the data, treating the data that cannot be decrypted as invalid data, judging the card as invalid; or generating valid data 1 from the data that meets the decryption logic; S33 includes: data comparison, calling the last card swipe data of the IC card recorded in the storage chip, and comparing it with "valid data 1", if the data matches and conforms to the operation logic, it is judged that the data is valid; if the data does not match or conform to the operation logic, it is judged that the data is invalid and the IC card is a duplicate card; S34 includes: writing new data according to the current new information, generating valid data 2, and storing it in the storage chip as comparison data for the next card swipe; S35 includes: performing DES algorithm and AES algorithm to encrypt the valid data 2 twice, writing it into the IC card data block, and waiting for the next card swipe verification.

5. An IC card anti-copy encryption method as claimed in claim 3, characterized in that: The IC card UID number contains information related to the card issuance type, validity period, number of times, authorized elevators and floors.

6. An IC card anti-copy encryption terminal, characterized in that: comprising one or more processors; And a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the IC card anti-copying encryption method as described in any one of claims 1-5.

7. An IC card anti-copying encrypted storage medium, characterized in that: Used to store one or more programs for implementing the IC card anti-copying encryption method as described in any one of claims 1-5.