I want to simplify a process where a non-privileged person needs to encrypt data with a symmetric key (AES-GCM) and give me the result. Non-privileged simply means the person has no access to the encryption key.

With asymmetric cryptos like RSA and EC, giving anyone the public key is of course part of the whole idea, but with symmetric cryptos, the privileged party is the only one who can decrypt *or* encrypt, obviously.

To simplify my workflow I'm considering setting up a simple HTTP endpoint that encrypts a given string using my private symmetric key and returns the result. Something like

```
GET somewhere.com/encrypt?keyId=foo&data=Hello%20world

```

which would return something like

```
{
  "keyId": "foo",
  "encryptedData": "xxxxxx"
}

```

Behind the scenes, this could be an AWS Lambda function using a KMS key designated by `keyId` to encrypt `data` and return the encrypted result.

However, I want to be sure this is not a security problem in itself. For example, is there a known attack where someone can find out the key material for AES from encrypting billions of strings and then processing the source strings and their encrypted counterparts? In other words, would exposing an encryption endpoint be a problem?