Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta guía, se describe cómo funciona la encriptación y desencriptación con la API de Client-side Encryption de Google Workspace.
Debes incluir en la lista de entidades permitidas todos los servicios de proveedores de identidad (IdP) que usen los usuarios que comparten archivos encriptados. Por lo general, puedes encontrar los detalles del IdP necesarios en su archivo .well-known disponible públicamente. De lo contrario, comunícate con el administrador de Google Workspace de la organización para obtener los detalles del IdP.
Encripta datos
Cuando un usuario de Google Workspace solicita guardar o almacenar datos encriptados del cliente (CSE), Google Workspace envía una solicitud wrap a la URL del extremo de tu servicio de lista de control de acceso a claves (KACLS) para la encriptación.
Además de las verificaciones de seguridad opcionales, como las verificaciones perimetrales y las basadas en reclamos de JWT, tu KACLS debe realizar los siguientes pasos:
Verifica que los tokens de autorización y autenticación sean para el mismo usuario realizando una coincidencia que no distinga mayúsculas de minúsculas en las declaraciones de correo electrónico.
Cuando el token de autenticación contiene el reclamo opcional google_email, se debe comparar con el reclamo de correo electrónico en el token de autorización con un enfoque que no distinga mayúsculas de minúsculas. No uses la reclamación de correo electrónico dentro del token de autenticación para esta comparación.
En situaciones en las que el token de autenticación no incluye el reclamo google_email opcional, el reclamo de correo electrónico dentro del token de autenticación se debe comparar con el reclamo de correo electrónico en el token de autorización, utilizando un método que no distinga mayúsculas de minúsculas.
En situaciones en las que Google emite un token de autorización para un correo electrónico que no está asociado a una Cuenta de Google, debe estar presente el reclamo email_type.
Esto constituye una parte fundamental de la función de acceso para invitados, ya que proporciona información valiosa para que los KACL apliquen medidas de seguridad adicionales a los usuarios externos.
Estos son algunos ejemplos de cómo un KACLS puede usar esta información:
Imponer requisitos de registro adicionales
Restringir el emisor de tokens de autenticación a un IdP para invitados dedicado
Para requerir reclamos adicionales en el token de autenticación
Si un cliente no configuró el acceso de invitado, se pueden rechazar todas las solicitudes en las que email_type esté establecido en google-visitor o customer-idp. Se deben seguir aceptando las solicitudes con un email_type de google o con un email_type sin configurar.
Cuando el token de autenticación contiene el reclamo opcional delegated_to, también debe contener el reclamo resource_name, y estos dos reclamos deben compararse con los reclamos delegated_to y resource_name en el token de autorización. Los reclamos de delegated_to se deben comparar con un enfoque que no distinga mayúsculas de minúsculas, y el resource_name en los tokens debe coincidir con el resource_name de la operación.
Verifica que el reclamo role en el token de autorización sea writer o upgrader.
Verifica que el reclamo kacls_url en el token de autorización coincida con la URL actual de KACLS. Esta verificación permite detectar posibles servidores de intermediarios configurados por personas internas o administradores de dominio no autorizados.
Realiza una verificación del perímetro con las declaraciones de autenticación y autorización.
Encripta las siguientes partes con un algoritmo de encriptación autenticado:
Clave de encriptación de datos (DEK)
Los valores resource_name y perimeter_id del token de autorización
Cualquier otro dato sensible
Registra la operación, incluido el usuario que la originó, el resource_name y el motivo que se pasó en la solicitud.
Devuelve un objeto binario opaco para que Google Workspace lo almacene junto con el objeto encriptado y lo envíe tal cual en cualquier operación posterior de desencriptado de claves. O bien, mostrar una respuesta de error estructurada
El objeto binario debe contener la única copia de la DEK encriptada, y se pueden almacenar en él datos específicos de la implementación.
Desencripta datos
Cuando un usuario de Google Workspace solicita abrir datos encriptados del cliente (CSE), Google Workspace envía una solicitud unwrap a la URL del extremo de tu KACLS para la desencriptación. Además de las verificaciones de seguridad opcionales, como las verificaciones perimetrales y las basadas en reclamaciones de JWT, tu KACLS debe realizar los siguientes pasos:
Verifica que los tokens de autorización y autenticación sean para el mismo usuario realizando una coincidencia que no distinga mayúsculas de minúsculas en las declaraciones de correo electrónico.
Cuando el token de autenticación contiene el reclamo opcional google_email, se debe comparar con el reclamo de correo electrónico en el token de autorización con un enfoque que no distinga mayúsculas de minúsculas. No uses la reclamación de correo electrónico dentro del token de autenticación para esta comparación.
En situaciones en las que el token de autenticación no incluye el reclamo google_email opcional, el reclamo de correo electrónico dentro del token de autenticación se debe comparar con el reclamo de correo electrónico en el token de autorización, utilizando un método que no distinga mayúsculas de minúsculas.
En situaciones en las que Google emite un token de autorización para un correo electrónico que no está asociado a una Cuenta de Google, debe estar presente el reclamo email_type.
Esto constituye una parte fundamental de la función de acceso para invitados, ya que proporciona información valiosa para que los KACL apliquen medidas de seguridad adicionales a los usuarios externos.
Estos son algunos ejemplos de cómo un KACLS puede usar esta información:
Imponer requisitos de registro adicionales
Restringir el emisor de tokens de autenticación a un IdP para invitados dedicado
Para requerir reclamos adicionales en el token de autenticación
Si un cliente no configuró el acceso de invitado, se pueden rechazar todas las solicitudes en las que email_type esté establecido en google-visitor o customer-idp. Se deben seguir aceptando las solicitudes con un email_type de google o con un email_type sin configurar.
Cuando el token de autenticación contiene el reclamo opcional delegated_to, también debe contener el reclamo resource_name, y estos dos reclamos deben compararse con los reclamos delegated_to y resource_name en el token de autorización. Los reclamos de delegated_to se deben comparar con un enfoque que no distinga mayúsculas de minúsculas, y el resource_name en los tokens debe coincidir con el resource_name de la operación.
Verifica que el reclamo role en el token de autorización sea reader o writer.
Verifica que el reclamo kacls_url en el token de autorización coincida con la URL actual de KACLS. Esto permite detectar posibles servidores de intermediarios configurados por administradores internos o administradores de dominios no autorizados.
Desencripta las siguientes partes con un algoritmo de encriptación autenticado:
Clave de encriptación de datos (DEK)
Los valores resource_name y perimeter_id del token de autorización
Cualquier otro dato sensible
Verifica que el resource_name del token de autorización y el BLOB descifrado coincidan.
Realiza una verificación del perímetro con las declaraciones de autenticación y autorización.
Registra la operación, incluido el usuario que la originó, el resource_name y el motivo que se pasó en la solicitud.
[null,null,["Última actualización: 2025-08-29 (UTC)"],[[["\u003cp\u003eThis guide outlines the process of encrypting and decrypting data using the Google Workspace Client-side Encryption API, leveraging a Key Access and Control List Service (KACLS).\u003c/p\u003e\n"],["\u003cp\u003eDuring encryption, the KACLS validates the user, encrypts the data encryption key (DEK) and other sensitive data, logs the operation, and returns an opaque binary object containing the encrypted DEK to Google Workspace for storage.\u003c/p\u003e\n"],["\u003cp\u003eFor decryption, the KACLS validates the user, decrypts the DEK and associated data, verifies the resource name, performs a perimeter check, logs the operation, and returns the unwrapped DEK to Google Workspace.\u003c/p\u003e\n"],["\u003cp\u003eBefore sharing encrypted files, ensure to allowlist any Identity Provider (IdP) services used by the intended recipients, which typically involves obtaining IdP details from their publicly available .well-known file or contacting their Google Workspace administrator.\u003c/p\u003e\n"]]],["When users encrypt data, the KACLS must validate user authentication and authorization tokens, ensuring matching email claims and specific role and URL claims. It encrypts the Data Encryption Key (DEK), `resource_name`, `perimeter_id`, and other sensitive data, logs the operation, and returns an encrypted object. For decryption, the process mirrors encryption, validating tokens, decrypting the data, verifying `resource_name`, performing perimeter checks, logging, and returning the DEK. Guest access requires extra checks. Identity provider services must be allowlisted.\n"],null,["# Encrypt & decrypt data\n\nThis guide describes how encryption and decryption works using the Google Workspace Client-side Encryption API.\n\nYou must allowlist any Identity Provider (IdP) services used by users\nsharing encrypted files. You can usually find the required IdP details in their\npublicly-available .well-known file; otherwise, contact the organization's\nGoogle Workspace administrator for their IdP details.\n\nEncrypt data\n------------\n\nWhen a Google Workspace user requests to save or store client-side encrypted\n(CSE) data, Google Workspace sends a [`wrap`](/workspace/cse/reference/wrap)\nrequest to your Key Access Control List Service (KACLS) endpoint URL for encryption.\nIn addition to optional security checks, such as perimeter and JWT claim-based checks,\nyour KACLS must perform the following steps:\n\n1. Validate the requesting user.\n\n - Validate both the [authentication token](/workspace/cse/reference/authentication-tokens) and [authorization token](/workspace/cse/reference/authorization-tokens).\n - Check that authorization and authentication tokens are for the same user by doing a case-insensitive match on the email claims.\n - When the authentication token contains the optional `google_email` claim, it must be compared against the email claim in the authorization token using a case-insensitive approach. Don't use the email claim within the authentication token for this comparison.\n - In scenarios where the authentication token lacks the optional `google_email` claim, the email claim within the authentication token should be compared with the email claim in the authorization token, using a case-insensitive method.\n - In scenarios where Google issues an authorization token for an email not associated with a Google Account, the `email_type` claim must be present. This forms a crucial part of the Guest Access feature, providing valuable information for KACLS to enforce additional security measures on external users.\n - Some examples of how a KACLS can use this information include:\n - To impose additional logging requirements.\n - To restrict the authentication token issuer to a dedicated Guest IdP.\n - To require additional claims on the authentication token.\n - If a customer has not configured Guest Access, then all requests where `email_type` is set to `google-visitor` or `customer-idp` can be rejected. Requests with an `email_type` of `google` or with an unset `email_type` should continue to be accepted.\n - When the authentication token contains the optional `delegated_to` claim, it must also contain the `resource_name` claim, and these two claims must be compared against the `delegated_to` and `resource_name` claims in the authorization token. The `delegated_to` claims should be compared using a case-insensitive approach, and the `resource_name` in the tokens should match the `resource_name` of the operation.\n - Check that the `role` claim in the authorization token is `writer` or `upgrader`.\n - Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This check allows detection of potential man-in-the-middle servers configured by insiders or rogue domain administrators.\n - Perform a perimeter check using both authentication and authorization claims.\n2. Encrypt the following parts using an authenticated encryption algorithm:\n\n - Data Encryption Key (DEK)\n - The `resource_name` and `perimeter_id` values from the authorization token\n - Any additional sensitive data\n3. Log the operation, including the user originating it, the `resource_name` and\n the reason passed in the request.\n\n4. Return an opaque binary object to be stored by Google Workspace alongside\n the encrypted object and sent as-is in any subsequent key unwrapping\n operation. Or, serve a [structured error reply](/workspace/cse/reference/structured-errors).\n\n - The binary object should contain the only copy of the encrypted DEK, implementation specific data can be stored in it.\n\n| **Note:** Do not store the DEK in your KACLS system. Instead, encrypt it and return it in the `wrapped_key` object to prevent discrepancies for the lifetime of the file. Google doesn't send deletion requests to the KACLS when objects are deleted.\n\nDecrypt data\n------------\n\nWhen a Google Workspace user requests to open client-side encrypted (CSE) data,\nGoogle Workspace sends an [`unwrap`](/workspace/cse/reference/unwrap) request\nto your KACLS endpoint URL for decryption. In addition to optional security\nchecks, such as perimeter and JWT claim-based checks, your KACLS must perform\nthe following steps:\n\n1. Validate the requesting user.\n\n - Validate both the [authentication token](/workspace/cse/reference/authentication-tokens) and [authorization token](/workspace/cse/reference/authorization-tokens).\n - Check that authorization and authentication tokens are for the same user by doing a case-insensitive match on the email claims.\n - When the authentication token contains the optional `google_email` claim, it must be compared against the email claim in the authorization token using a case-insensitive approach. Don't use the email claim within the authentication token for this comparison.\n - In scenarios where the authentication token lacks the optional `google_email` claim, the email claim within the authentication token should be compared with the email claim in the authorization token, using a case-insensitive method.\n - In scenarios where Google issues an authorization token for an email not associated with a Google Account, the `email_type` claim must be present. This forms a crucial part of the Guest Access feature, providing valuable information for KACLS to enforce additional security measures on external users.\n - Some examples of how a KACLS can use this information include:\n - To impose additional logging requirements.\n - To restrict the authentication token issuer to a dedicated Guest IdP.\n - To require additional claims on the authentication token.\n - If a customer has not configured Guest Access, then all requests where `email_type` is set to `google-visitor` or `customer-idp` can be rejected. Requests with an `email_type` of `google` or with an unset `email_type` should continue to be accepted.\n - When the authentication token contains the optional `delegated_to` claim, it must also contain the `resource_name` claim, and these two claims must be compared against the `delegated_to` and `resource_name` claims in the authorization token. The `delegated_to` claims should be compared using a case-insensitive approach, and the `resource_name` in the tokens should match the `resource_name` of the operation.\n - Check that the `role` claim in the authorization token is `reader` or `writer`.\n - Check that the `kacls_url` claim in the authorization token matches the current KACLS URL. This allows detection of potential man-in-the-middle servers configured by insiders or rogue domain administrators.\n2. Decrypt the following parts using an authenticated encryption algorithm:\n\n - Data Encryption Key (DEK)\n - The `resource_name` and `perimeter_id` values from the authorization token\n - Any additional sensitive data\n3. Check that the `resource_name` in the authorization token and decrypted blob\n match.\n\n4. Perform a perimeter check using both authentication and authorization claims.\n\n5. Log the operation, including the user originating it, the `resource_name` and\n the reason passed in the request.\n\n6. Return the unwrapped DEK or a [structured error reply](/workspace/cse/reference/structured-errors).\n\n| **Note:** To decrypt [Google Takeout](https://support.google.com/a/answer/100458) requests, see [`takeout_unwrap`](/workspace/cse/reference/takeout_unwrap)."]]