hi all,

I'm having a hard time searching on how to read or write on a smart card? i have an acr120 contactless reader/writer as the input/output device. Please help.

Thank you.

Dani AI

Generated

Smart cards are not mass storage. You do not mount a MIFARE Classic card like a flash drive, and . With an ACR120 you talk to the card through the reader’s API, then authenticate and read/write specific blocks. ACR120 is an older, now end‑of‑life contactless reader that supports ISO/IEC 14443 Type A/B and MIFARE; use ACS’s Synchronous API or CT‑API for it, not CCID/PC/SC unless your model/driver explicitly exposes that. See ACS’s product and driver pages for capabilities and manuals. ACS ACR120 product and ACS ACR120 drivers/manuals (EOL notice).

Minimal workflow to store a student number on a MIFARE Classic 1K, building on what and discussed:

  1. Open the reader and poll for a card.
  2. Load the sector key (A or B) into the reader.
  3. Authenticate to the target sector.
  4. Read or write a data block, verify, and cleanly disconnect.

Example pseudo-flow:

reader.open()
uid = reader.poll()
reader.loadKey(keySlot, keyBytes)
reader.authenticate(sector, KeyA)     // or KeyB
data = reader.readBlock(block)        // or reader.writeBlock(block, bytes)
reader.close()

Gotchas that trip up beginners:

  • Memory layout matters. A 1K card has 16 sectors x 4 blocks (16 bytes each). Sector 0, block 0 is the manufacturer block (UID and card data) and is read‑only; block 3 of every sector is the sector trailer (keys and access bits). Only write to data blocks, not those two locations. NXP MIFARE Classic EV1 datasheet excerpt.
  • If your ACR120 does expose PC/SC on your system, you can use WinSCard (e.g., SCardConnect/SCardTransmit) to send commands; otherwise stick with ACS’s API for load‑key/auth/read/write. Microsoft SCardConnect docs.
  • Security note: do not store secrets on MIFARE Classic. Its Crypto1 scheme has been publicly broken since 2008; consider DESFire or protect data out‑of‑band. Reverse‑engineering Crypto1 (USENIX 2008) and NXP product info for Classic.

Recommended Answers

All 19 Replies

http://www.scdeveloper.com/Readers/ACR120.htm
Perhaps click on "SC Developer Resources" ?

Did you get any manual / guide / CD with it when you bought it?

hi salem,

thanks for the response. actually we did get a sample program/sdk. the thing is, this is the first time i'm going to use the technology so i'm still researching the basics. i thought i can treat it as a common flash drive where i can do a simple read/write process

Well, I'm just curious. But, whats wrong with just mounting the card onto the operating system and using the filesystem to read/write to it? Are you trying to do something fancy/more complicated with it?

nothing fancy. i only need to know how to write and read a simple code (like student number) on a mifare chip which was embedded on an id card. now i know that i have to login first at a certain sector and block before i can read or write on it in hexa or ascii format.

I got same problem to for this ACR120....plz help us

I got same problem to for this ACR120....plz help us

Did you read Salem's link?

commented: hai i am new user +0

Yup...but still need to discuss more detail..maybe you can give sample application/code that have done with this reader...more helpful..tq

it sedems on the entire net nobody want to share code for this... quite strange

Hi friends i am currently going on with this smartcard- Read/ Write

I would be VERY interested if anybody come up with a piece of code for red/write to a smart card....

brillox

Member Avatar for Member #429830

I would be VERY interested if anybody come up with a piece of code for red/write to a smart card....

brillox

Hi!
I'm lewix and i'm a smartcard software developer.
If you are still interested about an example to read/write a smartcard you can check my project site

SkyCard is my opensource application, written in C#, to handle T0/T1 smartcards and synchronous smartcards like Siemens SLE4428/SLE4442/SLE5528/SLE5542.
Any suggestion about improving my software is accepted! :)

Hi!
Lewix

Hi Lewix,

I am Italian too but I live in Scotland....

I am interested in the code; if I can get your private email address I can send to you my code as I managed to write an application, but I am unclear on APDU commands. Every tutorial that I find it makes me more confused :)

Massimo

hi all,

I'm having a hard time searching on how to read or write on a smart card? i have an acr120 contactless reader/writer as the input/output device. Please help.

Thank you.

hi..
if u want read & write on smart card based on ISO7816 standard.refer the iso7816-4 to ISO7816-9 standards in which the commands will be explained.

Hi,
I'm struggling with searching on how to read or write on a biometric card ? i have an smartec cid308 reader/writer as the input/output device. Please help.
Regards,
Rajesh

Fist u have to include ACS120.CS file in your aplication.
after that use ACS120_Open() u can pass ur port no here
then use ACS120_Select()
then user ACS120_Login() u have to pass sector no (0,15 for 1K card)
then user ACS120_Read(), ACS120_ReasdValue(),
ACS120Write(),ACS120WriteValue() functions by passing block No (0,2 for IK card)

There are 16 sectors in one 1k card
each sector have 4 blocks of each 16 byte
00,01,02,03
01 block of 01 sector is reserved for Manufacturer identification
03 block of each sector is reserved for trailr.
so do not write on these place
all the above functions can be fing in file which comes with SDK sample applications

hello,

ManojGarg can u send me an email address? I am new in this stuff and have no ideea about how to read/write smart cards. Maybe u can help me, thank you!

I want to knw maybe i can use MSR206 to write on a chip card? pls anyone to tell me suitble machine to write on chip card.

Can use to send/receive data, this reader is standard pcsc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.