简体   繁体   English

使用libnfc格式化/读取/写入NDEF Mifare 1K卡

[英]Format/Read/Write NDEF Mifare 1K Card using libnfc

I am new to NFC and I want to learn more about this, so I bought a PN532 NFC shield from Adafruit and a couple of Mifare 1K Card. 我是NFC的新手,我想学习更多有关此的知识,因此我从Adafruit和几张Mifare 1K卡购买了PN532 NFC防护罩。

Now I have installed successfully Libnfc on Windows 8 and it works fine, I can use nfc-list. 现在,我已经在Windows 8上成功安装了Libnfc,并且工作正常,我可以使用nfc-list。

I have tried to install libfreefare but I have errors (I have posted a topic on that) 我尝试安装libfreefare,但出现错误(我在此发布了一个话题)

But I really need to be able to format cards to NDEF, and to read and write NDEF data on a MIFARE Classic 1K card. 但是我确实需要能够将卡格式化为NDEF,并在MIFARE Classic 1K卡上读写NDEF数据。

Does anyone know how to do so? 有人知道怎么做吗? Is it possible to use the libnfc.dll to do so? 可以使用libnfc.dll这样做吗? Does anyone have exemple or tutorial on this? 有人对此有示例或教程吗?

For security matters, is it better to have DESFire 4k or 8k instead of MIFARE Classic 1k in order to be sure that my card is secure (can not be overwritten)? 为了安全起见,最好使用DESFire 4k或8k而不是MIFARE Classic 1k来确保我的卡安全(不能被覆盖)吗?

Yes, you can use libnfc for that purpose. 是的,您可以将libnfc用于此目的。 For an example of how to accesws MIFARE Classic cards see 有关如何访问MIFARE Classic卡的示例,请参见

With regard to formatting MIFARE Classic cards with NDEF data, I suggest that you have a look at the application note from NXP on this topic: 关于使用NDEF数据格式化MIFARE Classic卡,建议您阅读NXP关于该主题的应用笔记:

For security matters, is it better to have DESFire 4k or 8k instead of MIFARE Classic 1k in order to be sure that my card is secure (can not be overwritten)? 为了安全起见,最好使用DESFire 4k或8k而不是MIFARE Classic 1k来确保我的卡安全(不能被覆盖)吗?

Right. 对。 MIFARE Classic security is know to be completely broken since 2008/2009. 自2008/2009年以来,MIFARE Classic安全性已被完全打破。 This means that, 这意味着,

  • Anyone can easily find the access keys for your card. 任何人都可以轻松找到您卡的访问密钥。 All an attacker needs for this is the card. 攻击者为此所需要的只是卡。
  • Anyone can read your card regardless of what access keys you set (though using it as NDEF tag implies that you want to have it world-readable anyways). 无论您设置了什么访问密钥,任何人都可以读取您的卡(尽管将其用作NDEF标签意味着您无论如何都希望它可以被全世界读取)。
  • Unless you permanently write protect all sectors of your card (this means that you set the access conditions in a way that no block can be written with any access key), an attacker can easily overwrite any data. 除非您对卡的所有扇区进行永久性写保护(这意味着您以某种方式设置访问条件,使得任何访问密钥都不能写入任何块),否则攻击者可以轻松覆盖任何数据。 Depending on your requirements, digital signatures/cryptographic checksums may be suitable to overcome this issue. 根据您的要求,数字签名/密码校验和可能适合解决此问题。
  • It's rather easy to create perfect clones of MIFARE Classic cards. 创建MIFARE Classic卡的完美克隆非常容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM