APDU Write block commands on mifare classic

不羁的心 提交于 2019-12-06 07:30:41

yes, You have to authenticate every sector before read/write on the block of that sector.Now you have execute Authentication command and you overwrite the block 3(sector trailer) that means the keys and access right has been change.

APDU For Authenticate a Block:-

The APDU format for Authenticate a block should be in following format.

CLA+ INS+ P1+ P2+ Lc+ (Version + AddMSB + AddLSB + KeyID + KeyNumber)

For Example :-

CLA = FF

INS = 86

P1 = 00

P2 = 01 (Block Number for Authentication)

Lc = 05 (Length of Data Field)

Data Field = Version + AddMSB + AddLSB + KeyId + KeyNumber

Version=01

AddMSB=00

AddLSB=05 (Block Number)

KeyID=60/61 (60 for keyA and 61 for keyB)

KeyNo= 00 (Key Slot number of reader)

FF 86 00 00 05 01 00 05 60 00

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!