def encrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id,
    plaintext):
    """Encrypts input plaintext data using the provided symmetric CryptoKey."""
    from google.cloud import kms_v1
    client = kms_v1.KeyManagementServiceClient()
    name = client.crypto_key_path_path(project_id, location_id, key_ring_id,
        crypto_key_id)
    response = client.encrypt(name, plaintext)
    return response.ciphertext
