智能卡基础知识Desfire卡

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

= cead373db80eabf82f898a9e9d073351
> afcead373db80eabf82f898a9e9d073351 < 00 = 70801
11 PCD prepare Rnd A
= 60708
12 PCD compares sent and Received Rnd A = 60708?60708
三、Desfire卡应用及文件介绍
1、Desfire卡存储应用及文件介绍
• Desfire卡存储是由应用和文件组成的。
• 不同的应用可以代表不同使用的场景。存储空间允许的情 况下可以创建多个应用,满足多种用途。
• 每个应用下可以创建多个文件,分为标准文件、备份文件、 循环文件、值文件。
• 标准文件可存储固定数据,备份文件存储需要更改的一般 存储数据,循环文件存储历史记录文件,值文件存储数值 用于钱包应用。
4、文件初始化读写数据
1、选中应用001 2、用文件1对应的Key,进行认证 3、读写文件1 4、对文件2、文件3、文件4、文件5操作仿照“2”到“3”过程 5、存在改写备份文件3、钱包文件4、循环文件5文件内容, 写卡完毕后,发C7指令完成真正写卡
智能卡基础知识-Desfire
内容概要
一、Desfire卡识别 二、Desfire卡存储结构举例 三、Desfire卡应用及文件介绍 四、Desfire卡认证与指令 五、Desfire卡主要操作指令时序
一、Desfire卡识别
如何识别出Desfire卡?
Desfire卡属于TPYE A卡。 可以通过ATQA编码识别:
the current authentication
has been performed in native
TDES mode
8 Send Change key Command
> C4808158047d2c2213ca303b75e1ec4b84eb604fc314f32c40b
6
9 Response of the card
APP AID
1
2
3
1
4
5
...
1
2
2
3
...
...
Size 32 Bytes 64 Bytes 32 Bytes 6*16 Bytes 4 Bytes
Standard Data File Standard Data File Backup Data File Cyclic Record File
Value File
authenticated with the
session key
application master key (key
nr 0x00),and the session key
5 CRC16 of (New key and version)= 7545 CRC16 is calculated on0)
= b45cb55ef80f054f = b45cb55ef80f054f60708
7 DESFire Native enciphered ek(RndA + RndB’)
8 PCD’s response and it’s own Challenge
9 PICC’s response
10 Rnd A (Ek(Rnd A) is deciphered
0200:M1 S70 4K 0400:M1 S50 1K 0800:CPU 4403:DESFire android.nfc.tech.NfcA类中getAtqa()方法获取。 (ATQA共有16位,根据bit7和bit8来判断是几级UID)
二、Desfire卡存储结构举例
Desfire卡存储结构举例
2、白卡改变key过程
1、寻卡选卡 2、Native TDES认证 3、Native TDES格式的key改为AES格式 key 4、AES卡级的主密钥(PMK)认证 5、格式化卡片
Native TDES 认证过程
Key number:0x00 Key:0000000000
Step
Fra Baidu bibliotek
Command
1 Initiating authentication Command by PCD > 0a00
Data message
2 PICC 3 Rnd B (Ek(Rnd B) isdeciphered)
< = 4fb45cb55ef80f05
4 PCD generates RndA
= 60708
5 PCD prepares RndB’ 6 RndA + RndB’
13 Generate session key*
= 0203044fb45cb5010203044fb45cb5
改变TDES 为AES认证
step
command
Data message
1 Key number to change
= 80(master key is key number 0,but for AES type two
MS bits are set to 10b)
2 New key value will be
= 0000000000
3 Key version of the new Key = 00,key version is only required for AES key type
4 Currently the application = 010203044fb45cb5010203044fb45cb5DESFire native TDES
6 5 byte (0000000000)Padding is = 0000
added to make multiple of 8
byte
7 DESFire native enciphering as = 8158047d2c2213ca303b75e1ec4b84eb604fc314f32c40b6
< 00
session key:010203044fb45cb5010203044fb45cb5
3、白卡创建应用、文件过程
1、选中应用000 2、创建应用001、002(设置AID、KeySettings、NumOfKeys) 3、选中应用001 4、用卡主密钥(PMK),进行AES认证 5、更改应用001的AMKey ,key全改 6、创建标准文件1 7、创建标准文件2 8、创建备份文件3 9、创建钱包文件4 10、创建循环文件5 11、选中应用002(循环“4”到“10”,根据卡存储结构创建文件)
相关文档
最新文档