Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Step 7: Encrypt data

Focus mode
Step 7: Encrypt data - AWS Clean Rooms

To perform this step, you must acquire the AWS Clean Rooms collaboration ID and the shared secret key. For more information, see the Prerequisites.

In the following example, we run the encryption on ads.csv, using the schema that we created called ads.json.

To encrypt data
  1. Store the shared secret key for the collaboration in Step 6: Store the shared secret key in an environment variable.

  2. From the command line, enter the following command.

    java -jar c3r-cli.jar encrypt <name of input .csv file> --schema=<name of schema .json file> --id=<collaboration id> --output=<name of output.csv file> <optional flags>

  3. For <name of input .csv file>, enter the name of the input .csv file.

  4. For schema=, enter the name of the .json encryption schema file.

  5. For id=, enter the collaboration ID.

  6. For output=, enter the name of the output file (for example, ads-output.csv).

  7. Include any of the command line flags described in Cryptographic computing parameters and Optional flags in Cryptographic Computing for Clean Rooms.

  8. Run the command.

In the example for ads.csv, we run the following command.

java -jar c3r-cli.jar encrypt ads.csv --schema=ads.json --id=123e4567-e89b-42d3-a456-556642440000 --output=ads-output.csv

In the example for sales.csv, we run the following command.

java -jar c3r-cli.jar encrypt sales.csv --schema=sales.json --id=123e4567-e89b-42d3-a456-556642440000

Note

In this example, we don't specify an output file name (--output=sales-output.csv). As a result, the default output file name name-of-file.out.csv was generated.

You are now ready to verify the encrypted data.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.