import base64
import secrets


def csp_nonce() -> str:
    """
    Generate a Base64 random string of 24 characters for the cryptographic nonce.

    Returns:
        str: Random string of 24 Base64 characters.
    """
    return base64.b64encode(secrets.token_bytes(18)).decode("utf-8")