CN113065367B - IC card reading method, IC card reading device, electronic device, and storage medium - Google Patents

IC card reading method, IC card reading device, electronic device, and storage medium Download PDF

Info

Publication number
CN113065367B
CN113065367B CN202110333756.8A CN202110333756A CN113065367B CN 113065367 B CN113065367 B CN 113065367B CN 202110333756 A CN202110333756 A CN 202110333756A CN 113065367 B CN113065367 B CN 113065367B
Authority
CN
China
Prior art keywords
card
information
number information
card number
data
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.)
Active
Application number
CN202110333756.8A
Other languages
Chinese (zh)
Other versions
CN113065367A (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.)
Core Computing Integrated Shenzhen Technology Co ltd
Original Assignee
Xinjiang Aiwinn Information Technology 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 Xinjiang Aiwinn Information Technology Co Ltd filed Critical Xinjiang Aiwinn Information Technology Co Ltd
Priority to CN202110333756.8A priority Critical patent/CN113065367B/en
Publication of CN113065367A publication Critical patent/CN113065367A/en
Application granted granted Critical
Publication of CN113065367B publication Critical patent/CN113065367B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10118Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the sensing being preceded by at least one preliminary step
    • G06K7/10138Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the sensing being preceded by at least one preliminary step the step consisting of determining the type of record carrier, e.g. to determine if the record carrier is an RFID tag of the long or short range type, or to determine the preferred communication protocol of the RFID tag
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10198Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves setting parameters for the interrogator, e.g. programming parameters and operating modes

Abstract

The embodiment of the invention discloses an IC card reading method, an IC card reading device, electronic equipment and a storage medium, wherein the IC card reading method comprises the following steps: acquiring first card number information of an IC card acquired by a card reader and verification information, wherein the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information; carrying out key verification on the target sector according to the key information; when the key verification fails, outputting the first card number information; and when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information.

Description

IC card reading method, IC card reading device, electronic device, and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an IC card reading method and apparatus, an electronic device, and a storage medium.
Background
At present, IC cards (integrated circuit cards) have been widely used in the fields of building automation, office automation, public transportation, finance, etc., and general IC cards can be used in the fields of attendance checking, door access, elevators, night patrol, road gates, parking lots, consumption systems, etc.
Therefore, more and more IC card terminals appear in the market, and people can conveniently use the IC cards to read and verify the IC cards so as to realize the functions of checking attendance, consuming, unlocking and the like. In the prior art, a reading method used by an IC card terminal is generally directed to one of an unencrypted ordinary IC card or an encrypted IC card, and when the IC card terminal is used, the IC card needs to be uniformly normalized, for example, all ordinary cards or all encrypted cards are used. The IC card reading method in the prior art cannot be compatible with data reading of a common card and an encryption card at the same time, and the use scene is limited.
Disclosure of Invention
Based on the above, the invention provides an IC card reading method, an IC card reading device, an electronic device and a storage medium, which can be compatible with data reading of a common card and an encryption card.
In a first aspect, there is provided an IC card reading method including:
acquiring first card number information of an IC card acquired by a card reader and verification information, wherein the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information;
carrying out key verification on the target sector according to the key information;
when the key verification fails, outputting the first card number information; and when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information.
Optionally, the obtaining the second card number information within the preset time includes:
controlling the card reader to acquire the card number information of the IC card again as third card number information;
judging whether the third card number information is consistent with the first card number information or not;
and outputting the second card number information when the third card number information is consistent with the first card number information.
Optionally, the verification information further includes a reading mode, and when the reading mode is single-sector reading, the obtaining of the second card number information includes:
acquiring first data information stored in the target sector;
and processing the first data information to generate the second card number information.
Optionally, the verification information further includes a reading mode, when the reading mode is multi-sector reading, the target sector includes a plurality of target sectors, and the obtaining the second card number information includes:
acquiring first data information stored in all the target sectors, and defining all the first data information sets as second data information;
splicing the second data information to generate third data information;
and processing the third data information to generate the second card number information.
Optionally, the processing the first data information to generate the second card number information includes:
adjusting the position of the first data information according to a preset adjustment rule;
carrying out system conversion on the adjusted first data information;
and performing bit complementing processing on the first data information after the binary conversion to generate second card number information with a specified length.
Optionally, the obtaining of the first data information stored in all the target sectors, and defining all the first data information sets as second data information includes:
acquiring first data information of a first target sector;
calculating a sector key of the next target sector based on the first data information of the sector data of the previous target sector;
and sequentially acquiring first data information of all target sectors, and defining a set of sector data of all the target sectors as the second data information.
Optionally, after the obtaining of the first card number information acquired by the card reader, the method includes:
and calculating the checking information according to the first card number information.
In a second aspect, there is provided an IC card reading apparatus comprising:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring first card number information of an IC card acquired by a card reader and verification information, and the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information;
the processing module is used for carrying out key verification on the target sector according to the key information;
the execution module is used for outputting the first card number information when the key verification fails; and when the key is verified successfully, acquiring the encrypted second card number information and outputting the second card number information.
Optionally, the IC card reading apparatus further includes:
the first acquisition sub-module is used for controlling the card reader to reacquire the card number information of the IC card to be used as third card number information;
the first processing submodule is used for judging whether the third card number information is consistent with the first card number information or not;
and the first execution submodule is used for outputting the second card number information when the third card number information is consistent with the first card number information.
Optionally, the IC card reading apparatus further includes:
the second acquisition submodule is used for acquiring the first data information stored in the target sector;
and the second processing submodule is used for processing the first data information to generate the second card number information.
Optionally, the IC card reading apparatus further includes:
the third obtaining submodule is used for obtaining the first data information stored in all the target sectors and defining all the first data information sets as second data information;
the third processing submodule is used for splicing the second data information to generate third data information;
and the fourth processing submodule is used for processing the third data information to generate the second card number information.
Optionally, the IC card reading apparatus further includes:
the first adjusting submodule is used for adjusting the position of the first data information according to a preset adjusting rule;
the first conversion submodule is used for carrying out system conversion on the adjusted first data information;
and the first bit complementing submodule is used for carrying out bit complementing processing on the first data information after the binary conversion to generate second card number information with specified length.
Optionally, the IC card reading apparatus further includes:
a fourth obtaining sub-module, configured to obtain first data information of a first target sector;
the first calculation submodule is used for calculating the sector key of the next target sector according to the first data information of the sector data of the previous target sector;
and the second execution submodule is used for sequentially acquiring the first data information of all the target sectors and defining a set of sector data of all the target sectors as the second data information.
Optionally, the IC card reading apparatus further includes:
and the second calculation submodule is used for calculating the verification information according to the first card number information.
In a third aspect, an electronic device is provided, a processor and a memory for storing processor-executable instructions; wherein the memory stores a computer program that, when executed by the processor, causes the processor to execute the steps of the IC card reading method of any one of the above.
In a fourth aspect, there is provided a non-transitory computer-readable storage medium having computer-readable instructions stored therein, which when executed by one or more processors, perform the steps of the IC card reading method of any one of the above.
According to the IC card reading method, the IC card reading device, the electronic equipment and the storage medium, the card reader is used for directly collecting the first card number information of the IC card, the key verification is carried out through the verification information, the encrypted second card number information is obtained and output when the verification is successful, the first card number information is output when the encryption is failed, the reading of the common card and the reading of the data of the encrypted card can be realized, different equipment or reading methods do not need to be selected according to the type of the IC card, and the application scenes of the reading of the IC card are effectively increased.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a basic flow chart of an IC card reading method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating the process of obtaining the third card number information for verification according to the embodiment of the present invention;
FIG. 3 is a flow chart illustrating a single sector read mode according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating a multi-sector read mode according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a process for processing first data information according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a process of acquiring second data information according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating an IC card reading method according to an embodiment of the present invention;
FIG. 8 is a block diagram showing the basic structure of an IC card reading apparatus according to an embodiment of the present invention;
fig. 9 is a block diagram of a basic structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention.
In some of the flows described in the present specification and claims and in the above figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, with the order of the operations being indicated as 101, 102, etc. merely to distinguish between the various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without any inventive step, are within the scope of the present invention.
As will be understood by those skilled in the art, a "terminal" as used herein includes both devices having a wireless signal receiver, which are only devices having a wireless signal receiver without transmit capability, and devices having receive and transmit hardware, which are devices having receive and transmit hardware capable of performing two-way communications over a two-way communications link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (personal communications service), which may combine voice, data processing, facsimile and/or data communications capabilities; a PDA (personal digital assistant), which may include a radio frequency receiver, a pager, internet/intranet access, web browser, notepad, calendar and/or GPS (global positioning system) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" can be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, the "terminal device" may also be a communication terminal, a internet access terminal, and a music/video playing terminal, for example, a PDA, an MID (mobile internet device), and/or a mobile phone with music/video playing function, and may also be a smart television, a set-top box, and other devices.
It should be noted that, in general, each IC card has 16 sectors, including a common sector and 15 data sectors. Each sector is divided into 4 blocks, each data block occupying 16 bytes. The sector number is 0-15, the block number is 0-3, the block 0 of the 0 th sector is used for storing the manufacturer code of the IC card, and the manufacturer code is fixed and comprises the serial numbers UID, ATQA and SAK of the IC card chip. Block 0, block 1, block 2 of each sector may be used to store data (except block 0 of sector 0), and block 3 of each sector is a control block used to hold the data encryption key and corresponding control authority of the corresponding sector, and cannot be used to store data. The first 6 bytes of the 16 bytes of data of block 3 are key KeyA, the last 6 bytes are key KeyB, and the middle 4 bytes are storage control bits. Each of the data stored in the sector may be encrypted by KeyA or KeyB of the corresponding sector. The KeyA and KeyB default values of the sectors are FFFFFFFFFFFF, and the difference between the encryption card and the non-encryption card is whether the KeyA and KeyB default values of the data sectors.
Specifically, referring to fig. 1, fig. 1 is a basic flow chart of the IC card reading method of the present embodiment.
As shown in fig. 1, an IC card reading method includes:
s1100, acquiring first card number information of the IC card acquired by a card reader and verification information, wherein the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information;
generally, each IC card has a string of 16-ary numeric values stored therein, and the string of data is unencrypted and can be read by any IC card reading and writing device (e.g. card reader), which is a serial number corresponding to the IC card and is relatively unique. The 16-system data is read by the card reader, and a string of 10-system numbers, which are card numbers corresponding to common IC cards, can be obtained through processing and conversion as the first card number information. Of course, the character string stored in the IC card may be in other systems, such as 10 systems or 2 systems. The card reader monitors whether the card reading area has the IC card or not, and when the IC card appears in the card reading area, the data of the IC card is read.
The verification information includes sector information and corresponding key information, the sector information includes sector numbers that need to be read and verified, such as sector number 1, sector number 2, and so on. The key information is a key corresponding to each target sector and is used for verifying each sector. The verification information may be input by a user, or may be stored in a designated storage space of a card reader or other device having a storage space, but is not limited thereto.
S1200, performing key verification on the target sector according to the key information;
s1300, outputting the first card number information when the key verification fails; when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information;
and outputting the first card number information read by the card reader when the key verification of the target sector fails, namely outputting the card number corresponding to the common IC card. When using non-encrypted IC card, the card number of IC card can be read directly and output. In this embodiment, one or more target sectors may be used, and when one target sector is used, the first card number information is directly output if the target sector fails to perform key verification; when the number of target blind areas is multiple, corresponding verification strategies can be set, for example, when all target sectors fail to verify, the first card number information is output, or when one sector fails to verify, the first card number information is output, or when at least one target sector succeeds in verifying and at least one target sector fails to verify, the card number reading failure is prompted, and the card number output is not performed. The verification strategy can be set according to the actual application requirement, and is not limited to the above several scenarios.
And when the key verification of the target sector is successful, reading the data in the sector, processing the data in the sector to obtain an encrypted card number of the IC card, namely second card number information, and outputting the second card number information. When the target sector includes at least two sectors, the data read into the sector needs to be integrated, and the integration mode includes simple splicing, for example, the data of the 1 st sector and the data of the 2 nd sector are directly spliced into longer data from front to back, or the data of one sector is used as a coefficient, the data of the other sector is operated, and the like, for example, the data of each sector is multiplied by the data of the sector 1, and then the obtained multiple data are spliced, and the like, but not limited thereto, and the integration mode can be adjusted according to the actual application requirements.
The method has the advantages that the first card number information of the IC card is directly acquired, the key verification is carried out through the verification information, the encrypted second card number information is acquired and output when the verification is successful, the first card number information is output when the encryption is failed, the data of the encrypted card can be read while the common card is read, different equipment or reading methods do not need to be selected according to the type of the IC card, and the application scenes of the IC card reading are effectively increased.
As shown in fig. 2, the obtaining the second card number information within the preset time further includes:
s1310, controlling the card reader to acquire card number information of the IC card again as third card number information;
and controlling the card reader to acquire the common card number of the IC card again as third card number information within a preset time (for example, 1S, but not limited thereto) after the second card number information is acquired.
S1320, judging whether the third card number information is consistent with the first card number information;
and comparing the third card number information with the first card number information to judge whether the third card number information and the first card number information are consistent.
S1330, outputting the second card number information when the third card number information is consistent with the first card number information;
when the third card number information is inconsistent with the first card number information, the IC card is changed in the card reading process and is possibly transferred in the card reading process, and a prompt of card reading failure is sent at the moment.
By acquiring the third card number information again after the encrypted second card number information is acquired and comparing the third card number information with the first card number information, the possibility of card reading errors caused by the fact that the IC card is exchanged in the card reading process can be effectively reduced, and the effectiveness of IC card reading is improved.
In some embodiments, the check information further includes a read mode, the read mode includes a single-sector read and a multi-sector read, and the number of the target sectors may be one or more. The reading mode may be input by a user, or calculated according to the first card number information of the IC card, etc., but is not limited thereto.
As shown in fig. 3, when the reading mode is single-sector reading, the acquiring the second card number information specifically includes:
s1340, acquiring first data information stored in the target sector;
and after the key verification of the target sector is completed, reading the data of the target sector as first data information.
S1350, processing the first data information to generate second card number information;
the first data information is processed according to a preset rule, and the processing mode includes, but is not limited to, calculation, character position adjustment, system adjustment, and the like. And processing the first data information according to a rule to form data with a certain length as second card number information.
For example, how the first data information generates the second card number information
As shown in fig. 4, when the reading mode is multi-sector reading, the acquiring the second card number information specifically includes:
s1360, acquiring first data information stored in all the target sectors, and defining all the first data information sets as second data information;
the first data stored in each target sector is extracted, and the set of the first data information of all the target sectors is defined as the second data information.
S1370, splicing the second data information to generate third data information;
and splicing the data contained in the second data information according to a preset splicing rule, where the splicing mode may be adjusted according to the actual application requirement, for example, the data of each sector is directly spliced in sequence, or spliced according to a certain order, and is not limited herein. And taking the spliced data as third data information.
S1380, processing the third data information to generate the second card number information;
the third data information is processed according to the preset rule, and the processing mode includes, but is not limited to, operation, character position adjustment, system adjustment, and the like. And processing the third data information according to rules to form data with a certain length as second card number information.
As shown in fig. 5, in S1350, the processing is performed on the first data information, and the generating of the second card number information specifically includes:
s1351, adjusting the position of the first data information according to a preset adjustment rule;
the adjustment rule may be set according to actual application needs, for example, data of the acquired first data information is inverted, or the first N bits are inverted and the last N bits are exchanged, but is not limited thereto. In this embodiment, 2 bits are taken each time from the end of the data, and then the data are arranged in sequence, assuming that the original data is 1A5221B4, and 2 bits are taken each time from the end, namely B4, 21, 52, 1A, and then the data are arranged in sequence, so that the adjusted data is B421521A.
S1352, carrying out system conversion on the adjusted first data information;
and converting according to the binary system before adjustment and the binary system required to be adjusted, for example, converting the 16-ary system into the 10-ary system, that is, the adjusted data is B421521A, and converting into the 10-ary system to obtain 3022082586. The conversion of the system can be adjusted according to the actual application requirement, for example, the 16 system is converted into the 8 system, and the like, but is not limited thereto.
S1353, performing bit complementing processing on the first data information after the system conversion to generate second card number information with a specified length;
padding the binary converted data according to the length of the card number required to be generated, for example, when the generated data is 3022082586 digits with 10 digits and the required card number is 12 digits, padding the data at the end, adding 2 0's, and obtaining 302208258600 as the second card number information. The length of the card number, the bit complementing rule, etc. can be adjusted according to the actual application requirements, for example, the length of the required card number can be 10 bits, the bit complementing is not required when the obtained data is 10 bits, and the obtained data is directly used as the second card number information. When the data is complemented, the same character, for example, 0, 1, etc., may be used to directly complement the missing bit number in the data, or the data may be directly repeated, for example, when two bits are missing, the first two bits of the fetched data are complemented to the end (3022082586 is complemented to 302208258630). The position of the complement bits may also be adjusted, for example, at the end, beginning, or designated byte location of the data.
As shown in fig. 6, S1360 obtains all the first data information stored in the target sector, and defines all the first data information sets as the second data information, which specifically includes:
s1361, acquiring first data information of a first target sector;
the first data information of the first target sector is verified and read through the key, and the "first" in this embodiment may refer to the first in the sense of sector sequence, for example, the sequence is performed according to the serial number of the sector, and the sector 0-15, 0, is the first; or may be the first in a preset reading sequence, for example, sector 2 is read first, and then sector 2 is the first.
S1362, calculating a sector key of the next target sector based on the first data information of the more than one target sector;
the "previous" and "next" in this embodiment are read context determined based on the reading order, for example, sectors 0 to 4 need to be read according to the sector number, where sector 1 is the "next" sector of sector 0 and sector 0 is the "previous" sector of the "blind area 1. And when reading is carried out according to the reading sequence, the read first data information is used as a calculation basis of a key corresponding to the next sector needing to be read.
Specifically, the verification information includes a key corresponding to a first sector to be read, the key in the verification information is used to verify and read data of the first sector, the data of the first sector is calculated to obtain a sector key of a second sector, the sector key of the second sector is used to verify and read data of the second sector, the data of the second sector is calculated to obtain a sector key of a third sector, and so on. In this embodiment, "first", "second", and "third" refer to the precedence relationship of the sector reading order. For example, when sector 2 is read first, sector 4 is read, and sector 7 is read, sector 2 is the first, sector 4 is the second, and sector 7 is the third.
When the data is calculated to obtain the sector key of the next target sector, the calculation rule may be adjusted according to the actual application requirement, for example, the data may be multiplied by a certain parameter, or the data may be reordered, but is not limited thereto. The rules may be the same or different for each calculation, e.g., different for each calculation.
S1363, sequentially acquiring first data information of all target sectors, and defining a set of the first data information of all target sectors as the second data information;
the method for calculating the key of the next target sector by the data of the target sector can effectively increase the possibility of the sector key being cracked and increase the safety factor of the IC card.
The obtaining of the verification information is not limited to the manner in each of the above embodiments, and in some embodiments, a sector corresponding to a sequence number having a mapping relationship with the first card number information is used as a target sector, and data of a specified digit of the first card number information is used as a key corresponding to the target sector.
Specifically, after the card number information is acquired, the corresponding check information is calculated according to a certain rule, for example, a sector with a serial number corresponding to the mantissa of the card number is used as a target sector, the first 6 bits of the card number are used as a corresponding key, and the like, or for example, the first digit of the card number is used as the number of the target sector, for example, the first bit of the card number is 3, that is, the first 3 sectors are used as the target sectors, and then the last 6 bits of the card number are used as the corresponding sector keys. The calculation rule can be adjusted according to the actual application requirement, and is not limited herein.
By means of calculating the verification information by the first card number information of the IC card, the diversity of the verification rules of the IC card is increased, the safety of the IC card can be further increased, and the possibility of being cracked is reduced.
In a specific embodiment, a flow of the IC card reading method is shown in fig. 7, and includes the following steps:
acquiring a reading mode, sector information and key information;
acquiring first card number information acquired by a card reader;
according to the key information, carrying out key verification on a target sector having a mapping relation with the sector information, if the verification fails, outputting first card number information, and ending the process;
if the verification is successful, reading the data of the target sector according to the reading mode, and processing the data to obtain second card number information;
the card reader collects the card number of the IC card again as the third card number information;
comparing the first card number information with the third card number information, judging whether the first card number information and the third card number information are consistent, and prompting that the card number reading is failed when the comparison is failed, namely the first card number information and the third card number information are inconsistent, and ending the process;
and when the comparison is successful, namely the two are consistent, outputting the second card number information, and ending the process.
In order to solve the above technical problem, an embodiment of the present invention further provides an IC card reading apparatus. Referring to fig. 8, fig. 8 is a block diagram of a basic structure of the IC card reading apparatus according to the present embodiment.
As shown in fig. 8, the IC card reading apparatus includes: an acquisition module 2100, a processing module 2200, and an execution module 2300. The acquisition module is used for acquiring first card number information of the IC card acquired by the card reader and verification information, wherein the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information; the processing module is used for carrying out key verification on the target sector according to the key information; the execution module is used for outputting the first card number information when the key verification fails; and when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information.
The first card number information of the IC card is directly acquired, the key verification is carried out through the verification information, the encrypted second card number information is acquired and output when the verification is successful, and the first card number information is output when the encryption is failed, so that the data of the encrypted card can be read while the common card is read, different equipment or reading methods do not need to be selected according to the type of the IC card, and the applicable scene of reading the IC card is effectively increased.
In some embodiments, the IC card reading apparatus further includes: the device comprises a first acquisition submodule, a first processing submodule and a first execution submodule. The first acquisition sub-module is used for controlling the card reader to reacquire the card number information of the IC card as third card number information; the first processing submodule is used for judging whether the third card number information is consistent with the first card number information; the first execution submodule is used for outputting the second card number information when the third card number information is consistent with the first card number information.
In some embodiments, the IC card reading apparatus further includes: a second obtaining submodule and a second processing submodule. The second obtaining submodule is used for obtaining first data information stored in the target sector; the second processing submodule is used for processing the first data information to generate the second card number information.
In some embodiments, the IC card reading apparatus further includes: a third obtaining submodule, a third processing submodule and a fourth processing submodule. The third obtaining submodule is used for obtaining first data information stored in all the target sectors and defining all the first data information sets as second data information; the third processing submodule is used for splicing the second data information to generate third data information; the fourth processing submodule is used for processing the third data information to generate the second card number information.
In some embodiments, the IC card reading apparatus further includes: the first adjusting submodule, the first converting submodule and the first bit-complementing submodule. The first adjusting submodule is used for adjusting the position of the first data information according to a preset adjusting rule; the first conversion submodule is used for carrying out system conversion on the adjusted first data information; the first bit complementing submodule is used for carrying out bit complementing processing on the first data information after the binary system conversion to generate second card number information with specified length.
In some embodiments, the IC card reading apparatus further includes: the device comprises a fourth obtaining submodule, a first calculating submodule and a second executing submodule. The fourth obtaining submodule is used for obtaining first data information of the first target sector; the first calculation submodule is used for calculating the sector key of the next target sector according to the first data information of the sector data of the above target sector; the second execution submodule is used for sequentially acquiring the first data information of all the target sectors, and defining a set of sector data of all the target sectors as the second data information.
In some embodiments, the IC card reading apparatus further includes: and a second calculation submodule. The second calculation submodule is used for calculating the check information according to the first card number information.
In order to solve the above technical problem, an embodiment of the present invention further provides an electronic device. Referring to fig. 9, fig. 9 is a block diagram of a basic structure of the electronic device according to the embodiment.
As shown in fig. 9, an internal structure of the electronic device is schematically illustrated. As shown in fig. 9, the electronic device includes a processor, a nonvolatile storage medium, a memory, and a network interface connected through a system bus. The non-volatile storage medium of the electronic device stores an operating system, a database and computer readable instructions, the database can store control information sequences, and the computer readable instructions can enable the processor to realize an IC card reading method when being executed by the processor. The processor of the electronic device is used for providing calculation and control capability and supporting the operation of the whole electronic device. The memory of the electronic device may have computer readable instructions stored therein, which when executed by the processor, may cause the processor to perform an IC card reading method. The network interface of the electronic equipment is used for connecting and communicating with the terminal. It will be appreciated by those skilled in the art that the configurations shown in the figures are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the electronic devices to which the present application may be applied, and a particular electronic device may include more or less components than those shown in the figures, or may combine certain components, or have a different arrangement of components.
The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the IC card reading method according to any of the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-only memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
All possible combinations of the technical features of the above embodiments may not be described for the sake of brevity, but should be considered as within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An IC card reading method, comprising:
acquiring first card number information of an IC card acquired by a card reader and verification information, wherein the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information;
carrying out key verification on the target sector according to the key information;
when the key verification fails, outputting the first card number information; and when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information.
2. The IC card reading method of claim 1, wherein within a preset time after the second card number information is acquired, further comprising:
controlling the card reader to acquire the card number information of the IC card again as third card number information;
judging whether the third card number information is consistent with the first card number information or not;
and outputting the second card number information when the third card number information is consistent with the first card number information.
3. The IC card reading method according to claim 1, wherein the verification information further includes a reading mode, and when the reading mode is a single sector reading, the acquiring the second card number information includes:
acquiring first data information stored in the target sector;
and processing the first data information to generate the second card number information.
4. The IC card reading method according to claim 1, wherein the verification information further includes a reading mode, when the reading mode is multi-sector reading, the target sector includes a plurality of sectors, and the acquiring the second card number information includes:
acquiring first data information stored in all the target sectors, and defining all the first data information sets as second data information;
splicing the second data information to generate third data information;
and processing the third data information to generate the second card number information.
5. The IC card reading method according to claim 3, wherein the processing the first data information to generate the second card number information includes:
adjusting the position of the first data information according to a preset adjustment rule;
carrying out scale conversion on the adjusted first data information;
and performing bit complementing processing on the first data information after the binary conversion to generate second card number information with a specified length.
6. The IC card reading method according to claim 4, wherein said acquiring all of the stored first data information in the target sectors, and defining all of the sets of first data information as the second data information, comprises:
acquiring first data information of a first target sector;
calculating a sector key of the next target sector based on the first data information of the sector data of the previous target sector;
and sequentially acquiring first data information of all target sectors, and defining a set of sector data of all the target sectors as the second data information.
7. The IC card reading method according to claim 1, wherein after acquiring the first card number information acquired by the card reader, the method comprises:
calculating the verification information according to the first card number information in the following mode:
and taking a sector corresponding to the serial number with the mapping relation with the first card number information as a target sector, and taking data of the specified digit of the first card number information as a key corresponding to the target sector.
8. An IC card reading apparatus, comprising:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring first card number information of an IC card acquired by a card reader and verification information, and the verification information comprises the number of a target sector needing to be verified and read and corresponding key information; the IC card is a common IC card or an encrypted IC card, the common IC card or the encrypted IC card comprises the unencrypted first card number information, and the encrypted IC card also comprises the encrypted second card number information;
the processing module is used for carrying out key verification on the target sector according to the key information;
the execution module is used for outputting the first card number information when the key verification fails; and when the key is successfully verified, acquiring the encrypted second card number information and outputting the second card number information.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the memory has stored therein a computer program which, when executed by the processor, causes the processor to execute the steps of the IC card reading method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having computer-readable instructions stored therein, which when executed by one or more processors, perform the steps of the IC card reading method according to any one of claims 1 to 7.
CN202110333756.8A 2021-03-29 2021-03-29 IC card reading method, IC card reading device, electronic device, and storage medium Active CN113065367B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110333756.8A CN113065367B (en) 2021-03-29 2021-03-29 IC card reading method, IC card reading device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110333756.8A CN113065367B (en) 2021-03-29 2021-03-29 IC card reading method, IC card reading device, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113065367A CN113065367A (en) 2021-07-02
CN113065367B true CN113065367B (en) 2022-08-26

Family

ID=76564583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110333756.8A Active CN113065367B (en) 2021-03-29 2021-03-29 IC card reading method, IC card reading device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113065367B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113888789B (en) * 2021-09-24 2023-07-07 日立楼宇技术(广州)有限公司 Data processing method and device based on visitor management system
CN115017927B (en) * 2021-11-15 2023-04-11 荣耀终端有限公司 Card simulation method, electronic device, and storage medium
CN115988464B (en) * 2022-07-29 2023-10-20 荣耀终端有限公司 Method for copying smart card
CN115471939B (en) * 2022-08-31 2024-02-09 广东好太太智能家居有限公司 IC card automatic encryption adding method, access control equipment and readable medium
CN116341603B (en) * 2023-05-23 2024-05-07 深圳市亲邻科技有限公司 Data storage device, IC card and data storage method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1924835A (en) * 2006-09-01 2007-03-07 西安交通大学 Dynamic key based hardware data enciphering method and device thereof
WO2008105184A1 (en) * 2007-02-28 2008-09-04 Sony Corporation Memory medium, communication system and control device
CN202502507U (en) * 2012-03-01 2012-10-24 杭州鸿雁东贝光电科技有限公司 IC card universal recognition device
CN104318287A (en) * 2014-11-04 2015-01-28 南京联创科技集团股份有限公司 Subsection inheriting method of service unification between isomerism IC card systems
CN106570984A (en) * 2016-10-19 2017-04-19 厦门中控生物识别信息技术有限公司 Card number verification method, device and system capable of supporting various wiegand formats
CN109872426A (en) * 2019-02-18 2019-06-11 广州视声智能科技有限公司 IC card encryption and authentication method and system
CN210598504U (en) * 2019-07-12 2020-05-22 浙江蚂蚁精密科技有限公司 NB (node B) Internet of things safety intelligent door lock based on dual-core multi-layer verification
CN112417915A (en) * 2020-12-07 2021-02-26 郑州名泰医疗器械有限公司 Product number configuration method based on IC card and configuration system using same

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007048239A (en) * 2005-08-12 2007-02-22 Sony Corp Input device
CN102812487A (en) * 2009-11-24 2012-12-05 约翰·安东尼·乔伊丝 A Method And System For Providing An Internet Based Transaction

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1924835A (en) * 2006-09-01 2007-03-07 西安交通大学 Dynamic key based hardware data enciphering method and device thereof
WO2008105184A1 (en) * 2007-02-28 2008-09-04 Sony Corporation Memory medium, communication system and control device
CN202502507U (en) * 2012-03-01 2012-10-24 杭州鸿雁东贝光电科技有限公司 IC card universal recognition device
CN104318287A (en) * 2014-11-04 2015-01-28 南京联创科技集团股份有限公司 Subsection inheriting method of service unification between isomerism IC card systems
CN106570984A (en) * 2016-10-19 2017-04-19 厦门中控生物识别信息技术有限公司 Card number verification method, device and system capable of supporting various wiegand formats
CN109872426A (en) * 2019-02-18 2019-06-11 广州视声智能科技有限公司 IC card encryption and authentication method and system
CN210598504U (en) * 2019-07-12 2020-05-22 浙江蚂蚁精密科技有限公司 NB (node B) Internet of things safety intelligent door lock based on dual-core multi-layer verification
CN112417915A (en) * 2020-12-07 2021-02-26 郑州名泰医疗器械有限公司 Product number configuration method based on IC card and configuration system using same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种加密硬盘的身份鉴别和密钥保护方案;谷双双等;《密码学报》;20160415(第02期);126-136 *
基于异常值检测的IC卡安全防御系统研究;王小瑞;《中国优秀博硕士学位论文全文数据库(硕士)》;20190915;I138-106 *

Also Published As

Publication number Publication date
CN113065367A (en) 2021-07-02

Similar Documents

Publication Publication Date Title
CN113065367B (en) IC card reading method, IC card reading device, electronic device, and storage medium
US20150134972A1 (en) Format preserving encryption systems for data strings with constraints
US20070186115A1 (en) Dynamic Password Authentication System and Method thereof
CA2452419A1 (en) Method for an integrated protection system of data distributed processing in computer networks and system for carrying out said method
US20040123102A1 (en) Method and system for data integrity protection
US20040093385A1 (en) Memory information backup method and system for cell phone
RU2007130340A (en) METHOD FOR CREATING A SAFE CODE, METHODS FOR ITS USE AND PROGRAMMABLE DEVICE FOR IMPLEMENTING THE METHOD
CN110768784B (en) Password transmission method, device, computer equipment and storage medium
EP1107627A1 (en) A method for protecting user data stored in memory of a mobile communication device, particularly a mobile phone
EP3447963A1 (en) Method for protecting data
CN113656661B (en) Mobile government affair system based on natural language recognition
CN111740830B (en) Information encryption and decryption method and device, information processing equipment and storage medium
US20200111087A1 (en) Method for encrypting digital contract document between contractors
US7809130B1 (en) Password recovery system and method
CN109951416B (en) Credible verification method and terminal
CN110532290B (en) Information verification device, method and storage medium based on block chain
US9203607B2 (en) Keyless challenge and response system
CN102754399B (en) For realizing the apparatus and method of Cryptographic Hash Function
CN109407974B (en) Electronic device, picture deleting method based on mixed binary code and storage medium
CN115376231A (en) Encryption verification method and device, computer equipment and storage medium
CN113343269B (en) Encryption method and device
CN114422275B (en) Sensitive information desensitization verification method and system and electronic equipment
KR102407204B1 (en) Apparatus and method for compressing using password for improving security
CN113489698B (en) Internet of things data secret reading method and system based on block chain
Kim et al. Design of an efficient image protection method based on QR code

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230609

Address after: 13C-18, Caihong Building, Caihong Xindu, No. 3002, Caitian South Road, Gangsha Community, Futian Street, Futian District, Shenzhen, Guangdong 518033

Patentee after: Core Computing Integrated (Shenzhen) Technology Co.,Ltd.

Address before: Room 1010, 10 / F, building a, Chuangzhi building, Xinjiang Software Park, 455 Kanas Hubei Road, Urumqi Economic and Technological Development Zone, 830000 Xinjiang Uygur Autonomous Region

Patentee before: XINJIANG AIHUA YINGTONG INFORMATION TECHNOLOGY Co.,Ltd.