import base64


def secret_data_encode_bytes(data: bytes) -> bytes:
    """
    Encode bytes secret using the current provider.
    The encoding is done using base64, and raw bytes are returned

    :param data: Data to encode
    :return: encoded secret
    :raises KG2Exception: on error
    """
    return base64.b64encode(data)