uint8_t state; // stores the status of the executed command
uint8_t aux[16]; // auxiliar buffer
uint8_t UID[4]; // stores the UID (unique identification) of a card
uint8_t keyA_old[6]; // stores the old key A
uint8_t keyA_new[6]; // stores the new key A
uint8_t keyB_new[6]; // stores the new key B
uint8_t config_new[4] = {0xFF, 0x07, 0x80, 0x00}; // same cfg
memset(keyA_old, 0xFF, 6); // the key by default, edit if needed
memset(keyA_new, 0x88, 6); // the new key A, edit if needed
memset(keyB_new, 0x99, 6); // the new key B, edit if needed
state = RFID13.init(UID, aux); // inits systems and look for cards
state = RFID13.setKeys(UID, keyA_old, keyA_new, keyB_new, config_new, aux, 2); //
// authenticates block 2, then writes the new trailer block, with new key A
// and B. The access bits are the same.