def mask_secrets(plaintext, secrets):
    """
    Replace secrets in plaintext with asterisks

    Args:
        plaintext (str or list): The plaintext to remove the secrets from or
            list of strings to remove secrets from
        secrets (list): List of secret strings to replace in the plaintext

    Returns:
        str: The censored version of plaintext

    """
    if secrets:
        for secret in secrets:
            if isinstance(plaintext, list):
                plaintext = [string.replace(secret, "*" * 5) for string in plaintext]
            else:
                plaintext = plaintext.replace(secret, "*" * 5)
    return plaintext