To use this function, create a Google Cloud Function that uses the encrypt_json() function in Google Cloud Console or the gcloud command-line tool. Once created the function, invoke it by sending a POST request to the function’s URL. The request body should contain the JSON document to encrypt. The response body will contain the encrypted JSON document. For example, to encrypt the JSON document my_data.json, you would use the following command: The response body will contain the encrypted JSON document. This function uses the Google Cloud KMS service to encrypt the JSON document. So make sure there’s a KMS key enabled in a project before using the function.