Bonjour

Je rencontre un problème pour écrire sur un badge RFID.
Je dispose d'un lecteur ACR 122U, et je suis sous Mac OS.

Je suis parvenu à effectuer un dump de mon badge et à récupérer la clé, (enfin il me semble), donc je l'utilise pour effectuer le dump et il m'indique avoir bien trouvé la clé.

b_theo@UP Desktop % mfoc -k 415a54454b4d -O VIL_decrypte.mfd                                
The custom key 0x415a54454b4d has been added to the default keys
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): e7  70  46  83  
      SAK (SEL_RES): 88  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* SmartMX with MIFARE 1K emulation
Other possible matches based on ATQA & SAK values:
* Mifare Classic 1K Infineon

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '\' B key found, 'x' both keys found
[Key: 415a54454b4d] -> [........\\\\\\\.]
[Key: ffffffffffff] -> [xxxxxxxx\\\\\\\x]
[Key: a0a1a2a3a4a5] -> [xxxxxxxxxxxxxxxx]
[Key: d3f7d3f7d3f7] -> [xxxxxxxxxxxxxxxx]
[Key: 000000000000] -> [xxxxxxxxxxxxxxxx]
[Key: b0b1b2b3b4b5] -> [xxxxxxxxxxxxxxxx]
[Key: 4d3a99c351dd] -> [xxxxxxxxxxxxxxxx]
[Key: 1a982c7e459a] -> [xxxxxxxxxxxxxxxx]
[Key: aabbccddeeff] -> [xxxxxxxxxxxxxxxx]
[Key: 714c5c886e97] -> [xxxxxxxxxxxxxxxx]
[Key: 587ee5f9350f] -> [xxxxxxxxxxxxxxxx]
[Key: a0478cc39091] -> [xxxxxxxxxxxxxxxx]
[Key: 533cb6c723f6] -> [xxxxxxxxxxxxxxxx]
[Key: 8fd0a4f256e9] -> [xxxxxxxxxxxxxxxx]

Sector 00 -  FOUND_KEY   [A]  Sector 00 -  FOUND_KEY   [B]  
Sector 01 -  FOUND_KEY   [A]  Sector 01 -  FOUND_KEY   [B]  
Sector 02 -  FOUND_KEY   [A]  Sector 02 -  FOUND_KEY   [B]  
Sector 03 -  FOUND_KEY   [A]  Sector 03 -  FOUND_KEY   [B]  
Sector 04 -  FOUND_KEY   [A]  Sector 04 -  FOUND_KEY   [B]  
Sector 05 -  FOUND_KEY   [A]  Sector 05 -  FOUND_KEY   [B]  
Sector 06 -  FOUND_KEY   [A]  Sector 06 -  FOUND_KEY   [B]  
Sector 07 -  FOUND_KEY   [A]  Sector 07 -  FOUND_KEY   [B]  
Sector 08 -  FOUND_KEY   [A]  Sector 08 -  FOUND_KEY   [B]  
Sector 09 -  FOUND_KEY   [A]  Sector 09 -  FOUND_KEY   [B]  
Sector 10 -  FOUND_KEY   [A]  Sector 10 -  FOUND_KEY   [B]  
Sector 11 -  FOUND_KEY   [A]  Sector 11 -  FOUND_KEY   [B]  
Sector 12 -  FOUND_KEY   [A]  Sector 12 -  FOUND_KEY   [B]  
Sector 13 -  FOUND_KEY   [A]  Sector 13 -  FOUND_KEY   [B]  
Sector 14 -  FOUND_KEY   [A]  Sector 14 -  FOUND_KEY   [B]  
Sector 15 -  FOUND_KEY   [A]  Sector 15 -  FOUND_KEY   [B]  

We have all sectors encrypted with the default keys..

Auth with all sectors succeeded, dumping keys to a file!
Block 63, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  0f  ff  ff  ff  ff  ff  ff  
Block 62, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 61, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 60, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 59, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 58, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 57, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 56, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 55, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 54, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 53, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 52, type B, key 415a54454b4d :c7  6b  10  91  be  0f  bb  81  24  30  92  33  eb  13  63  0c  
Block 51, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 50, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 49, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 48, type B, key 415a54454b4d :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 47, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 46, type B, key 415a54454b4d :3f  29  e5  a8  26  7f  e0  c1  24  30  92  33  eb  13  63  0c  
Block 45, type B, key 415a54454b4d :24  30  92  33  eb  13  63  0c  a6  77  42  64  5d  4f  75  82  
Block 44, type B, key 415a54454b4d :e1  dc  23  c2  4e  d8  f3  20  05  9c  8a  de  a0  7c  91  45  
Block 43, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 42, type B, key 415a54454b4d :24  30  92  33  eb  13  63  0c  24  30  92  33  eb  13  63  0c  
Block 41, type B, key 415a54454b4d :83  eb  4d  c7  0d  c3  e6  3c  9f  4d  a2  dc  d5  12  15  9f  
Block 40, type B, key 415a54454b4d :24  30  92  33  eb  13  63  0c  25  8f  68  c0  e8  2e  3f  ed  
Block 39, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 38, type B, key 415a54454b4d :e1  dc  23  c2  4e  d8  f3  20  4b  17  72  87  be  7e  63  7b  
Block 37, type B, key 415a54454b4d :db  ef  d9  b3  14  3d  b7  5f  24  30  92  33  eb  13  63  0c  
Block 36, type B, key 415a54454b4d :30  a5  00  6d  b1  95  52  5e  d7  ff  3f  46  58  8f  0e  8f  
Block 35, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  ff  00  00  00  00  00  00  
Block 34, type B, key 415a54454b4d :3e  43  68  de  98  54  78  d0  ab  83  fd  b0  26  9d  6a  b7  
Block 33, type B, key 415a54454b4d :6a  49  5d  19  bc  67  ff  13  7c  e4  36  cb  7e  07  66  06  
Block 32, type B, key 415a54454b4d :16  2e  81  c5  de  df  c7  06  41  13  2a  7c  5d  d1  aa  99  
Block 31, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  87  ff  ff  ff  ff  ff  ff  
Block 30, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 29, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 28, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 27, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  96  ff  ff  ff  ff  ff  ff  
Block 26, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 25, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 24, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 23, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  a5  ff  ff  ff  ff  ff  ff  
Block 22, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 21, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 20, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 19, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  b4  ff  ff  ff  ff  ff  ff  
Block 18, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 17, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 16, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 15, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  c3  ff  ff  ff  ff  ff  ff  
Block 14, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 13, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 12, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 11, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  d2  ff  ff  ff  ff  ff  ff  
Block 10, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 09, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 08, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 07, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  e1  ff  ff  ff  ff  ff  ff  
Block 06, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 05, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 04, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 03, type A, key ffffffffffff :00  00  00  00  00  00  ff  07  80  f0  ff  ff  ff  ff  ff  ff  
Block 02, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 01, type A, key ffffffffffff :ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  
Block 00, type A, key ffffffffffff :e7  70  46  83  52  88  04  00  43  29  9d  ca  00  0a  0b  13  
En revanche, lorsque j'essaie d'écrire sur le badge, j'ai l'erreur suivante :

b_theo@UP Desktop % nfc-mfclassic w b VIL_20ctsdecrypte.mfd VIL_decrypte.mfd 
NFC reader: ACS / ACR122U PICC Interface opened
Found MIFARE Classic card:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
       UID (NFCID1): e7  70  46  83  
      SAK (SEL_RES): 88  
RATS support: no
Guessing size: seems to be a 1024-byte card
Writing 64 blocks |............................nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
nfc_initiator_transceive_bytes: Mifare Authentication Failed
!
Error: authentication failed for block 20
J'ai essayé avec le B, mais j'ai une erreur similaire. Sauriez-vous me dire où est mon erreur ?

Un grand merci !