def encrypt(data: dict) -> str:
    """Encrypt dictionary data.

    Args:
    ----
        data (dict): The data to encrypt.

    Returns:
    -------
        str: The encrypted data.
    """
    f = get_encryption_fernet()
    # Convert dict to JSON string, encode to bytes, then encrypt
    json_str = json.dumps(data)
    encrypted_data = f.encrypt(json_str.encode())
    return encrypted_data.decode()
Encrypt dictionary data.

    Args:
    ----
        data (dict): The data to encrypt.

    Returns:
    -------
        str: The encrypted data.
    
backend/airweave/core/credentials.py