Convert seckey0 to bytes at the start of the function. Return the output as bytes for consistency with the rest of the code.