Convert from hexadecimal to binary
There is really no reason to save the key as a string, as you are doing. You can just save it as a normal number. Then you can also use the hexadecimal representation on your code:
unsigned long key = 0xB8C4F9;

Then you need to send out each bit of that number:
for (int n = 0; n &lt; KEY_LEN; n++)
{
    if (key &amp; (1 &lt;&lt; n)) { //If the bit read == 1
        sendSignal(One);
    } else {//If the bit being read == 0
        sendSignal(Zero);
    }
}

The following is happening in the if statement: (1 &lt;&lt; n) will take the value 1 (binary 0b00000001) and will shift the bits to the left by n digits. For example: If n is 2, we get (0b00000001 &lt;&lt; 2) = 0b00000100. With this we can select a bit in our number. Then we take that and do a bitwise AND &amp; with the key. That will set all bits to zero, which are not currently selected. The resulting number is zero, if the corresponding bit in key is zero. If the corresponding bit is 1, this will return a number different from zero (which is interpreted as true. Thus we check, if the n-th bit of key is one or zero.

How can you automatically measure the length of an array so as not to manually calculate KEY_LEN?

Generally you can calculate the size of an array with the sizeof() function:
unsigned int size_of_array = sizeof(array)/sizeof(array[0]);

sizeof() returns the number of bytes. So to get the number of elements, we need to divide by the number of bytes in each element;
For the way shown above this is not that easy. Normally it is not really needed, since such keys normally don't change length very often. If you find a variable type, which exactly fits your key size, you could use sizeof(key)*8 to get the number of bits in it. But your current value 0xB8C4F9 only needs 3 bytes. I don't know a type with 3 bytes, but maybe somewhere you can get something like uint24_t. Honestly here I would just use a hardcoded size, just like you are using a hardcoded key value.