Reply To: KeyA and KeyB and how to protect the contacless card from cloning?

Forum MIFARE general topics and applications KeyA and KeyB and how to protect the contacless card from cloning? Reply To: KeyA and KeyB and how to protect the contacless card from cloning?

Re: KeyA and KeyB and how to protect the contacless card from cloning?

19. February 2016 at 7:21
Hi @mifaresdk

One of the above post you mention the steps example as;

LoadKey( 1, FFFFFFFFFFFF )   // default key
LoadKey( 2, 1665FE2AE945 ) // your access key A
Authenticate( 4, 1 ) // authenticate to block 4 with key store 1 = default key
Write( 4, 58523376442200010000000000002153 ) // Write My_data1 and My_data3 to block 4
Write( 5, “es56fg87p4f2 ” ) // Write My_data2 to block 5 as ASCII bytes (with space chars at the end)
Write( 7, 1665FE2AE945XXXXXX003321FB75A356 ) // write to sector trailer the new keys
...
Authenticate( 4, 2 ) // authenticate to sector 1/block 4 with the new key A
Read( 4, ... ) // read the data back for verifying


My Question is that in first Authentication is for the block 4. Should I be need to authenticate blcok 5, 6 and 7 as well?
Before continue my coding I need to make sure that I am understand correctly.

Here is my steps:
    Default key is in 0 (0x00) New key in 1 (0x01)

    I need to write each data for different block


LoadKey( 0, FFFFFFFFFFFF )             // default key
LoadKey( 1, 1665FE2AE945 ) // your access key A
Authenticate( 4, 0 ) // authenticate to block 4 with key store 1 = default key
Authenticate( 5, 0 ) // authenticate to block 4 with key store 1 = default key
Authenticate( 6, 0 ) // authenticate to block 4 with key store 1 = default key
Write( 4, 58523376442200010000000000000000 ) // Write My_data1 to block 4
Write( 5, “es56fg87p4f2 ” ) // Write My_data2 to block 5 as ASCII bytes (with space chars at the end)
Write( 6, 21530000000000000000000000000000 ) // Write My_data3 to block 6
Write( 7, 1665FE2AE945XXXXXX003321FB75A356 ) // write to sector trailer the new keys
Authenticate( 4, 1 ) // authenticate to sector 1/block 4 with the new key A
Authenticate( 5, 1 ) // authenticate to sector 1/block 4 with the new key A
Authenticate( 6, 1 ) // authenticate to sector 1/block 4 with the new key A
Read( 4, ... ) // read the data back for verifying
Read( 5, ... ) // read the data back for verifying
Read( 6, ... ) // read the data back for verifying


Can you tell me that my steps are correct?

Kind Regards
+ 0  |  - 0