Smart card Mifare 1k keys

做~自己de王妃 提交于 2020-04-30 10:20:06

问题


Following some example I can read all blocks of sector 0 of a Mifare 1K card with the following commands:

  • Load Authentication Keys
  • Authentication
  • Read Binary Blocks

For the first command I used a key of FF FF FF FF FF FF. When I try to read block 4 (sector 1) I get an access denied error. I suppose it is due to the fact that sector has a non default key. Is it correct ?

I'm not familiar with smart cards, the one I'm testing is for logging access to workplace, I (erroneously ?) thought it was as simple as a single read. All I need is the 6 digit code stamped on the card. I now suspect I have to know the key before accessing the information on the card.

Besides I thought there was a standard for Mifare 1K adpu.

According to documentation on internet the error condition is Sw1 = 0x63 but according to my specific reader manual (AccessIs ATR210) it is Sw1 = 0x69. There are major differences in the adpu command too and it is confusing for me.


回答1:


Mifare and smart cards are different, only the latter understand APDUs. For the former the reader translates a pseudo-APDU to the respective command, therefore the reader or its driver may require different bytes.

If the card you describe is used for a real world application, then a key different from the default is the very minimum one has to do to maintain the low MIFARE classic security. Besides a different value, the read access may not be possible using key A at all, see the data sheet, section 8.7.2.

I have no idea, what is stamped on your card, but 6 digits are less than the key value, which requires 6 bytes. Just the key value(s), i. e. for key A and B will allow you to access everything possibly restricted by the configured access bits.



来源:https://stackoverflow.com/questions/56538255/smart-card-mifare-1k-keys

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