Reply To: MIFARE DESFire EV2 – how to encrypt data with custom key

Forum MIFARE general topics and applications MIFARE DESFire EV2 – how to encrypt data with custom key Reply To: MIFARE DESFire EV2 – how to encrypt data with custom key

Re: MIFARE DESFire EV2 – how to encrypt data with custom key

18. June 2020 at 10:21
Hi N0AGI,

There is no magic behind. With the first write access to one of the backup files, the write changes the mirror area of that file. You can change several files. With commitTransaction() all changes from all files are updated on the card.

// File 0x02 is a value file
debit(0x02, 5); // Decrease the account by $5

// File 0x03 is linear record file
byte[] byRec = new byte[REC_SIZE] { … };
writeRecord(0x03, REC_SIZE, byRec);

commitTransaction();


If you find out (before commitTransaction() will be called ) that the changes should not be made, you call abortTransaction(). This invalidates all changes, but you are still connected and authenticated.

The TapLinx team
+ 0  |  - 0