RFID verifying if right key was entered.

Just wondering if someone can help me out on this one:

Basically I have an RFID reader that puts a key trough serial

for (byte i = 0; i < mfrc522.uid.size; i++) {  // for size of uid.size write uid.uidByte to readCard
    readCard[i] = mfrc522.uid.uidByte[i];
    //Serial.print("F");
    Serial.print(readCard[i], HEX);

mfrc522.uid.size is a 6 byte array.

I want to check if a valid key has been entered at program startup.

I am thinking in using strcomp function, but not sure how to write the argument. How would I do this?

I want to check if a valid key has been entered at program startup.

What do you mean?

You can define a byte array represents a valid key and compare them

byte validKey[6] = {0x12,0x34,0x56,0x78,0x90,0x12}; // Define valid key’s UID

///////////////////////////////////////// Check Bytes   ///////////////////////////////////
boolean checkTwo ( byte a[], byte b[] ) {
  if ( a[0] != NULL ) // Make sure there is something in the array first
    match = true; // Assume they match at first
  for ( int k = 0; k < 4; k++ ) { // Loop 4 times
    if ( a[k] != b[k] ) // IF a != b then set match = false, one fails, all fail
      match = false;
  }
  if ( match ) { // Check to see if if match is still true
    return true; // Return true
  }
  else  {
    return false; // Return false
  }
}

in this case byte [a] =readCard byte = validKey

    readCard[i] = mfrc522.uid.uidByte[i];

Why do you need to copy the data? Why do you need to copy the data?

There are keys that have 4 byte UID or 7 byte UID, maybe because of that, maybe i am wrong? I should check library.