CN109872426B - IC card encryption and authentication method and system - Google Patents

IC card encryption and authentication method and system Download PDF

Info

Publication number
CN109872426B
CN109872426B CN201910121067.3A CN201910121067A CN109872426B CN 109872426 B CN109872426 B CN 109872426B CN 201910121067 A CN201910121067 A CN 201910121067A CN 109872426 B CN109872426 B CN 109872426B
Authority
CN
China
Prior art keywords
card
registration
ciphertext
verification
sector
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
CN201910121067.3A
Other languages
Chinese (zh)
Other versions
CN109872426A (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.)
GUANGZHOU VIDEO-STAR ELECTRONICS CO LTD
Original Assignee
GUANGZHOU VIDEO-STAR ELECTRONICS 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 GUANGZHOU VIDEO-STAR ELECTRONICS CO LTD filed Critical GUANGZHOU VIDEO-STAR ELECTRONICS CO LTD
Priority to CN201910121067.3A priority Critical patent/CN109872426B/en
Publication of CN109872426A publication Critical patent/CN109872426A/en
Application granted granted Critical
Publication of CN109872426B publication Critical patent/CN109872426B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an IC card encryption and authentication method and system, wherein the method comprises the following steps: when the IC card is encrypted, the card swiping device reads the card number of the IC card and generates a registration ciphertext, writes the registration ciphertext into a sector of the IC card corresponding to a randomly generated registration sector number, and stores the card number and the registration sector number in a local memory in an associated manner; when the IC card is authenticated, the card swiping device reads the card number of the IC card, and sends an authentication request with a verification ciphertext to the IC card after the card number is inquired and registered; the IC card inquires a registration ciphertext of a corresponding sector of the IC card according to the registration sector number, and feeds back a verification success instruction to the card swiping device when the verification of the registration ciphertext is consistent with that of a verification ciphertext; and the card swiping device controls the unlocking and releasing of the access control device according to the verification success command. The invention adds cipher text verification in the IC card registration and authentication process, effectively prevents the entrance guard IC card from being copied and embezzled, thereby effectively improving the reliability and safety of entrance guard management.

Description

IC card encryption and authentication method and system
Technical Field
The invention relates to the technical field of information security management, in particular to an IC card encryption and authentication method and system.
Background
When the traditional access control system verifies an access control IC card, only the card number of the IC card is read for verification, card swiping unlocking can be realized when the card number verification is successful, lawless persons can manufacture copied access control cards by copying the card number by using an empty card, and other non-registered persons can also realize card swiping passing by using the copied access control cards, so that the access control management has larger security loophole, and the management reliability and the security of the access control system are lower.
Disclosure of Invention
The embodiment of the invention provides an IC card encryption and authentication method and system, which are used for solving the technical problem that the existing entrance guard IC card can be easily copied and stolen to cause security management loopholes, so that the encryption and authentication method of the entrance guard IC card is optimized, and the security of entrance guard management is improved.
In order to solve the above technical problem, an embodiment of the present invention provides an IC card encryption method, which is executed by a card swiping device, and at least includes the following steps:
reading the card number of the IC card and generating a registration ciphertext according to the card number;
randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number;
and storing the card number and the registration sector number in a local memory in an associated manner.
Preferably, the registration ciphertext is obtained by performing MD5 calculation according to the card number.
Preferably, the IC card is a contactless IC card.
In order to solve the same technical problem, the invention also provides an IC card authentication method, comprising:
the card swiping device reads the card number of the IC card, and sends an authentication request to the IC card when a registration sector number associated with the card number of the IC card is inquired and stored in a local memory; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
the IC card inquires the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be consistent with the registration ciphertext, a verification success instruction is fed back to the card swiping device;
and after the card swiping device receives the verification success command, controlling the unlocking and releasing of the access control device.
Preferably, the verification ciphertext is obtained by performing MD5 calculation according to the card number of the IC card.
Further, the IC card authentication method further includes:
and the IC card inquires the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be inconsistent with the registration ciphertext, a verification failure instruction is fed back to the card swiping device.
Preferably, the IC card is a contactless IC card.
In order to solve the same technical problem, the invention also provides an IC card encryption and authentication system, which comprises a card swiping device, an IC card and an access control device; wherein the content of the first and second substances,
the card swiping device is used for reading the card number of the IC card when the IC card is encrypted and generating a registration ciphertext according to the card number; randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number; storing the card number and the registration sector number in a local memory in an associated manner; the system comprises an IC card, an access control device and a local memory, wherein the IC card is used for reading the card number of the IC card when the IC card is authenticated, sending an authentication request to the IC card when a registration sector number associated with the card number of the IC card is inquired and stored in the local memory, and controlling the access control device to unlock and release after receiving a verification success instruction fed back by the IC card; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
and the IC card is used for inquiring the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and feeding back a verification success instruction to the card swiping device when the verification ciphertext is judged to be consistent with the registration ciphertext.
Preferably, the registration ciphertext and the verification ciphertext are obtained by performing MD5 calculation according to the card number of the IC card; the IC card is a non-contact IC card.
The invention effectively prevents the existing entrance guard IC card from being easily copied and stolen by writing in the ciphertext during the registration of the IC card and verifying the ciphertext on the IC card in the card swiping authentication process, thereby effectively improving the reliability and the safety of entrance guard management.
Drawings
Fig. 1 is a schematic flow chart of an IC card encryption method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an IC card authentication method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a card swiping device according to a first embodiment of the present invention;
fig. 4 is a schematic diagram of a sector structure of an IC card according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying 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 making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides an IC card encryption method, which is executed by a card swiping device, and at least includes the following steps:
step S210, reading a card number of the IC card, and generating a registration ciphertext according to the card number;
in the embodiment of the present invention, it should be noted that a user needs to register an IC card through a card swiping device in an access control system. In the encryption process of the IC card, namely when the entrance guard IC card is registered, the MCU in the card swiping device firstly reads the card number of the IC card through the radio frequency chip, and then the card number is subjected to encryption operation to obtain a registration ciphertext.
Step S220, randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number;
in the embodiment of the present invention, it should be noted that the card swiping device randomly generates a sector number that the registration password needs to be stored, and writes the registration ciphertext into the corresponding sector of the IC card according to the generated sector number.
Referring to fig. 4, it can be understood that the IC card has 16 sectors, each sector having 4 blocks, wherein 0 block of the 1 st sector is a card serial number, and is read-only and cannot be written; the cipher text is stored in block 3 of each sector.
Step S230, storing the card number and the registration sector number in a local memory in an associated manner.
In the embodiment of the present invention, it should be noted that the MCU of the card swiping device needs to store the registration information of the IC card in the local memory in an associated manner, where the registration information includes the card number and the registration sector number.
Referring to fig. 3, the card swiping device mainly comprises a main control chip, a memory and a radio frequency chip.
In the embodiment of the present invention, as a preferable scheme, the registration ciphertext is obtained by performing MD5 calculation according to the card number.
In the embodiment of the present invention, preferably, the IC card is a contactless IC card.
It is understood that the IC card is a card form in which a microelectronic chip is embedded in a card base conforming to the ISO7816 standard. The communication mode between the IC card and the reader-writer can be contact type or non-contact type; it should be noted that, as a preferable aspect, the IC card in the embodiment of the present invention is a contactless IC card.
It should be noted that, the traditional access control IC card reading system only realizes verification of the IC card number, and when the card is swiped, the card number of the IC card is verified to be registered, that is, unlocking is realized, and lawless persons can easily realize the function of swiping the card to unlock by copying the card number by using an empty card or by using an analog card. By the IC card encryption and authentication method provided by the invention, when the card is verified and swiped, the system not only checks the card number, but also adds the function of checking the sector password of the IC card on the basis of the card number, thereby effectively preventing the use phenomenon of copying the simulated IC card.
The invention effectively prevents the existing entrance guard IC card from being easily copied and stolen by writing in the ciphertext during the registration of the IC card and verifying the ciphertext on the IC card in the card swiping authentication process, thereby effectively improving the reliability and the safety of entrance guard management.
In the embodiment of the present invention, it should be noted that a user needs to register an IC card through a card swiping device in an access control system. In the encryption process of the IC card, namely when the entrance guard IC card is registered, the MCU in the card swiping device firstly reads the card number of the IC card through the radio frequency chip, and then obtains a registration ciphertext through encryption operation of the card number, wherein the encryption operation can be MD5 calculation; then the MCU generates random numbers (1-16), then the MCU writes the registration ciphertext into a block 3 of a corresponding sector of the IC card according to the generated random numbers, and simultaneously the MCU stores the card number and the sector number of the random password, thereby completing the encryption process of the IC card. It can be understood that the door entry system includes an intercom main control MCU chip and a radio frequency chip RC 522. When the IC card is swiped to contact with the radio frequency card chip, the encryption and authentication processes of the IC card are realized by means of communication between the radio frequency chip and the master control MCU chip.
Referring to fig. 2, in order to solve the same technical problem, the present invention further provides an IC card authentication method, including:
step S310, the card swiping device reads the card number of the IC card, and when a registration sector number associated with the card number of the IC card is stored in a local memory, an authentication request is sent to the IC card; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
in the embodiment of the invention, it should be noted that, in the authentication process of the IC card, that is, when a user swipes the card in response, the MCU of the door access card swiping device first reads the card number of the IC card through the radio frequency chip, and obtains a verification ciphertext through the MD5 calculation of the card number, and then determines whether the card number is registered, and when the card number is not queried in the local memory, it indicates that the card is not registered, and feeds back a reminder of card swiping failure; when the card number is inquired to be registered, the registration password storage sector number of the IC card is inquired through the associated registration information, then the MCU sends the verification ciphertext to the IC card through the radio frequency chip, and requests to verify the registration ciphertext of the corresponding sector.
Step S320, the IC card inquires a registration ciphertext of a corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be consistent with the registration ciphertext, a verification success instruction is fed back to the card swiping device;
in the embodiment of the invention, when the IC card receives the verification request, the internal part of the IC card chip compares whether the verification ciphertext sent by the card swiping device is consistent with the registration ciphertext of the corresponding sector, if so, the verification is successfully returned, and if not, the verification is failed in feedback.
And S330, after the card swiping device receives the verification success command, controlling the unlocking and releasing of the access control device.
In the embodiment of the present invention, it should be noted that when the card swiping device receives the verification success command returned by the IC card, the door access device is controlled to unlock and release, otherwise, an illegal card is prompted.
In the embodiment of the present invention, as a preferable scheme, the verification ciphertext is obtained by performing MD5 calculation according to the card number of the IC card.
In the embodiment of the present invention, further, the IC card authentication method further includes:
and the IC card inquires the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be inconsistent with the registration ciphertext, a verification failure instruction is fed back to the card swiping device.
In the embodiment of the present invention, preferably, the IC card is a contactless IC card.
In order to solve the same technical problem, the invention also provides an IC card encryption and authentication system, which comprises a card swiping device, an IC card and an access control device; wherein the content of the first and second substances,
the card swiping device is used for reading the card number of the IC card when the IC card is encrypted and generating a registration ciphertext according to the card number; randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number; storing the card number and the registration sector number in a local memory in an associated manner; the system comprises an IC card, an access control device and a local memory, wherein the IC card is used for reading the card number of the IC card when the IC card is authenticated, sending an authentication request to the IC card when a registration sector number associated with the card number of the IC card is inquired and stored in the local memory, and controlling the access control device to unlock and release after receiving a verification success instruction fed back by the IC card; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
and the IC card is used for inquiring the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and feeding back a verification success instruction to the card swiping device when the verification ciphertext is judged to be consistent with the registration ciphertext.
In the embodiment of the present invention, as a preferred scheme, the registration ciphertext and the verification ciphertext are both obtained by performing MD5 calculation according to the card number of the IC card; the IC card is a non-contact IC card.
In summary, the method and system for encrypting and authenticating the IC card provided by the embodiment of the present invention effectively prevent the existing access control IC card from being easily copied and stolen by writing the ciphertext during the registration of the IC card and verifying the ciphertext during the card swiping authentication, thereby effectively improving the reliability and security of the access control management.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (7)

1. An IC card encryption and authentication method is executed by a card swiping device and is characterized by at least comprising the following steps:
reading the card number of the IC card and generating a registration ciphertext according to the card number;
randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number;
storing the card number and the registration sector number in a local memory in an associated manner;
the card swiping device reads the card number of the IC card, and sends an authentication request to the IC card when a registration sector number associated with the card number of the IC card is inquired and stored in a local memory; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
the IC card inquires the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be consistent with the registration ciphertext, a verification success instruction is fed back to the card swiping device;
and after the card swiping device receives the verification success command, controlling the unlocking and releasing of the access control device.
2. The IC card encryption and authentication method according to claim 1, wherein the registration cryptogram is calculated from the card number by MD 5.
3. The IC card encryption and authentication method according to claim 1, wherein the IC card is a contactless IC card.
4. The IC card encryption and authentication method according to claim 1, wherein the verification ciphertext is calculated by MD5 based on a card number of the IC card.
5. The IC card encryption and authentication method according to claim 1, further comprising:
and the IC card inquires the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and when the verification ciphertext is judged to be inconsistent with the registration ciphertext, a verification failure instruction is fed back to the card swiping device.
6. An IC card encryption and authentication system is characterized by comprising a card swiping device, an IC card and an access control device; wherein the content of the first and second substances,
the card swiping device is used for reading the card number of the IC card when the IC card is encrypted and generating a registration ciphertext according to the card number; randomly generating a registration sector number, and writing the registration ciphertext into a sector of the IC card corresponding to the registration sector number; storing the card number and the registration sector number in a local memory in an associated manner; the system comprises an IC card, an access control device and a local memory, wherein the IC card is used for reading the card number of the IC card when the IC card is authenticated, sending an authentication request to the IC card when a registration sector number associated with the card number of the IC card is inquired and stored in the local memory, and controlling the access control device to unlock and release after receiving a verification success instruction fed back by the IC card; the authentication request comprises the registration sector number and a verification ciphertext generated according to the card number of the IC card;
and the IC card is used for inquiring the registration ciphertext of the corresponding sector of the IC card according to the registration sector number, and feeding back a verification success instruction to the card swiping device when the verification ciphertext is judged to be consistent with the registration ciphertext.
7. The IC card encryption and authentication system according to claim 6, wherein the registration ciphertext and the verification ciphertext are both calculated according to the card number of the IC card by MD 5; the IC card is a non-contact IC card.
CN201910121067.3A 2019-02-18 2019-02-18 IC card encryption and authentication method and system Active CN109872426B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910121067.3A CN109872426B (en) 2019-02-18 2019-02-18 IC card encryption and authentication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910121067.3A CN109872426B (en) 2019-02-18 2019-02-18 IC card encryption and authentication method and system

Publications (2)

Publication Number Publication Date
CN109872426A CN109872426A (en) 2019-06-11
CN109872426B true CN109872426B (en) 2021-12-10

Family

ID=66918807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910121067.3A Active CN109872426B (en) 2019-02-18 2019-02-18 IC card encryption and authentication method and system

Country Status (1)

Country Link
CN (1) CN109872426B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111144520B (en) * 2019-12-10 2023-09-29 惠州拓邦电气技术有限公司 IC card read-write method and device, storage medium and intelligent lock
CN113034743A (en) * 2021-03-03 2021-06-25 台铃科技(江苏)股份有限公司 Electric bicycle with NFC intelligence unblock function
CN113065367B (en) * 2021-03-29 2022-08-26 新疆爱华盈通信息技术有限公司 IC card reading method, IC card reading device, electronic device, and storage medium
CN113517978A (en) * 2021-07-16 2021-10-19 安徽伊普诺康生物技术股份有限公司 Safety protection and reuse method for reagent card of in-vitro diagnostic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001313636A (en) * 2000-04-28 2001-11-09 Sony Corp Authentication system, authenticating method and authenticating device and method
CN102801730B (en) * 2012-08-16 2015-01-28 厦门市美亚柏科信息股份有限公司 Information protection method and device for communication and portable devices
CN103116922B (en) * 2013-01-15 2015-05-20 杭州易和网络有限公司 Networking management system and management method for wireless gate lock
CN108280504A (en) * 2017-01-06 2018-07-13 广州市西迈信息科技有限公司 The anti-copying encrypted method of access control system IC card

Also Published As

Publication number Publication date
CN109872426A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN109872426B (en) IC card encryption and authentication method and system
US10467832B2 (en) Configurable digital badge holder
US20080120726A1 (en) External storage device
US20080189772A1 (en) Method for generating digital fingerprint using pseudo random number code
US20130290191A1 (en) Method of transferring access rights to a service from one device to another
CN104583026A (en) One-way key fob and vehicle pairing verification, retention, and revocation
WO2018045916A1 (en) Authorization method, system, and card
EP2175428B1 (en) Semiconductor element, biometric authentication method and biometric authentication system
CN105959277A (en) Method of locking/unlocking computer screen based on NFC terminal
JP3913363B2 (en) Recording medium delivery method, issuing system and components thereof
US20040165413A1 (en) Memory device
CN105608775A (en) Authentication method, terminal, access control card and SAM card
JP2003046499A (en) Communication system, user terminal, ic card, authentication system, and control system and program for access and communication
CN103838997A (en) Single-chip microcomputer password verification method and device
CN112241633B (en) Bidirectional authentication implementation method and system for non-contact smart card
CN104680054A (en) RFID (radio frequency identification devices) data processing method
JP5283432B2 (en) Authentication device, mobile terminal, electric key system, and authentication control method
US20160078235A1 (en) Device and management module
JP4760124B2 (en) Authentication device, registration device, registration method, and authentication method
CN107346383B (en) authorization method and system
JP2015203909A (en) contact IC card activation system and method
CN104598947B (en) A kind of electronic tag data processing method
US7644277B2 (en) Electronic key information system
US20180294970A1 (en) Methods of affiliation, emancipation and verification between a tutor and tutee
CN110992533B (en) RFID card verification method, device, equipment and storage medium

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 510730 Room 601 of No.6 Workshop, No.9 Lanyu Fourth Street, Guangzhou Economic and Technological Development Zone, Guangdong Province

Patentee after: Guangzhou visual sound intelligent technology Co.,Ltd.

Address before: 510000 Room 601, plant 6, No. 9, Lanyu 4th Street, Guangzhou Economic and Technological Development Zone, Guangdong Province

Patentee before: GUANGZHOU VIDEO-STAR ELECTRONICS Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 510730 Room 601 of No.6 Workshop, No.9 Lanyu Fourth Street, Guangzhou Economic and Technological Development Zone, Guangdong Province

Patentee after: GUANGZHOU VIDEO-STAR ELECTRONICS Co.,Ltd.

Address before: 510730 Room 601 of No.6 Workshop, No.9 Lanyu Fourth Street, Guangzhou Economic and Technological Development Zone, Guangdong Province

Patentee before: Guangzhou visual sound intelligent technology Co.,Ltd.