MifarePlus卡如何從level1切換到level3
摘要
MifarePlus卡,SL1,SL3
MifarePlus Level3的數(shù)據(jù)及密鑰存儲(chǔ)結(jié)構(gòu)和Mifareone有所區(qū)別,結(jié)構(gòu)如下:

| 塊相對(duì)地址 | 塊地址 | AES對(duì)應(yīng)密鑰塊地址 | ||
| Sector0 | ||||
| Block0 | 數(shù)據(jù)塊 | 0x0000 | A密鑰:0x4000 B密鑰:0x4001 | |
| Block1 | 數(shù)據(jù)塊 | 0x0001 | ||
| Block2 | 數(shù)據(jù)塊 | 0x0002 | ||
| Block3 | Level1 :KeyA+KeyB, Level3: data+config | 0x0003 | ||
| Sector1 | ||||
| Block0 | 數(shù)據(jù)塊 | 0x0004 | A密鑰:0x4002 B密鑰:0x4003 | |
| Block1 | 數(shù)據(jù)塊 | 0x0005 | ||
| Block2 | 數(shù)據(jù)塊 | 0x0006 | ||
| Block3 | Level1 :KeyA+KeyB, Level3: data+config | 0x0007 | ||
| …. | ||||
| Sector31 | ||||
| Block0 | 數(shù)據(jù)塊 | 0x007C | A密鑰:0x403E B密鑰:0x403F | |
| Block1 | 數(shù)據(jù)塊 | 0x007D | ||
| Block2 | 數(shù)據(jù)塊 | 0x007E | ||
| Block3 | Level1 :KeyA+KeyB, Level3: data+config | 0x007F | ||
| Sector32 | ||||
| Block0 | 數(shù)據(jù)塊 | 0x80 | A密鑰:0x4040 B密鑰:0x4041 | |
| Block1 | 數(shù)據(jù)塊 | 0x81 | ||
| … | 數(shù)據(jù)塊 | … | ||
| Block15 | Level1 :KeyA+KeyB, Level3: data+config | 0x8F | ||
| … | ||||
| Sector39 | ||||
| Block0 | 數(shù)據(jù)塊 | 0xF0 | A密鑰:0x404EB密鑰:0x404F | |
| Block1 | 數(shù)據(jù)塊 | 0xF1 | ||
| … | 數(shù)據(jù)塊 | … | ||
| Block15 | Level1 :KeyA+KeyB, Level3: data+config | 0xFF | ||
| 配置塊 | ||||
| MFP Configuration Block | 0xB000 | |||
| Installation Identifier | 0xB001 | |||
| ATS Information | 0xB002 | |||
| Field Configuration Block | 0xB003 | |||
| Key 塊 | ||||
| AES Sector Keys | 0x4000~0x403F | |||
| AES Sector Keys | 0x4040~0x404F | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Originality Key | 0x8000 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Card Master Key | 0x9000 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Card Configuration Key | 0x9001 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Level2 switch Key | 0x9002 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Level3 switch Key | 0x9003 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| SL1 Card Authentication Key | 0x9004 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Select VC Key | 0xA000 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| Proximity Check Key | 0xA001 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| VC Polling ENC Key | 0xA080 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
| VC Polling MAC Key | 0xA081 | 默認(rèn)值FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | ||
注意:
1、 藍(lán)色和黃色部分是關(guān)聯(lián)部分。即數(shù)據(jù)區(qū)和密鑰區(qū)對(duì)應(yīng)部分(僅僅是在Level 2/3才對(duì)應(yīng),因只有級(jí)別2/3才使用到AES密鑰認(rèn)證)。
2、 在安全級(jí)別Level 1,是和Mifare classic 兼容的,每個(gè)扇區(qū)最后一塊為密鑰和配置塊。
3、 AES 密鑰分為A/B密鑰是人為劃分,是為了同Mifare classic 概念相同。在PLUS內(nèi)部一個(gè)扇區(qū)是對(duì)應(yīng)地址連續(xù)的AES密鑰塊。
4、 主要掌握如下key:
AES Sector Keys:
在Level2/3 中對(duì)數(shù)據(jù)的授權(quán)采用AES Key授權(quán)。該密鑰可以在Level0寫入。
CardMasterKey:
通過(guò)對(duì)該Key的授權(quán),可以改變Card Configuration Key和Level2/3 switch Key
Card Configuration Key:
通過(guò)對(duì)該key的授權(quán),可以改變MFP Configuration Block配置塊內(nèi)容。
Level2 switch Key:
通過(guò)對(duì)該key的授權(quán),可以從Level1切換Level2。
Level3 switch Key:
通過(guò)對(duì)該key的授權(quán),可以從Level2切換Level3,或從Level1切換到Level3。
5、 在Level0,除了出廠寫入的用戶不能修改的密鑰外,都可以以明文方式寫入,一般在Level0做初始化操作。注意,必須在該安全級(jí)別寫入0x9000~0x9003塊。
6、 Level3 級(jí)別支持明文、AES加密、加密且?guī)AC方式讀寫方式。本讀卡器采用的是最保密的方式讀寫MifarePlus塊:加密且?guī)AC方式。

