Co to jest Tink?
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Tink to biblioteka kryptograficzna typu open source napisana przez twórców kryptografii,
wśród inżynierów zabezpieczeń
w Google. Bezpieczne i proste interfejsy API Tink ograniczają typowe
związane z projektowaniem zorientowanym na użytkownika,
dokładną implementacją i weryfikacją kodu.
i szczegółowe testy. W sekcji Cele na tej stronie znajdziesz informacje
więcej informacji o celach, które miał osiągnąć Tink.
Tink pomaga użytkownikom bez tła kryptograficznego bezpiecznie wdrażać typowe rozwiązania
i zadania kryptograficzne. W Google firma Tink została wdrożona w setkach usług
i systemami.
Dlaczego warto używać biblioteki Tink?
Najważniejsze powody, dla których warto używać biblioteki Tink, to:
Prosta obsługa
Trudno jest uzyskać poprawny obraz kryptografii. Dzięki Tink możesz:
szyfrować lub podpisywać dane za pomocą
z wbudowanymi zabezpieczeniami za pomocą zaledwie kilku linijek kodu. Tink także
pomagają w rotacji kluczy lub zabezpieczaniu kluczy przy użyciu zewnętrznych systemów zarządzania kluczami (KMS)
(KMS).
Jest bezpieczna
Tink dodaje zabezpieczenia do znanych bibliotek, takich jak BoringSSL
oraz Java Cryptography Architecture i pokazuje je bezpośrednio w interfejsach,
aby umożliwić audytorom i narzędziom szybkie
wyszukiwanie luk. Tink oddziela też interfejsy API, które
mogą być niebezpieczne, więc warto je monitorować.
Jest zgodny
Mechanizmy szyfrowania Tink są zgodne z dotychczasowymi bibliotekami kryptograficznymi. Tink
obsługuje też szyfrowanie i przechowywanie kluczy w
Amazon KMS, Google Cloud KMS, magazyn kluczy Androida i pęk kluczy iOS.
Kto używa Tink?
Tink jest powszechnie używany przez wiele firm, w tym Google, Square i Citadel,
a także setkami klientów Google Cloud i partnerów Google Pay. Pokaż też
jest wykorzystywane w bibliotece zabezpieczeń Jetpack, która zabezpiecza wiele popularnych aplikacji na Androida.
takich jak Slack, Adidas, AirBnb czy Nextdoor.
Bramki Tink
Jakie są główne cele Tink w porównaniu z innymi bibliotekami kryptograficznymi?
Jakich głównych mechanizmów używa Tink, aby osiągnąć te cele?
Krótko mówiąc, Tink ma dwa cele:
- Zadbaj o elastyczność kryptograficzną: użytkownicy powinni mieć możliwość zmieniania kluczy i
do algorytmów.
- Włącz kontrole zabezpieczeń: Tink umożliwia użytkownikom pisanie kodu, którego
bezpieczeństwo można sprawdzić lokalnie za pomocą interfejsów, które jasno określają,
gwarancje bezpieczeństwa.
Główne mechanizmy, których używa Tink do osiągnięcia tych celów, to:
- Tink zawiera elementy podstawowe i interfejsy jako ważne abstrakcje. Te
abstrakcje umożliwiają użytkownikom pisanie kodu, który nie określa dokładnej
algorytm, ale zamiast tego określa oczekiwane pojęcie zabezpieczeń.
- Tink wykorzystuje pojęcie „zbioru kluczy”, czyli zestawu kluczy, które są wykorzystywane
powiązane z konkretnym elementem podstawowym. Powoduje to, że użytkownicy piszą kod
który działa z wieloma klawiszami.
- W Tink klucze są określane nie tylko przez materiał klucza,
algorytm kryptograficzny i wszystkie parametry. Oznacza to, że
klucz Tink zawsze wybiera unikalną funkcję kryptograficzną spośród wszystkich możliwych
które mogą istnieć i nie pozostawiają miejsca na interpretację.
W sekcjach poniżej znajdziesz więcej informacji na temat tych pojęć.
Elastyczność kryptograficzna
Weź pod uwagę inżynierię oprogramowania w Google,
książkę z lekcjami z dziedziny inżynierii oprogramowania,
podtytuł „Wnioski z programowania na przestrzeni czasu”. Autorzy przedstawiają w nim
usiłując przedstawić konsekwencje zmian, które zachodzą. Ten
miał też duży wpływ na projekt Tink. W kryptografii ważne jest,
przygotowując się na zmiany. Klucze wyciekną, a algorytmy – uszkodzone.
Możliwość odłączenia kluczy i algorytmów ma kluczowe znaczenie dla wielu użytkowników.
jest rozsądna.
Kontrole bezpieczeństwa i właściwości lokalne
Tink promuje korzystanie z takich interfejsów, jak np. AEAD,
zaszyfrowanie danych. Wśród innych gwarancji bezpieczeństwa AEAD
gwarantuje, że wiele szyfrowania tego samego ciągu spowoduje uzyskanie różnych
tekstów szyfrowanych.
Aby zobaczyć, jak można je wykorzystać, załóżmy, że inżynier chce przechowywać poufne
identyfikator w pliku cookie użytkownika. Mogą one utworzyć takie zajęcia:
class IdEncrypter {
public static IdEncrypter createFromAead(Aead aead);
public String encrypt(long id) throws GeneralSecurityException;
public long decrypt(String encrypted) throws GeneralSecurityException;
};
Zdanie Aead
skutkuje tymi właściwościami:
- Kod informuje, że do wykonania swojego zadania
IdEncrypter
wymaga
schematu szyfrowania z właściwościami zabezpieczeń dostępnymi w Aead
.
Ewentualnie
DeterministicAead
to za mało – IdEncrypter
wymaga dwóch szyfrów
są takie same. Z drugiej strony, biorąc jako parametr wystąpienie
szyfrowanie GCM AES (jedna konkretna instancja instancji Aead
) byłoby zbyt
ścisła: każdy składnik Aead wystarczy, aby IdEncrypter
wykonał swoje zadania, i nie
musi stosować jeden konkretny algorytm.
- Kontrola bezpieczeństwa może to wziąć pod uwagę. Kontroler bezpieczeństwa
nie trzeba przeglądać całego repozytorium kodu, aby sprawdzić,
ktoś utworzył podklasę
Aead
, która nie jest bezpieczna w użyciu
dzięki IdEncrypter
. Zamiast tego Tink udostępnia właściwości zabezpieczeń, które
Obiekty Aead mają i weryfikator może sprawdzić, czy są one wystarczające.
Szczególnie ostrożny jest zwłaszcza drugi punkt. Użytkownicy często proszą o dodanie
które są „niezupełnie” Aead
. W poprzednim punkcie wyjaśniamy, dlaczego
to jest niebezpieczne: jeśli jest dostępna implementacja Aead
, która
nie wykona wymaganych gwarancji bezpieczeństwa, IdEncrypter
może stać się niezabezpieczony,
a inżynier przeprowadzający kontrolę zabezpieczeń musi zbadać dodatkowy kod
aby sprawdzić, czy obiekt został poprawnie utworzony.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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."]]