+ len = mifare_sendcmd(0x1B, key, sizeof(key), resp, respPar, NULL);\r
+\r
+ if (len != 4) {\r
+ if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Cmd Error: %02x %u", resp[0], len);\r
+ return 0;\r
+ }\r
+\r
+ if (MF_DBGLEVEL >= MF_DBG_EXTENDED)\r
+ Dbprintf("Auth Resp: %02x%02x%02x%02x", resp[0],resp[1],resp[2],resp[3]);\r
+\r
+ memcpy(pack, resp, 4);\r
+ return 1;\r
+}\r
+\r
+int mifare_ultra_auth(uint8_t *keybytes){\r
+\r
+ /// 3des2k\r
+ uint8_t random_a[8] = {1,1,1,1,1,1,1,1};\r
+ uint8_t random_b[8] = {0x00};\r
+ uint8_t enc_random_b[8] = {0x00};\r
+ uint8_t rnd_ab[16] = {0x00};\r
+ uint8_t IV[8] = {0x00};\r
+ uint8_t key[16] = {0x00};\r
+ memcpy(key, keybytes, 16);\r
+\r
+ uint16_t len = 0;\r
+ uint8_t resp[19] = {0x00};\r
+ uint8_t respPar[3] = {0,0,0};\r
+\r
+ // REQUEST AUTHENTICATION\r
+ len = mifare_sendcmd_short(NULL, 1, 0x1A, 0x00, resp, respPar ,NULL);\r