开发者

Modify the access bits of the sector trailer Mifare Classic

开发者 https://www.devze.com 2023-03-17 00:00 出处:网络
how to Modif开发者_高级运维y the access bits of the sector trailer in Mifare Classic 1k. I want toauthenticate sector.Modifying access bits is carried out by the same methods as writing normal blocks.

how to Modif开发者_高级运维y the access bits of the sector trailer in Mifare Classic 1k. I want toauthenticate sector.


Modifying access bits is carried out by the same methods as writing normal blocks. You only aim at block 3 of the sector you want to alter access to. Taking into account the specs of the access bits present in block 3 of each sector (see chapter 8.7.1 from spec). A valid control bits combination along with the desired keys (A + B) must be specified (read/write operations on Mifare Classic Cards are performed at a block level basis).

For example if you want keyA-or-keyB-read operations available on any block of the sector and keyB-only-write permissions you can use a combination of [C1, C2, C3] = [0x78, 0x77, 0x88]. As you have to specify A and B keys (assuming all 0xAA for A key and all 0xBB por B key) the block data to write would be (take into consideration that byte 9 is unused):

byte authBlockData[] = {(byte) 0xAA, (byte) 0xAA, (byte) 0xAA, (byte) 0xAA,(byte) 0xAA, (byte) 0xAA, 0x78, 0x77, (byte) 0x88, 0x00, (byte) 0xBB,(byte) 0xBB,(byte) 0xBB,(byte) 0xBB,(byte) 0xBB,(byte) 0xBB};

0

精彩评论

暂无评论...
验证码 换一张
取 消