To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

Winding roadimages free

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

The API returns the same image(s) you gave it, but any text identified as containing sensitive information according to your criteria has been redacted.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

Important: The code on this page requires that you first set up a Sensitive Data Protection client. For more information about installing and creating a Sensitive Data Protection client, see Sensitive Data Protection client libraries. (Sending JSON to Sensitive Data Protection REST endpoints does not require a client library.)

In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

For example, consider the following image. This is an example of a typical image file generated from a scan of a paper document.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Consider the original image from the first section. To redact all text, send the following JSON to the DLP API's image.redact method:

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

For example, consider the following "before" and "after" images. The original image is an example of a typical image file generated from a scan of a paper document. In this example, Sensitive Data Protection has been configured to redact US Social Security numbers, email addresses, and telephone numbers using rectangles of different colors, depending on the content.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

When redacting data from images, finding limits don't apply. They can cause unexpected or potentially inconsistent results, where only some data is redacted. If you include FindingLimits in your request, Sensitive Data Protection generates an error.

Winding roadclipart

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Consider the original image from the first section. To redact US Social Security numbers with a purple box, email addresses with a green box, and telephone numbers with an orange box, send the following JSON to the DLP API's image.redact method:

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

windingroad中文

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

Image

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials. This variable applies only to your current shell session, so if you open a new session, set the variable again.

Winding roadpronunciation

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Sensitive Data Protection can redact sensitive data from many image types, including JPEG, BMP, and PNG. For more information, see Supported file types.

You can try out each of the examples on this page yourself—or experiment with your own images—in the APIs Explorer on the reference page for image.redact:

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

This example is similar to Redacting specific infoTypes from an image. It additionally demonstrates how to specify a minimum likelihood.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To redact specific infoTypes from an image, submit a request to the DLP API's image.redact method. The request must include the following:

Winding roadvector

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To redact sensitive data from an image, submit the image to the DLP API's image.redact method. Unless you specify specific information types (infoTypes) to search for, Sensitive Data Protection searches for the most common infoTypes.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

You can color code redacted information by infoType when you want to tell at a glance what's been redacted. See the following section for more information.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Image

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To redact all text from an image, submit a request to the DLP API's image.redact method. The request must include the following:

Sensitive Data Protection can redact sensitive text from an image. Using infoType detectors and Cloud Vision, Sensitive Data Protection inspects an image for text, detects sensitive data within the text, and then returns an image with any matching sensitive data obscured by an opaque rectangle.

Winding roadmeaning

Important: The code on this page requires that you first set up a Sensitive Data Protection client. For more information about installing and creating a Sensitive Data Protection client, see Sensitive Data Protection client libraries. (Sending JSON to Sensitive Data Protection REST endpoints does not require a client library.)

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To color-code infoTypes redacted from an image, submit a request to the DLP API's image.redact method. The request must include the following:

Important: The code on this page requires that you first set up a Sensitive Data Protection client. For more information about installing and creating a Sensitive Data Protection client, see Sensitive Data Protection client libraries. (Sending JSON to Sensitive Data Protection REST endpoints does not require a client library.)

Note that in addition to masking the handwritten Social Security number, the email address, and the phone number, Sensitive Data Protection also redacted the year. The next section demonstrates how to redact only certain infoTypes.

Important: The code on this page requires that you first set up a Sensitive Data Protection client. For more information about installing and creating a Sensitive Data Protection client, see Sensitive Data Protection client libraries. (Sending JSON to Sensitive Data Protection REST endpoints does not require a client library.)

Important: The code on this page requires that you first set up a Sensitive Data Protection client. For more information about installing and creating a Sensitive Data Protection client, see Sensitive Data Protection client libraries. (Sending JSON to Sensitive Data Protection REST endpoints does not require a client library.)

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Winding roadimages

Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials. This variable applies only to your current shell session, so if you open a new session, set the variable again.

Image

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

Consider the original image from the previous section. To redact only US Social Security numbers, email addresses, and telephone numbers, send the following JSON to the DLP API's image.redact method:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Winding roadsign

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To authenticate to Sensitive Data Protection, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.

To learn how to install and use the client library for Sensitive Data Protection, see Sensitive Data Protection client libraries.