def _xor_cipher(key, value):
    """xor two bytes objs together, zero padding the value if needed.

    Args:
        key (bytes): The key used for ciphering. For Apple's VNC
            password, this should be 16 bytes long.
        value (bytes): The value to cipher/decipher. For Apple's VNC, it
            should be no more than 8 characters.

    Returns:
        bytes of len(key).
    """
    # We zero pad the value as Apple stores a 16 byte value no matter
    # what, even though the max VNC password is 8 bytes long.
    klen, vlen = len(key), len(value)
    if klen > vlen:
        value += b'\00' * (klen - vlen)

    return bytes([a ^ b for a, b in zip(key, value)])