¿Qué es Tink?
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Tink es una biblioteca de criptografía de código abierto escrita por criptógrafos y
ingenieros de seguridad de Google. Las APIs seguras y sencillas de Tink reducen las conexiones
a través del diseño centrado en el usuario,
una implementación cuidadosa y revisiones
y pruebas exhaustivas. Consulta la sección Objetivos de esta página para ver
más información sobre los objetivos que Tink estaba diseñado para cumplir.
Tink ayuda a los usuarios sin un fondo de criptografía a implementar de forma segura
criptográficas. En Google, Tink se implementó en cientos de productos
y sistemas.
¿Por qué debería usar Tink?
Los motivos más importantes para usar Tink son los siguientes:
Es fácil de usar.
La criptografía es difícil de entender. Con Tink, puedes
encriptar o firmar datos con
las garantías de seguridad integradas
usando unas pocas líneas de código. Tink también puede
ayudarte a rotar claves o claves seguras mediante sistemas de administración de claves externos
(KMS).
Es segura.
Tink agrega protecciones de seguridad a bibliotecas conocidas como BoringSSL.
y Java, y las muestra directamente en las interfaces.
para que los auditores y las herramientas
pueden encontrar brechas con rapidez. Tink también separa las APIs que
son potencialmente peligrosos, por lo que puedes supervisarlos.
Es compatible
Los textos cifrados de Tink son compatibles con las bibliotecas de criptografía existentes. Tink
admite la encriptación o el almacenamiento de claves
Amazon KMS, Google Cloud KMS, Android Keystore y llavero de iOS.
¿Quién usa Tink?
Tink es muy utilizado por muchas empresas, como Google, Square y Citadel, ya que
así como cientos de clientes y socios de Google Pay. Tink también
potencia la biblioteca de seguridad de Jetpack, que protege muchas apps populares para Android
como Slack, Adidas, AirBnb y Nextdoor.
Objetivos de Tink
¿Cuáles son los objetivos principales de Tink en comparación con otras bibliotecas criptográficas?
¿Cuáles son los principales mecanismos que Tink utiliza para lograr estos objetivos?
En resumen, Tink tiene dos objetivos:
- Promover la agilidad criptográfica: Los usuarios deberían poder cambiar las claves y
de forma sencilla.
- Habilita las revisiones de seguridad: Tink tiene como objetivo permitir que los usuarios escriban código cuyo
la seguridad puede revisarse de forma local, ya que proporciona interfaces que brindan
garantías de seguridad.
Los principales mecanismos que Tink utiliza para lograr estos objetivos son los siguientes:
- Tink proporciona interfaces y primitivas como abstracciones importantes. Estos
Las abstracciones permiten que los usuarios escriban código que no especifica la
algoritmo que se usará, pero, en su lugar, especifica la noción de seguridad esperada.
- Tink usa la noción de un “conjunto de claves”, que es un conjunto de claves que se
asociados con un primitivo en particular. Como resultado, los usuarios escriben código
que funciona con varias claves.
- En Tink, las claves no solo se especifican con el material de clave subyacente, sino que
el algoritmo criptográfico
y todos los parámetros. Esto significa que
una clave Tink siempre selecciona una función criptográfica única de todas las
funciones que pueden existir
y no deja lugar para la interpretación.
En las siguientes secciones, se explican estos conceptos con más detalle.
Agilidad criptográfica
Considera ingeniería de software en Google,
un libro sobre las lecciones aprendidas en el campo de la ingeniería de software, con el
subtítulo "lecciones aprendidas de la programación a lo largo del tiempo". En ella, los autores van a
grandes para implorar las implicaciones del hecho de que las cosas cambian. Esta
también repercutió en gran parte
del diseño de Tink. En criptografía, es importante
que uno se prepara para el cambio. Se filtrarán las claves y se romperán los algoritmos.
Para muchos usuarios, es fundamental poder intercambiar claves y algoritmos.
es prudente estar preparado.
Revisiones de seguridad y propiedades locales
Tink promueve el uso de interfaces, como nuestra interfaz AEAD, que permite
a los usuarios para encriptar los datos. Entre otras garantías de seguridad, se incluye un AEAD
garantiza que las múltiples encriptaciones de la misma cadena dan como resultado diferentes
textos cifrados.
Para ver cómo se puede usar esto, supongamos que un ingeniero quiere almacenar información
de una cookie del usuario. Podrían proporcionar una clase como la siguiente:
class IdEncrypter {
public static IdEncrypter createFromAead(Aead aead);
public String encrypt(long id) throws GeneralSecurityException;
public long decrypt(String encrypted) throws GeneralSecurityException;
};
Cuando se pasa un Aead
, se obtienen las siguientes propiedades:
- El código comunica que, para que
IdEncrypter
haga su trabajo, necesita un elemento
esquema de encriptación con las propiedades de seguridad que proporciona un Aead
.
Como alternativa, un
DeterministicAead
no sería suficiente: el IdEncrypter
requiere que dos encriptaciones del
mismo ID son diferentes. Por otro lado, tomar como parámetro una instancia de
un cifrado AES GCM (una instancia particular de un Aead
) sería demasiado
Estricto: cualquier Aead es suficiente para que IdEncrypter
haga su trabajo, y no
necesita ser un algoritmo específico.
- Una revisión de seguridad puede tener este punto en cuenta. Un revisor de seguridad
no es necesario revisar todo el repositorio de código para verificar
en algún lugar, alguien creó una subclase de
Aead
que no es segura para su uso.
con IdEncrypter
. En cambio, Tink proporciona propiedades de seguridad que todas
Los objetos Aead sí tienen, y el revisor puede comprobar que sean suficientes.
En particular, el segundo punto requiere mucho cuidado. Los usuarios suelen pedir agregar
que "no son del todo" un objeto Aead
. El punto anterior ilustra por qué
Esto es peligroso si hay alguna implementación de Aead
disponible que
no proporciona las garantías de seguridad necesarias, IdEncrypter
puede volverse inseguro
y el ingeniero que realiza una revisión de seguridad
debe examinar código adicional
para verificar que se haya creado la instancia del objeto correctamente.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-25 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-25 (UTC)"],[[["\u003cp\u003eTink is an open-source cryptography library designed for easy and secure implementation of common cryptographic tasks, even for users without a cryptography background.\u003c/p\u003e\n"],["\u003cp\u003eTink prioritizes security by adding protections on top of existing libraries like BoringSSL, using distinct APIs for potentially risky operations, and ensuring ciphertext compatibility with other libraries.\u003c/p\u003e\n"],["\u003cp\u003eTink promotes cryptographic agility by enabling easy key and algorithm changes, and it supports integration with external key management systems like Amazon KMS and Google Cloud KMS.\u003c/p\u003e\n"],["\u003cp\u003eDesigned with security reviews in mind, Tink utilizes interfaces with clear security guarantees and the concept of keysets for enhanced security and code clarity.\u003c/p\u003e\n"],["\u003cp\u003eGoogle, Square, and Citadel are among the many companies that utilize Tink, further demonstrating its reliability and widespread adoption within various applications and systems.\u003c/p\u003e\n"]]],["Tink, a Google-developed open-source cryptography library, simplifies secure cryptographic implementation for users, even without cryptography expertise. It's designed for simplicity, security, and compatibility, supporting key rotation and external Key Management Systems (KMS). Tink prioritizes cryptographic agility, enabling easy key and algorithm changes, and facilitates security reviews by providing clear interfaces and security guarantees. It uses primitives, keysets, and comprehensive key specifications to achieve these goals, ensuring secure, verifiable, and adaptable cryptographic operations.\n"],null,["# What is Tink?\n\nTink is an open-source cryptography library written by cryptographers and\nsecurity engineers at Google. Tink's secure and simple APIs reduce common\npitfalls through user-centered design, careful implementation and code reviews,\nand extensive testing. See the [Goals](#tink_goals) section on this page for\nmore insight into which objectives Tink was designed to fulfil.\n\nTink helps users without a cryptography background safely implement common\ncryptographic tasks. At Google, Tink has been deployed in hundreds of products\nand systems.\n\nWhy should I use Tink?\n----------------------\n\nThe most important reasons to use Tink are:\n\n- **It's simple to use**\n\n Cryptography is difficult to get right. With Tink, you can\n [encrypt](/tink/encrypt-data) or [sign data](/tink/digitally-sign-data) with\n built-in security guarantees using just a few lines of code. Tink can also\n help you rotate keys or secure keys using external Key Management Systems\n (KMSs).\n- **It's secure**\n\n Tink adds security protections on top of well known libraries like BoringSSL\n and Java Cryptography Architecture and shows them right in the interfaces,\n so auditors and tools can quickly find gaps. Tink also separates APIs that\n are potentially dangerous, so you can monitor them.\n- **It's compatible**\n\n Tink ciphertexts are compatible with existing cryptography libraries. Tink\n also supports [encrypting or storing keys](/tink/client-side-encryption) in\n Amazon KMS, Google Cloud KMS, Android Keystore, and iOS Keychain.\n\nWho's using Tink?\n-----------------\n\nTink is widely used by many companies, including Google, Square, and Citadel, as\nwell as hundreds of Google Cloud customers and Google Pay partners. Tink also\npowers the Jetpack Security library, which secures many popular Android apps\nlike Slack, Adidas, AirBnb, and Nextdoor.\n\nTink Goals\n----------\n\nWhat are the main goals of Tink compared to other cryptographic libraries, and\nwhat are the main mechanisms which Tink uses to achieve these goals?\n\nIn short, Tink has two goals:\n\n1. *Promote cryptographic agility*: Users should be able to change keys and algorithms in a simple way.\n2. *Enable security reviews*: Tink aims to allow users to write code whose security can be reviewed locally, by providing interfaces which give clear security guarantees.\n\nThe main mechanisms Tink uses to achieve these goals are as follows:\n\n1. Tink provides primitives and interfaces as important abstractions. These abstractions allow users to write code which does not specify the exact algorithm to be used, but instead specifies the expected security notion.\n2. Tink uses the notion of a \"keyset\", which is a set of keys that are associated with a particular primitive. This results in users writing code which works with multiple keys.\n3. In Tink, keys are not only specified by the underlying key material, but also the cryptographic algorithm, as well as all parameters. This means that a Tink key always selects a unique cryptographic function from all possible functions which can exist, and leaves no room for interpretation.\n\nThe following sections explain these concepts in more detail.\n\n### Cryptographic agility\n\nConsider [Software Engineering at Google](https://abseil.io/resources/swe-book),\na book about lessons learned in the field of software engineering, with the\nsubtitle \"lessons learned from programming over time\". In it, the authors go to\ngreat lengths to implore the implications of the fact that things change. This\nfact also impacted much of the design of Tink. In cryptography, it is important\nthat one prepares for change. Keys will leak, and algorithms will be broken.\nBeing able to switch out keys and algorithms is crucial for many users, and\nbeing prepared is prudent.\n\n### Security reviews and local properties\n\nTink promotes the use of interfaces, such as our AEAD interface, which allows\nusers to encrypt data. Among [other security guarantees](https://developers.google.com/tink/aead#security_guarantees), an AEAD\nguarantees that multiple encryptions of the same string result in different\nciphertexts.\n\nTo see how this can be used, suppose an engineer wants to store some sensitive\nID in a user cookie. They might provide a class such as this: \n\n class IdEncrypter {\n public static IdEncrypter createFromAead(Aead aead);\n\n public String encrypt(long id) throws GeneralSecurityException;\n public long decrypt(String encrypted) throws GeneralSecurityException;\n };\n\nPassing an `Aead` obtains the following properties:\n\n1. The code communicates that for `IdEncrypter` to do its job, it requires an encryption scheme with the security properties an [`Aead` provides](https://developers.google.com/tink/aead#security_guarantees). Alternatively, a [`DeterministicAead`](https://developers.google.com/tink/deterministic-aead) wouldn't be enough -- the `IdEncrypter` requires that two encryptions of the same id are different. On the other hand, taking as parameter an instance of an AES GCM encrypter (one particular instance of an `Aead`) would be overly strict: any Aead is enough for `IdEncrypter` to do its job, and it does not need to be one specific algorithm.\n2. A security review can take this point into account. A security reviewer does not need to go through all of the entire code repository to check if somewhere, someone made a subclass of `Aead` which is not secure for use with `IdEncrypter`. Instead, Tink provides security properties which all Aead objects have, and the reviewer can check that these are sufficient.\n\nIn particular the second point requires a lot of care. Users often ask to add\nalgorithms which are 'not quite' an `Aead`. The previous point illustrates why\nthis is dangerous: if there is any implementation of `Aead` available which does\nnot provide the required security guarantees, `IdEncrypter` can become insecure,\nand the engineer performing a security review needs to examine additional code\nto check that the object is instantiated correctly."]]